File tree Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -11,13 +11,13 @@ class EnumMethodsClassReflectionExtension implements MethodsClassReflectionExten
11
11
{
12
12
public function hasMethod (ClassReflection $ classReflection , string $ methodName ): bool
13
13
{
14
- if ($ classReflection ->isSubclassOf (Enum::class)) {
15
- $ array = $ classReflection ->getNativeReflection ()->getMethod ('getConstants ' )->invoke (null );
16
-
17
- return array_key_exists ($ methodName , $ array );
14
+ if (!$ classReflection ->isSubclassOf (Enum::class)) {
15
+ return false ;
18
16
}
19
17
20
- return false ;
18
+ /** @var string|Enum $class */
19
+ $ class = $ classReflection ->getName ();
20
+ return array_key_exists ($ methodName , $ class ::getConstants ());
21
21
}
22
22
23
23
public function getMethod (ClassReflection $ classReflection , string $ methodName ): MethodReflection
You can’t perform that action at this time.
0 commit comments