Loading core/lib/Drupal/Component/Utility/SortArray.php +1 −5 Original line number Diff line number Diff line Loading @@ -122,11 +122,7 @@ public static function sortByKeyInt($a, $b, $key) { $a_weight = (is_array($a) && isset($a[$key])) ? $a[$key] : 0; $b_weight = (is_array($b) && isset($b[$key])) ? $b[$key] : 0; if ($a_weight == $b_weight) { return 0; } return ($a_weight < $b_weight) ? -1 : 1; return $a_weight <=> $b_weight; } } core/lib/Drupal/Core/Config/Entity/ConfigEntityBase.php +1 −1 Original line number Diff line number Diff line Loading @@ -235,7 +235,7 @@ public static function sort(ConfigEntityInterface $a, ConfigEntityInterface $b) $b_label = $b->label() ?? ''; return strnatcasecmp($a_label, $b_label); } return ($a_weight < $b_weight) ? -1 : 1; return $a_weight <=> $b_weight; } /** Loading core/lib/Drupal/Core/Language/Language.php +1 −1 Original line number Diff line number Diff line Loading @@ -160,7 +160,7 @@ public static function sort(&$languages) { } return strnatcasecmp($a_name, $b_name); } return ($a_weight < $b_weight) ? -1 : 1; return $a_weight <=> $b_weight; }); } Loading core/lib/Drupal/Core/Routing/RouteProvider.php +1 −1 Original line number Diff line number Diff line Loading @@ -392,7 +392,7 @@ protected function routeProviderRouteCompare(array $a, array $b) { } // Reverse sort from highest to lowest fit. PHP should cast to int, but // the explicit cast makes this sort more robust against unexpected input. return (int) $a['fit'] < (int) $b['fit'] ? 1 : -1; return (int) $b['fit'] <=> (int) $a['fit']; } /** Loading core/modules/filter/src/FilterPluginCollection.php +1 −1 Original line number Diff line number Diff line Loading @@ -94,7 +94,7 @@ public function sortHelper($aID, $bID) { return !empty($a->status) ? -1 : 1; } if ($a->weight != $b->weight) { return $a->weight < $b->weight ? -1 : 1; return $a->weight <=> $b->weight; } if ($a->provider != $b->provider) { return strnatcasecmp($a->provider, $b->provider); Loading Loading
core/lib/Drupal/Component/Utility/SortArray.php +1 −5 Original line number Diff line number Diff line Loading @@ -122,11 +122,7 @@ public static function sortByKeyInt($a, $b, $key) { $a_weight = (is_array($a) && isset($a[$key])) ? $a[$key] : 0; $b_weight = (is_array($b) && isset($b[$key])) ? $b[$key] : 0; if ($a_weight == $b_weight) { return 0; } return ($a_weight < $b_weight) ? -1 : 1; return $a_weight <=> $b_weight; } }
core/lib/Drupal/Core/Config/Entity/ConfigEntityBase.php +1 −1 Original line number Diff line number Diff line Loading @@ -235,7 +235,7 @@ public static function sort(ConfigEntityInterface $a, ConfigEntityInterface $b) $b_label = $b->label() ?? ''; return strnatcasecmp($a_label, $b_label); } return ($a_weight < $b_weight) ? -1 : 1; return $a_weight <=> $b_weight; } /** Loading
core/lib/Drupal/Core/Language/Language.php +1 −1 Original line number Diff line number Diff line Loading @@ -160,7 +160,7 @@ public static function sort(&$languages) { } return strnatcasecmp($a_name, $b_name); } return ($a_weight < $b_weight) ? -1 : 1; return $a_weight <=> $b_weight; }); } Loading
core/lib/Drupal/Core/Routing/RouteProvider.php +1 −1 Original line number Diff line number Diff line Loading @@ -392,7 +392,7 @@ protected function routeProviderRouteCompare(array $a, array $b) { } // Reverse sort from highest to lowest fit. PHP should cast to int, but // the explicit cast makes this sort more robust against unexpected input. return (int) $a['fit'] < (int) $b['fit'] ? 1 : -1; return (int) $b['fit'] <=> (int) $a['fit']; } /** Loading
core/modules/filter/src/FilterPluginCollection.php +1 −1 Original line number Diff line number Diff line Loading @@ -94,7 +94,7 @@ public function sortHelper($aID, $bID) { return !empty($a->status) ? -1 : 1; } if ($a->weight != $b->weight) { return $a->weight < $b->weight ? -1 : 1; return $a->weight <=> $b->weight; } if ($a->provider != $b->provider) { return strnatcasecmp($a->provider, $b->provider); Loading