Skip to content

Commit

Permalink
Merge pull request #11 from burakcakirel/patch-1
Browse files Browse the repository at this point in the history
Cast to integer `order` attribute
  • Loading branch information
denisdulici authored Sep 30, 2021
2 parents 3d7681f + d46acaa commit 3dd5184
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/FileRepository.php
Original file line number Diff line number Diff line change
Expand Up @@ -294,15 +294,15 @@ public function getOrdered($direction = 'asc') : array
$modules = $this->allEnabled();

uasort($modules, function (Module $a, Module $b) use ($direction) {
if ($a->order == $b->order) {
if ((int) $a->order == (int) $b->order) {
return 0;
}

if ($direction == 'desc') {
return $a->order < $b->order ? 1 : -1;
return (int) $a->order < (int) $b->order ? 1 : -1;
}

return $a->order > $b->order ? 1 : -1;
return (int) $a->order > (int) $b->order ? 1 : -1;
});

return $modules;
Expand Down

0 comments on commit 3dd5184

Please sign in to comment.