Skip to content

Commit 777a804

Browse files
authored
Merge pull request #131 from marc-mabe/fix-Enum-getName-cache-ordinal
fixed ordinal cache usage of Enum::getName() if ordinal=0
2 parents 45fc4f9 + bc7c7b3 commit 777a804

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/Enum.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ final public function getValue()
119119
*/
120120
final public function getName()
121121
{
122-
return self::$names[static::class][$this->ordinal ?: $this->getOrdinal()];
122+
return self::$names[static::class][$this->ordinal ?? $this->getOrdinal()];
123123
}
124124

125125
/**

0 commit comments

Comments
 (0)