Skip to content

Commit 3dd5184

Browse files
authored
Merge pull request #11 from burakcakirel/patch-1
Cast to integer `order` attribute
2 parents 3d7681f + d46acaa commit 3dd5184

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/FileRepository.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -294,15 +294,15 @@ public function getOrdered($direction = 'asc') : array
294294
$modules = $this->allEnabled();
295295

296296
uasort($modules, function (Module $a, Module $b) use ($direction) {
297-
if ($a->order == $b->order) {
297+
if ((int) $a->order == (int) $b->order) {
298298
return 0;
299299
}
300300

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

305-
return $a->order > $b->order ? 1 : -1;
305+
return (int) $a->order > (int) $b->order ? 1 : -1;
306306
});
307307

308308
return $modules;

0 commit comments

Comments
 (0)