From 59d5d8e6453acaca6fc40877b5f43eb7287a7b3a Mon Sep 17 00:00:00 2001 From: Markus Staab Date: Thu, 6 Oct 2022 18:19:21 +0200 Subject: [PATCH] support out-of-class MethodCalls in PhpDocUtil (#436) --- src/PhpDoc/PhpDocUtil.php | 3 +++ 1 file changed, 3 insertions(+) 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); } }