Skip to content

Commit

Permalink
Added phpstan 0.12.33+ compatibility (#14)
Browse files Browse the repository at this point in the history
  • Loading branch information
JeroenVanOort authored Aug 11, 2020
1 parent a5eddec commit 6067608
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions src/Reflection/EnumMethodsClassReflectionExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,7 @@ class EnumMethodsClassReflectionExtension implements MethodsClassReflectionExten
public function hasMethod(ClassReflection $classReflection, string $methodName): bool
{
if ($classReflection->isSubclassOf(Enum::class)) {
$array = $classReflection->getNativeReflection()->getMethod('toArray')->invoke(null);

return array_key_exists($methodName, $array);
return $classReflection->getNativeReflection()->hasConstant($methodName);
}

return false;
Expand Down

0 comments on commit 6067608

Please sign in to comment.