diff --git a/src/PhpDoc/PhpDocUtil.php b/src/PhpDoc/PhpDocUtil.php index 91c3f11aa..e11e952d6 100644 --- a/src/PhpDoc/PhpDocUtil.php +++ b/src/PhpDoc/PhpDocUtil.php @@ -69,6 +69,9 @@ private static function getMethodReflection(CallLike $callike, Scope $scope): ?M $classReflection = $scope->getClassReflection(); if (null !== $classReflection && $classReflection->hasMethod($callike->name->name)) { $methodReflection = $classReflection->getMethod($callike->name->name, $scope); + } else { + $callerType = $scope->getType($callike->var); + $methodReflection = $scope->getMethodReflection($callerType, $callike->name->name); } }