@@ -100,6 +100,6 @@ |
||
100 | 100 | return self::$filename; |
101 | 101 | } |
102 | 102 | |
103 | - return (getcwd() ?: './') . '/' . self::$filename; |
|
103 | + return (getcwd() ?: './').'/'.self::$filename; |
|
104 | 104 | } |
105 | 105 | } |
@@ -71,9 +71,9 @@ discard block |
||
71 | 71 | */ |
72 | 72 | public function __construct($path, array $excludes = [], array $extensions = ['php'], $warning = false) |
73 | 73 | { |
74 | - $this->path = (array)$path; |
|
74 | + $this->path = (array) $path; |
|
75 | 75 | $this->excludes = $excludes; |
76 | - $this->extensions = \array_map(function ($extension) { |
|
76 | + $this->extensions = \array_map(function($extension) { |
|
77 | 77 | return \sprintf('*.%s', \ltrim($extension, '.')); |
78 | 78 | }, $extensions); |
79 | 79 | $this->warning = $warning; |
@@ -93,7 +93,7 @@ discard block |
||
93 | 93 | $files = $this->getFiles(); |
94 | 94 | } |
95 | 95 | |
96 | - $processCallback = is_callable($this->processCallback) ? $this->processCallback : function () { |
|
96 | + $processCallback = is_callable($this->processCallback) ? $this->processCallback : function() { |
|
97 | 97 | }; |
98 | 98 | |
99 | 99 | $errors = []; |
@@ -193,7 +193,7 @@ discard block |
||
193 | 193 | $finder->files() |
194 | 194 | ->ignoreUnreadableDirs() |
195 | 195 | ->ignoreVCS(true) |
196 | - ->filter(function (SplFileInfo $file) { |
|
196 | + ->filter(function(SplFileInfo $file) { |
|
197 | 197 | return $file->isReadable(); |
198 | 198 | }) |
199 | 199 | ->in(realpath($dir)); |
@@ -264,7 +264,7 @@ discard block |
||
264 | 264 | protected function createLintProcess($filename) |
265 | 265 | { |
266 | 266 | $command = [ |
267 | - PHP_SAPI == 'cli' ? PHP_BINARY : PHP_BINDIR . '/php', |
|
267 | + PHP_SAPI == 'cli' ? PHP_BINARY : PHP_BINDIR.'/php', |
|
268 | 268 | '-d error_reporting=E_ALL', |
269 | 269 | '-d display_errors=On', |
270 | 270 | '-l', $filename, |
@@ -81,7 +81,7 @@ |
||
81 | 81 | } |
82 | 82 | |
83 | 83 | |
84 | - return (bool)preg_match('/(Warning:|Deprecated:|Notice:)/', $output); |
|
84 | + return (bool) preg_match('/(Warning:|Deprecated:|Notice:)/', $output); |
|
85 | 85 | } |
86 | 86 | |
87 | 87 | /** |
@@ -176,13 +176,13 @@ discard block |
||
176 | 176 | $startTime = microtime(true); |
177 | 177 | $startMemUsage = memory_get_usage(true); |
178 | 178 | |
179 | - $output->writeln($this->getApplication()->getLongVersion() . " by overtrue and contributors.\n"); |
|
179 | + $output->writeln($this->getApplication()->getLongVersion()." by overtrue and contributors.\n"); |
|
180 | 180 | |
181 | 181 | $options = $this->mergeOptions(); |
182 | 182 | $verbosity = $output->getVerbosity(); |
183 | 183 | |
184 | 184 | if ($verbosity >= OutputInterface::VERBOSITY_DEBUG) { |
185 | - $output->writeln('Options: ' . json_encode($options) . "\n"); |
|
185 | + $output->writeln('Options: '.json_encode($options)."\n"); |
|
186 | 186 | } |
187 | 187 | |
188 | 188 | $linter = new Linter($options['path'], $options['exclude'], $options['extensions'], $options['warning']); |
@@ -226,7 +226,7 @@ discard block |
||
226 | 226 | $output->writeln("<error>Files: {$fileCount}, Failures: {$errCount}</error>"); |
227 | 227 | $this->showErrors($errors); |
228 | 228 | |
229 | - if (! array_key_exists('quiet', $options)) { |
|
229 | + if (!array_key_exists('quiet', $options)) { |
|
230 | 230 | $code = 1; |
231 | 231 | } |
232 | 232 | } else { |
@@ -307,14 +307,14 @@ discard block |
||
307 | 307 | $verbosity = $output->getVerbosity(); |
308 | 308 | $displayProgress = !$input->getOption('no-progress'); |
309 | 309 | |
310 | - $displayProgress && $linter->setProcessCallback(function ($status, SplFileInfo $file) use ($output, $verbosity, $fileCount, $maxColumns) { |
|
310 | + $displayProgress && $linter->setProcessCallback(function($status, SplFileInfo $file) use ($output, $verbosity, $fileCount, $maxColumns) { |
|
311 | 311 | static $i = 1; |
312 | 312 | |
313 | 313 | $percent = floor(($i / $fileCount) * 100); |
314 | 314 | $process = str_pad(" {$i} / {$fileCount} ({$percent}%)", 18, ' ', STR_PAD_LEFT); |
315 | 315 | |
316 | 316 | if ($verbosity >= OutputInterface::VERBOSITY_VERBOSE) { |
317 | - $filename = str_pad(" {$i}: " . $file->getRelativePathname(), $maxColumns - 10, ' ', \STR_PAD_RIGHT); |
|
317 | + $filename = str_pad(" {$i}: ".$file->getRelativePathname(), $maxColumns - 10, ' ', \STR_PAD_RIGHT); |
|
318 | 318 | if ($status === 'ok') { |
319 | 319 | $status = '<info>OK</info>'; |
320 | 320 | } elseif ($status === 'error') { |
@@ -357,10 +357,10 @@ discard block |
||
357 | 357 | protected function showErrors($errors) |
358 | 358 | { |
359 | 359 | $i = 0; |
360 | - $this->output->writeln("\nThere was " . count($errors) . ' errors:'); |
|
360 | + $this->output->writeln("\nThere was ".count($errors).' errors:'); |
|
361 | 361 | |
362 | 362 | foreach ($errors as $filename => $error) { |
363 | - $this->output->writeln('<comment>' . ++$i . ". {$filename}:{$error['line']}" . '</comment>'); |
|
363 | + $this->output->writeln('<comment>'.++$i.". {$filename}:{$error['line']}".'</comment>'); |
|
364 | 364 | |
365 | 365 | $this->output->write($this->getHighlightedCodeSnippet($filename, $error['line'])); |
366 | 366 | |
@@ -389,7 +389,7 @@ discard block |
||
389 | 389 | |
390 | 390 | foreach ($lines as $i => $line) { |
391 | 391 | $snippet .= (abs($lineNumber) === $i + 1 ? ' > ' : ' '); |
392 | - $snippet .= str_pad($i + 1, $lineStrlen, ' ', STR_PAD_LEFT) . '| ' . rtrim($line) . PHP_EOL; |
|
392 | + $snippet .= str_pad($i + 1, $lineStrlen, ' ', STR_PAD_LEFT).'| '.rtrim($line).PHP_EOL; |
|
393 | 393 | } |
394 | 394 | |
395 | 395 | return $snippet; |
@@ -476,7 +476,7 @@ discard block |
||
476 | 476 | $dir = is_dir($first) ? $first : dirname($first); |
477 | 477 | } |
478 | 478 | |
479 | - $filename = rtrim($dir, DIRECTORY_SEPARATOR) . DIRECTORY_SEPARATOR . '.phplint.yml'; |
|
479 | + $filename = rtrim($dir, DIRECTORY_SEPARATOR).DIRECTORY_SEPARATOR.'.phplint.yml'; |
|
480 | 480 | |
481 | 481 | return realpath($filename); |
482 | 482 | } |