Skip to content

Commit ca15fd7

Browse files
committed
Enum::getByOrdinal: preserve key on array_slide
Because constants can't be numeric there was no issue but it was the wrong argument anyway
1 parent dc85eae commit ca15fd7

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/MabeEnum/Enum.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -219,7 +219,7 @@ final public static function getByOrdinal($ordinal)
219219
$ordinal = (int) $ordinal;
220220
$class = get_called_class();
221221
$constants = self::detectConstants($class);
222-
$item = array_slice($constants, $ordinal, 1, false);
222+
$item = array_slice($constants, $ordinal, 1, true);
223223
if (!$item) {
224224
throw new InvalidArgumentException(sprintf(
225225
'Invalid ordinal number, must between 0 and %s',

0 commit comments

Comments
 (0)