tools: fix PHPStan 2.0 issues

This commit is contained in:
Dylan K. Taylor
2025-01-07 22:15:50 +00:00
parent b1c7fc017a
commit 47cb04f6a6
5 changed files with 44 additions and 12 deletions

View File

@ -523,10 +523,12 @@ function processRemappedStates(array $upgradeTable) : array{
}
}
}
$orderedUnchanged = [];
foreach(Utils::stringifyKeys($unchangedStatesByNewName) as $newName => $unchangedStates){
ksort($unchangedStates);
$unchangedStatesByNewName[$newName] = $unchangedStates;
sort($unchangedStates);
$orderedUnchanged[$newName] = $unchangedStates;
}
$unchangedStatesByNewName = $orderedUnchanged;
$notFlattenedProperties = [];
@ -656,7 +658,8 @@ function processRemappedStates(array $upgradeTable) : array{
usort($list, function(BlockStateUpgradeSchemaBlockRemap $a, BlockStateUpgradeSchemaBlockRemap $b) : int{
return count($b->oldState) <=> count($a->oldState);
});
return array_values($list);
//usort discards keys, so this is already a list<BlockStateUpgradeSchemaBlockRemap>
return $list;
}
/**