Skip to content

Commit 627085e

Browse files
committed
isValidKey() fix for PHP < 5.4
PHP < 5.4: "Fatal error: Can't use function return value in write context in (...)"
1 parent a3d1ad9 commit 627085e

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 isset(self::toArray()[$key]);
122+
$array = self::toArray();
123+
return isset($array[$key]);
123124
}
124125

125126
/**

0 commit comments

Comments
 (0)