Skip to content

Commit 4a3dc89

Browse files
committed
v0.2: Remove deprecation usage in usort
1 parent 8785b50 commit 4a3dc89

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

src/Container.php

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -110,8 +110,14 @@ protected function initializeService(string $serviceId): void
110110

111111
$decorators = $this->decorators[$serviceId];
112112

113-
usort($decorators, function(array $left, array $right): bool {
114-
return $left[1] > $right[1];
113+
usort($decorators, function(array $left, array $right): int {
114+
$l = $left[1];
115+
$r = $right[1];
116+
if($l === $r) {
117+
return 0;
118+
}
119+
120+
return $left[1] > $right[1] ? 1 : -1;
115121
});
116122

117123
/** @var array<Closure, int> $decorator */

0 commit comments

Comments
 (0)