Skip to content

Commit b5ca36f

Browse files
committed
Merge pull request #16 from KKKas/patch-1
isValidKey using toArray() directly
2 parents e5976f1 + 627085e commit b5ca36f

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/Enum.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,8 @@ public static function isValid($value)
119119
*/
120120
public static function isValidKey($key)
121121
{
122-
return in_array($key, self::keys(), true);
122+
$array = self::toArray();
123+
return isset($array[$key]);
123124
}
124125

125126
/**

0 commit comments

Comments
 (0)