mirror of
https://github.com/rectorphp/rector.git
synced 2025-02-25 20:23:49 +01:00
ProcessCommand: do not sort Rectors, because order matters and is easier to debug if the same as the application has
This commit is contained in:
parent
004316767f
commit
71126c7468
@ -32,11 +32,11 @@ final class ProcessCommandReporter
|
||||
$this->rectorCollector->getRectorCount() === 1 ? '' : 's'
|
||||
));
|
||||
|
||||
$rectorList = $this->sortByClassName($this->rectorCollector->getRectors());
|
||||
|
||||
$this->consoleStyle->listing(array_map(function (RectorInterface $rector): string {
|
||||
$rectorClasses = array_map(function (RectorInterface $rector): string {
|
||||
return get_class($rector);
|
||||
}, $rectorList));
|
||||
}, $this->rectorCollector->getRectors());
|
||||
|
||||
$this->consoleStyle->listing($rectorClasses);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -68,17 +68,4 @@ final class ProcessCommandReporter
|
||||
$this->consoleStyle->writeln($diffFile['diff']);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @param object[] $objects
|
||||
* @return object[]
|
||||
*/
|
||||
private function sortByClassName(array $objects): array
|
||||
{
|
||||
usort($objects, function ($first, $second): int {
|
||||
return get_class($first) <=> get_class($second);
|
||||
});
|
||||
|
||||
return $objects;
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user