From d8071d0904e4b06a814a0b8b8d7f343d72db0633 Mon Sep 17 00:00:00 2001 From: Ondrej Mirtes Date: Thu, 13 Jul 2023 09:34:41 +0200 Subject: [PATCH] Fi result cache bug with imported type aliases in a trait --- src/Dependency/DependencyResolver.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Dependency/DependencyResolver.php b/src/Dependency/DependencyResolver.php index deba626f86..e7a07dc1f1 100644 --- a/src/Dependency/DependencyResolver.php +++ b/src/Dependency/DependencyResolver.php @@ -16,6 +16,7 @@ use PHPStan\Node\InClassMethodNode; use PHPStan\Node\InClassNode; use PHPStan\Node\InFunctionNode; +use PHPStan\Node\InTraitNode; use PHPStan\Reflection\ClassReflection; use PHPStan\Reflection\FunctionReflection; use PHPStan\Reflection\ParameterReflectionWithPhpDocs; @@ -45,7 +46,7 @@ public function resolveDependencies(Node $node, Scope $scope): NodeDependencies { $dependenciesReflections = []; - if ($node instanceof InClassNode) { + if ($node instanceof InClassNode || $node instanceof InTraitNode) { $docComment = $node->getDocComment(); if ($docComment !== null) { $phpDoc = $this->fileTypeMapper->getResolvedPhpDoc(