Skip to content

Commit

Permalink
Sorting: Usort boolean is deprecated. (#4)
Browse files Browse the repository at this point in the history
* fix: usort boolean is deprecated.

* fix: add spaceship operator
  • Loading branch information
MantasPetrauskas93 authored Feb 8, 2022
1 parent 31f1be3 commit 700612a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
}
],
"require": {
"php": ">=5.6",
"php": ">=7.0",
"laurynasgadl/travers": "^1.1"
},
"require-dev": {
Expand Down
4 changes: 2 additions & 2 deletions src/Validator.php
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,7 @@ protected function sortRules($rules)
$aCount = $parser($a);
$bCount = $parser($b);

return $aCount > $bCount;
return $aCount <=> $bCount;
});

return $rules;
Expand All @@ -288,7 +288,7 @@ protected function sortRuleSet($rulesSet)
* @var AbstractRule $a
* @var AbstractRule $b
*/
return $a->getPrecedence() < $b->getPrecedence();
return $b->getPrecedence() <=> $a->getPrecedence();
});

return $rulesSet;
Expand Down

0 comments on commit 700612a

Please sign in to comment.