diff --git a/src/Util/Annotation/DocBlock.php b/src/Util/Annotation/DocBlock.php index 027737c8d9b..c96971beeab 100644 --- a/src/Util/Annotation/DocBlock.php +++ b/src/Util/Annotation/DocBlock.php @@ -101,7 +101,7 @@ public static function ofClass(\ReflectionClass $class): self ); } - public static function ofMethod(\ReflectionMethod $method): self + public static function ofMethod(\ReflectionMethod $method, string $className = null): self { return new self( (string) $method->getDocComment(), @@ -111,7 +111,7 @@ public static function ofMethod(\ReflectionMethod $method): self $method->getEndLine(), $method->getFileName(), $method->getName(), - $method->getDeclaringClass()->getName() + $className ?? $method->getDeclaringClass()->getName() ); } diff --git a/src/Util/Annotation/Registry.php b/src/Util/Annotation/Registry.php index 795dbf6a93c..fa6cf36414e 100644 --- a/src/Util/Annotation/Registry.php +++ b/src/Util/Annotation/Registry.php @@ -80,6 +80,6 @@ public function forMethod(string $class, string $method): DocBlock ); } - return $this->methodDocBlocks[$class][$method] = DocBlock::ofMethod($reflection); + return $this->methodDocBlocks[$class][$method] = DocBlock::ofMethod($reflection, $class); } }