This commit is contained in:
Tomas Votruba 2020-08-30 14:56:39 +02:00 committed by GitHub
parent ff6d6571e6
commit 3226d2d36c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -56,10 +56,10 @@ PHP
*/
public function refactor(Node $node): ?Node
{
$currentPropertiesOrder = $this->stmtOrder->getStmtsOfTypeOrder($node, ClassConst::class);
$propertiesInDesiredOrder = $this->stmtVisibilitySorter->sortConstants($node);
$currentClassConstsOrder = $this->stmtOrder->getStmtsOfTypeOrder($node, ClassConst::class);
$classConstsInDesiredOrder = $this->stmtVisibilitySorter->sortConstants($node);
$oldToNewKeys = $this->stmtOrder->createOldToNewKeys($propertiesInDesiredOrder, $currentPropertiesOrder);
$oldToNewKeys = $this->stmtOrder->createOldToNewKeys($classConstsInDesiredOrder, $currentClassConstsOrder);
if (! $this->hasOrderChanged($oldToNewKeys)) {
return null;