mirror of
https://github.com/rectorphp/rector.git
synced 2025-02-25 20:23:49 +01:00
[ProcessCommand] print limited number of files, not to break apps
This commit is contained in:
parent
6d2665f00d
commit
9ff9d377c6
@ -20,6 +20,11 @@ final class ProcessCommand extends Command
|
||||
*/
|
||||
private const ARGUMENT_SOURCE_NAME = 'source';
|
||||
|
||||
/**
|
||||
* @var int
|
||||
*/
|
||||
private const MAX_FILES_TO_PRINT = 30;
|
||||
|
||||
/**
|
||||
* @var FileProcessor
|
||||
*/
|
||||
@ -76,12 +81,28 @@ final class ProcessCommand extends Command
|
||||
$this->reportLoadedRectors();
|
||||
|
||||
$this->symfonyStyle->title('Processing files');
|
||||
|
||||
$i = 0;
|
||||
foreach ($files as $file) {
|
||||
if ($i < self::MAX_FILES_TO_PRINT) {
|
||||
$this->symfonyStyle->writeln(sprintf(
|
||||
' - %s',
|
||||
$file
|
||||
));
|
||||
}
|
||||
|
||||
if ($i === self::MAX_FILES_TO_PRINT) {
|
||||
$this->symfonyStyle->newLine();
|
||||
$this->symfonyStyle->writeln(sprintf(
|
||||
'...and %d more.',
|
||||
count($files) - self::MAX_FILES_TO_PRINT
|
||||
));
|
||||
$this->symfonyStyle->newLine();
|
||||
}
|
||||
|
||||
$this->fileProcessor->processFile($file);
|
||||
|
||||
$i++;
|
||||
}
|
||||
|
||||
$this->symfonyStyle->success('Rector is done!');
|
||||
|
Loading…
x
Reference in New Issue
Block a user