We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent d59928d commit fc93d58Copy full SHA for fc93d58
src/Enum.php
@@ -117,10 +117,8 @@ final public function getValue()
117
*/
118
final public function getName()
119
{
120
- if ($this->ordinal !== null) {
121
- return self::$names[static::class][$this->ordinal];
122
- }
123
- return \array_search($this->value, self::detectConstants(static::class), true);
+ $ordinal = $this->ordinal !== null ? $this->ordinal : $this->getOrdinal();
+ return self::$names[static::class][$ordinal];
124
}
125
126
/**
0 commit comments