Skip to content

Commit fbb5072

Browse files
ENGCOM-2697: Replace sort callbacks to spaceship operator #17423
- Merge Pull Request #17423 from mage2pratik/magento2:forwardport-patch-16788 - Merged commits: 1. 07402bb
2 parents 0e2bca6 + 07402bb commit fbb5072

File tree

1 file changed

+1
-9
lines changed

1 file changed

+1
-9
lines changed

app/code/Magento/Payment/Helper/Data.php

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -151,15 +151,7 @@ public function getStoreMethods($store = null, $quote = null)
151151
@uasort(
152152
$res,
153153
function (MethodInterface $a, MethodInterface $b) {
154-
if ((int)$a->getConfigData('sort_order') < (int)$b->getConfigData('sort_order')) {
155-
return -1;
156-
}
157-
158-
if ((int)$a->getConfigData('sort_order') > (int)$b->getConfigData('sort_order')) {
159-
return 1;
160-
}
161-
162-
return 0;
154+
return (int)$a->getConfigData('sort_order') <=> (int)$b->getConfigData('sort_order');
163155
}
164156
);
165157

0 commit comments

Comments
 (0)