mirror of
https://github.com/rectorphp/rector.git
synced 2025-02-24 11:44:14 +01:00
ProcessCommand: show only changed files
This commit is contained in:
parent
35edf6e521
commit
d40065cefb
@ -141,18 +141,17 @@ final class ProcessCommand extends Command
|
||||
$i = 1;
|
||||
foreach ($fileInfos as $fileInfo) {
|
||||
if ($this->parameterProvider->provideParameter(self::OPTION_DRY_RUN)) {
|
||||
$this->symfonyStyle->writeln(sprintf('<options=bold>%d) %s</>', $i, $fileInfo->getPathname()));
|
||||
$oldContent = $fileInfo->getContents();
|
||||
$newContent = $this->fileProcessor->processFileToString($fileInfo);
|
||||
|
||||
if ($newContent !== $oldContent) {
|
||||
$this->symfonyStyle->writeln(sprintf('<options=bold>%d) %s</>', $i, $fileInfo->getPathname()));
|
||||
$this->symfonyStyle->writeln($this->differAndFormatter->diffAndFormat($oldContent, $newContent));
|
||||
++$i;
|
||||
}
|
||||
} else {
|
||||
$this->fileProcessor->processFile($fileInfo);
|
||||
}
|
||||
|
||||
++$i;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user