Skip to content

Commit fc3953f

Browse files
committed
Use spaceship operator within usort callback
1 parent 7f3d131 commit fc3953f

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/Doctrine/AbstractElasticaToModelTransformer.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -115,10 +115,10 @@ function ($a, $b) use ($idPos, $identifier, $propertyAccessor) {
115115
return $idPos[(string) $propertyAccessor->getValue(
116116
$a,
117117
$identifier
118-
)] > $idPos[(string) $propertyAccessor->getValue($b, $identifier)];
118+
)] <=> $idPos[(string) $propertyAccessor->getValue($b, $identifier)];
119119
}
120120

121-
return $idPos[$a[$identifier]] > $idPos[$b[$identifier]];
121+
return $idPos[$a[$identifier]] <=> $idPos[$b[$identifier]];
122122
}
123123
);
124124

0 commit comments

Comments
 (0)