Skip to content

Commit 07402bb

Browse files
committed
Replace sort callbacks to spaceship operator
1 parent 0e2bca6 commit 07402bb

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)