|
@@ -176,13 +176,13 @@ discard block |
|
|
block discarded – undo |
|
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 |
|
|
block discarded – undo |
|
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 |
|
|
block discarded – undo |
|
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 |
|
|
block discarded – undo |
|
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 |
|
|
block discarded – undo |
|
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 |
|
|
block discarded – undo |
|
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
|
} |