Skip to content

Commit 82a943a

Browse files
Fix
1 parent 1a2ab0d commit 82a943a

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

src/Analyser/NodeScopeResolver.php

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7093,6 +7093,15 @@ public function getPhpDocs(Scope $scope, Node\FunctionLike|Node\Stmt\Property $n
70937093
$varTags = $resolvedPhpDoc->getVarTags();
70947094
}
70957095

7096+
if ($isPure === null && $scope->isInClass()) {
7097+
$classResolvedPhpDoc = $scope->getClassReflection()->getResolvedPhpDoc();
7098+
if ($classResolvedPhpDoc !== null && $classResolvedPhpDoc->areAllMethodsPure()) {
7099+
$isPure = true;
7100+
} elseif ($classResolvedPhpDoc !== null && $classResolvedPhpDoc->areAllMethodsImpure()) {
7101+
$isPure = false;
7102+
}
7103+
}
7104+
70967105
return [$templateTypeMap, $phpDocParameterTypes, $phpDocImmediatelyInvokedCallableParameters, $phpDocClosureThisTypeParameters, $phpDocReturnType, $phpDocThrowType, $deprecatedDescription, $isDeprecated, $isInternal, $isFinal, $isPure, $acceptsNamedArguments, $isReadOnly, $docComment, $asserts, $selfOutType, $phpDocParameterOutTypes, $varTags, $isAllowedPrivateMutation];
70977106
}
70987107

0 commit comments

Comments
 (0)