-
-
Notifications
You must be signed in to change notification settings - Fork 88
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
16 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
<?php | ||
|
||
/* | ||
* This file is part of the overtrue/phplint. | ||
* This file is part of the overtrue/phplint | ||
* | ||
* (c) overtrue <[email protected]> | ||
* | ||
|
@@ -100,6 +100,6 @@ public static function getFilename() | |
return self::$filename; | ||
} | ||
|
||
return (getcwd() ?: './').'/'.self::$filename; | ||
return (getcwd() ?: './') . '/' . self::$filename; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
<?php | ||
|
||
/* | ||
* This file is part of the overtrue/phplint. | ||
* This file is part of the overtrue/phplint | ||
* | ||
* (c) overtrue <[email protected]> | ||
* | ||
|
@@ -167,13 +167,13 @@ protected function execute(InputInterface $input, OutputInterface $output) | |
$startTime = microtime(true); | ||
$startMemUsage = memory_get_usage(true); | ||
|
||
$output->writeln($this->getApplication()->getLongVersion()." by overtrue and contributors.\n"); | ||
$output->writeln($this->getApplication()->getLongVersion() . " by overtrue and contributors.\n"); | ||
|
||
$options = $this->mergeOptions(); | ||
$verbosity = $output->getVerbosity(); | ||
|
||
if ($verbosity >= OutputInterface::VERBOSITY_DEBUG) { | ||
$output->writeln('Options: '.json_encode($options)."\n"); | ||
$output->writeln('Options: ' . json_encode($options) . "\n"); | ||
} | ||
|
||
$linter = new Linter($options['path'], $options['exclude'], $options['extensions']); | ||
|
@@ -302,7 +302,7 @@ protected function executeLint($linter, $input, $output, $fileCount) | |
$process = str_pad(" {$i} / {$fileCount} ({$percent}%)", 18, ' ', STR_PAD_LEFT); | ||
|
||
if ($verbosity >= OutputInterface::VERBOSITY_VERBOSE) { | ||
$filename = str_pad(" {$i}: ".$file->getRelativePathname(), $maxColumns - 10, ' ', \STR_PAD_RIGHT); | ||
$filename = str_pad(" {$i}: " . $file->getRelativePathname(), $maxColumns - 10, ' ', \STR_PAD_RIGHT); | ||
$status = \str_pad(('ok' === $status ? '<info>OK</info>' : '<error>Error</error>'), 20, ' ', \STR_PAD_RIGHT); | ||
$output->writeln(\sprintf("%s\t%s\t%s", $filename, $status, $process)); | ||
} else { | ||
|
@@ -329,10 +329,10 @@ protected function executeLint($linter, $input, $output, $fileCount) | |
protected function showErrors($errors) | ||
{ | ||
$i = 0; | ||
$this->output->writeln("\nThere was ".count($errors).' errors:'); | ||
$this->output->writeln("\nThere was " . count($errors) . ' errors:'); | ||
|
||
foreach ($errors as $filename => $error) { | ||
$this->output->writeln('<comment>'.++$i.". {$filename}:{$error['line']}".'</comment>'); | ||
$this->output->writeln('<comment>' . ++$i . ". {$filename}:{$error['line']}" . '</comment>'); | ||
|
||
$this->output->write($this->getHighlightedCodeSnippet($filename, $error['line'])); | ||
|
||
|
@@ -361,7 +361,7 @@ protected function getCodeSnippet($filePath, $lineNumber, $linesBefore = 3, $lin | |
|
||
foreach ($lines as $i => $line) { | ||
$snippet .= (abs($lineNumber) === $i + 1 ? ' > ' : ' '); | ||
$snippet .= str_pad($i + 1, $lineStrlen, ' ', STR_PAD_LEFT).'| '.rtrim($line).PHP_EOL; | ||
$snippet .= str_pad($i + 1, $lineStrlen, ' ', STR_PAD_LEFT) . '| ' . rtrim($line) . PHP_EOL; | ||
} | ||
|
||
return $snippet; | ||
|
@@ -445,7 +445,7 @@ protected function getConfigFile() | |
$dir = is_dir($first) ? $first : dirname($first); | ||
} | ||
|
||
$filename = rtrim($dir, DIRECTORY_SEPARATOR).DIRECTORY_SEPARATOR.'.phplint.yml'; | ||
$filename = rtrim($dir, DIRECTORY_SEPARATOR) . DIRECTORY_SEPARATOR . '.phplint.yml'; | ||
|
||
return realpath($filename); | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
<?php | ||
|
||
/* | ||
* This file is part of the overtrue/phplint. | ||
* This file is part of the overtrue/phplint | ||
* | ||
* (c) overtrue <[email protected]> | ||
* | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
<?php | ||
|
||
/* | ||
* This file is part of the overtrue/phplint. | ||
* This file is part of the overtrue/phplint | ||
* | ||
* (c) overtrue <[email protected]> | ||
* | ||
|
@@ -185,7 +185,7 @@ protected function getFilesFromDir($dir) | |
} | ||
|
||
foreach ($this->extensions as $extension) { | ||
$finder->name('*.'.$extension); | ||
$finder->name('*.' . $extension); | ||
} | ||
|
||
return iterator_to_array($finder); | ||
|
@@ -251,7 +251,7 @@ public function setProcessLimit($processLimit) | |
protected function createLintProcess($filename) | ||
{ | ||
$command = [ | ||
PHP_SAPI == 'cli' ? PHP_BINARY : PHP_BINDIR.'/php', | ||
PHP_SAPI == 'cli' ? PHP_BINARY : PHP_BINDIR . '/php', | ||
'-d error_reporting=E_ALL', | ||
'-d display_errors=On', | ||
'-l', $filename, | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
<?php | ||
|
||
/* | ||
* This file is part of the overtrue/phplint. | ||
* This file is part of the overtrue/phplint | ||
* | ||
* (c) overtrue <[email protected]> | ||
* | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
<?php | ||
|
||
/* | ||
* This file is part of the overtrue/phplint. | ||
* This file is part of the overtrue/phplint | ||
* | ||
* (c) overtrue <[email protected]> | ||
* | ||
|