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 4c40ab2 commit 796775bCopy full SHA for 796775b
src/EnumMethodsClassReflectionExtension.php
@@ -12,12 +12,12 @@ class EnumMethodsClassReflectionExtension implements MethodsClassReflectionExten
12
public function hasMethod(ClassReflection $classReflection, string $methodName): bool
13
{
14
if ($classReflection->isSubclassOf(Enum::class)) {
15
- $array = $classReflection->getNativeReflection()->getMethod('getConstants')->invoke(null);
16
-
17
- return array_key_exists($methodName, $array);
+ return false;
18
}
19
20
- return false;
+ /** @var string|Enum $class */
+ $class = $classReflection->getName();
+ return array_key_exists($methodName, $class::getConstants());
21
22
23
public function getMethod(ClassReflection $classReflection, string $methodName): MethodReflection
0 commit comments