@@ -100,7 +100,7 @@ public static function getMethodDeclaringMethod(\ReflectionMethod $method): \Ref
100
100
101
101
$ hash = [$ method ->getFileName (), $ method ->getStartLine (), $ method ->getEndLine ()];
102
102
if (($ alias = $ decl ->getTraitAliases ()[$ method ->name ] ?? null )
103
- && ($ m = new \ReflectionMethod ($ alias ))
103
+ && ($ m = new \ReflectionMethod (... explode ( ' :: ' , $ alias, 2 ) ))
104
104
&& $ hash === [$ m ->getFileName (), $ m ->getStartLine (), $ m ->getEndLine ()]
105
105
) {
106
106
return self ::getMethodDeclaringMethod ($ m );
@@ -125,7 +125,7 @@ public static function getMethodDeclaringMethod(\ReflectionMethod $method): \Ref
125
125
public static function areCommentsAvailable (): bool
126
126
{
127
127
static $ res ;
128
- return $ res ?? $ res = (bool ) (new \ReflectionMethod (__METHOD__ ))->getDocComment ();
128
+ return $ res ?? $ res = (bool ) (new \ReflectionMethod (self ::class, __FUNCTION__ ))->getDocComment ();
129
129
}
130
130
131
131
@@ -136,7 +136,9 @@ public static function toString(\Reflector $ref): string
136
136
} elseif ($ ref instanceof \ReflectionMethod) {
137
137
return $ ref ->getDeclaringClass ()->name . ':: ' . $ ref ->name . '() ' ;
138
138
} elseif ($ ref instanceof \ReflectionFunction) {
139
- return $ ref ->name . '() ' ;
139
+ return PHP_VERSION_ID >= 80200 && $ ref ->isAnonymous ()
140
+ ? '{closure}() '
141
+ : $ ref ->name . '() ' ;
140
142
} elseif ($ ref instanceof \ReflectionProperty) {
141
143
return self ::getPropertyDeclaringClass ($ ref )->name . '::$ ' . $ ref ->name ;
142
144
} elseif ($ ref instanceof \ReflectionParameter) {
0 commit comments