@@ -100,7 +100,7 @@ public static function getMethodDeclaringMethod(\ReflectionMethod $method): \Ref
100100
101101 $ hash = [$ method ->getFileName (), $ method ->getStartLine (), $ method ->getEndLine ()];
102102 if (($ alias = $ decl ->getTraitAliases ()[$ method ->name ] ?? null )
103- && ($ m = new \ReflectionMethod ($ alias ))
103+ && ($ m = new \ReflectionMethod (... explode ( ' :: ' , $ alias, 2 ) ))
104104 && $ hash === [$ m ->getFileName (), $ m ->getStartLine (), $ m ->getEndLine ()]
105105 ) {
106106 return self ::getMethodDeclaringMethod ($ m );
@@ -125,7 +125,7 @@ public static function getMethodDeclaringMethod(\ReflectionMethod $method): \Ref
125125 public static function areCommentsAvailable (): bool
126126 {
127127 static $ res ;
128- return $ res ?? $ res = (bool ) (new \ReflectionMethod (__METHOD__ ))->getDocComment ();
128+ return $ res ?? $ res = (bool ) (new \ReflectionMethod (self ::class, __FUNCTION__ ))->getDocComment ();
129129 }
130130
131131
@@ -136,7 +136,9 @@ public static function toString(\Reflector $ref): string
136136 } elseif ($ ref instanceof \ReflectionMethod) {
137137 return $ ref ->getDeclaringClass ()->name . ':: ' . $ ref ->name . '() ' ;
138138 } elseif ($ ref instanceof \ReflectionFunction) {
139- return $ ref ->name . '() ' ;
139+ return PHP_VERSION_ID >= 80200 && $ ref ->isAnonymous ()
140+ ? '{closure}() '
141+ : $ ref ->name . '() ' ;
140142 } elseif ($ ref instanceof \ReflectionProperty) {
141143 return self ::getPropertyDeclaringClass ($ ref )->name . '::$ ' . $ ref ->name ;
142144 } elseif ($ ref instanceof \ReflectionParameter) {
0 commit comments