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 9951a06 commit d99b9ffCopy full SHA for d99b9ff
src/Enum.php
@@ -108,7 +108,7 @@ public static function toArray()
108
{
109
$class = get_called_class();
110
if (!array_key_exists($class, static::$cache)) {
111
- $reflection = new \ReflectionClass($class);
+ $reflection = new \ReflectionClass($class);
112
static::$cache[$class] = $reflection->getConstants();
113
}
114
@@ -164,9 +164,8 @@ public static function search($value)
164
*/
165
public static function __callStatic($name, $arguments)
166
167
- if (static::isValidKey($name)) {
168
- $array = static::toArray();
169
-
+ $array = static::toArray();
+ if (isset($array[$name])) {
170
return new static($array[$name]);
171
172
0 commit comments