Skip to content

Commit 3301bfb

Browse files
Fix
1 parent cf1df70 commit 3301bfb

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
@@ -6993,6 +6993,15 @@ public function getPhpDocs(Scope $scope, Node\FunctionLike|Node\Stmt\Property $n
69936993
$varTags = $resolvedPhpDoc->getVarTags();
69946994
}
69956995

6996+
if ($isPure === null && $scope->isInClass()) {
6997+
$classResolvedPhpDoc = $scope->getClassReflection()->getResolvedPhpDoc();
6998+
if ($classResolvedPhpDoc !== null && $classResolvedPhpDoc->areAllMethodsPure()) {
6999+
$isPure = true;
7000+
} elseif ($classResolvedPhpDoc !== null && $classResolvedPhpDoc->areAllMethodsImpure()) {
7001+
$isPure = false;
7002+
}
7003+
}
7004+
69967005
return [$templateTypeMap, $phpDocParameterTypes, $phpDocImmediatelyInvokedCallableParameters, $phpDocClosureThisTypeParameters, $phpDocReturnType, $phpDocThrowType, $deprecatedDescription, $isDeprecated, $isInternal, $isFinal, $isPure, $acceptsNamedArguments, $isReadOnly, $docComment, $asserts, $selfOutType, $phpDocParameterOutTypes, $varTags, $isAllowedPrivateMutation];
69977006
}
69987007

0 commit comments

Comments
 (0)