mirror of
https://github.com/rectorphp/rector.git
synced 2025-03-14 12:29:43 +01:00
make RectorsFinder return consistent order by shorter names
This commit is contained in:
parent
4e6d1610ca
commit
4049b579c4
File diff suppressed because it is too large
Load Diff
@ -3,6 +3,7 @@
|
||||
namespace Rector\ContributorTools\Finder;
|
||||
|
||||
use Nette\Loaders\RobotLoader;
|
||||
use Nette\Utils\Strings;
|
||||
use Rector\Contract\Rector\RectorInterface;
|
||||
use Rector\Error\ExceptionCorrector;
|
||||
use Rector\Exception\ShouldNotHappenException;
|
||||
@ -69,6 +70,13 @@ final class RectorsFinder
|
||||
$rectors[] = $rector;
|
||||
}
|
||||
|
||||
usort($rectors, function (RectorInterface $firstRector, RectorInterface $secondRector): int {
|
||||
$firstRectorShortClass = Strings::after(get_class($firstRector), '\\', -1);
|
||||
$secondRectorShortClass = Strings::after(get_class($secondRector), '\\', -1);
|
||||
|
||||
return $firstRectorShortClass <=> $secondRectorShortClass;
|
||||
});
|
||||
|
||||
return $rectors;
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user