Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
isValidKey using toArray() directly
Now it doesn't need to use toArray()->array_keys->in_array, but just toArray() and isset[$key], which should be faster.
  • Loading branch information
KKKas committed Apr 23, 2015
commit a3d1ad9b14b5716fe50f23e68fccb7118b29d220
2 changes: 1 addition & 1 deletion src/Enum.php
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ public static function isValid($value)
*/
public static function isValidKey($key)
{
return in_array($key, self::keys(), true);
return isset(self::toArray()[$key]);
}

/**
Expand Down