|
@@ -38,10 +38,10 @@ final class TextReporter implements ReporterInterface
|
|
|
{
|
|
|
$output = '';
|
|
|
|
|
|
- $i = 0;
|
|
|
+ $identifiedFiles = 0;
|
|
|
foreach ($reportSummary->getChanged() as $file => $fixResult) {
|
|
|
- ++$i;
|
|
|
- $output .= sprintf('%4d) %s', $i, $file);
|
|
|
+ ++$identifiedFiles;
|
|
|
+ $output .= sprintf('%4d) %s', $identifiedFiles, $file);
|
|
|
|
|
|
if ($reportSummary->shouldAddAppliedFixers()) {
|
|
|
$output .= $this->getAppliedFixers(
|
|
@@ -54,7 +54,13 @@ final class TextReporter implements ReporterInterface
|
|
|
$output .= PHP_EOL;
|
|
|
}
|
|
|
|
|
|
- return $output.$this->getFooter($reportSummary->getTime(), $reportSummary->getMemory(), $reportSummary->isDryRun());
|
|
|
+ return $output.$this->getFooter(
|
|
|
+ $reportSummary->getTime(),
|
|
|
+ $identifiedFiles,
|
|
|
+ $reportSummary->getFilesCount(),
|
|
|
+ $reportSummary->getMemory(),
|
|
|
+ $reportSummary->isDryRun()
|
|
|
+ );
|
|
|
}
|
|
|
|
|
|
/**
|
|
@@ -83,15 +89,18 @@ final class TextReporter implements ReporterInterface
|
|
|
return PHP_EOL.$diffFormatter->format($diff).PHP_EOL;
|
|
|
}
|
|
|
|
|
|
- private function getFooter(int $time, int $memory, bool $isDryRun): string
|
|
|
+ private function getFooter(int $time, int $identifiedFiles, int $files, int $memory, bool $isDryRun): string
|
|
|
{
|
|
|
if (0 === $time || 0 === $memory) {
|
|
|
return '';
|
|
|
}
|
|
|
|
|
|
return PHP_EOL.sprintf(
|
|
|
- '%s all files in %.3f seconds, %.3f MB memory used'.PHP_EOL,
|
|
|
- $isDryRun ? 'Checked' : 'Fixed',
|
|
|
+ '%s %d of %d %s in %.3f seconds, %.3f MB memory used'.PHP_EOL,
|
|
|
+ $isDryRun ? 'Found' : 'Fixed',
|
|
|
+ $identifiedFiles,
|
|
|
+ $files,
|
|
|
+ $isDryRun ? 'files that can be fixed' : 'files',
|
|
|
$time / 1000,
|
|
|
$memory / 1024 / 1024
|
|
|
);
|