mirror of
https://github.com/rectorphp/rector.git
synced 2024-06-07 03:40:50 +00:00
ProcessCommand: move count of items to report responsibliity to reporter, where it should be
This commit is contained in:
parent
951a7d53de
commit
9b313728f8
|
@ -150,14 +150,8 @@ final class ProcessCommand extends Command
|
|||
|
||||
$this->processFiles($files);
|
||||
|
||||
if (count($this->diffFiles) > 0) {
|
||||
$this->processCommandReporter->reportDiffFiles($this->diffFiles);
|
||||
}
|
||||
|
||||
if (count($this->changedFiles) > 0) {
|
||||
$this->processCommandReporter->reportChangedFiles($this->changedFiles);
|
||||
}
|
||||
|
||||
$this->processCommandReporter->reportDiffFiles($this->diffFiles);
|
||||
$this->processCommandReporter->reportChangedFiles($this->changedFiles);
|
||||
$this->consoleStyle->success('Rector is done!');
|
||||
|
||||
return 0;
|
||||
|
|
|
@ -44,6 +44,10 @@ final class ProcessCommandReporter
|
|||
*/
|
||||
public function reportChangedFiles(array $changedFiles): void
|
||||
{
|
||||
if (count($changedFiles) <= 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
$this->consoleStyle->title(sprintf(
|
||||
'%d Changed file%s',
|
||||
count($changedFiles),
|
||||
|
@ -57,6 +61,10 @@ final class ProcessCommandReporter
|
|||
*/
|
||||
public function reportDiffFiles(array $diffFiles): void
|
||||
{
|
||||
if (count($diffFiles) <= 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
$this->consoleStyle->title(sprintf(
|
||||
'%d file%s with changes',
|
||||
count($diffFiles),
|
||||
|
|
Loading…
Reference in New Issue
Block a user