Skip to content

Commit a6ffdc1

Browse files
authored
Merge pull request #1783 from Lustmored/master
Use spaceship operator within usort callback
2 parents 83dd761 + fc3953f commit a6ffdc1

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)