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:
TomasVotruba 2018-01-06 17:01:53 +01:00
parent 004316767f
commit 71126c7468

View File

@ -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;
}
}