Skip to content

Commit fc28d07

Browse files
Fix
1 parent 3ff88ba commit fc28d07

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

7207+
if ($isPure === null && $scope->isInClass()) {
7208+
$classResolvedPhpDoc = $scope->getClassReflection()->getResolvedPhpDoc();
7209+
if ($classResolvedPhpDoc !== null && $classResolvedPhpDoc->areAllMethodsPure()) {
7210+
$isPure = true;
7211+
} elseif ($classResolvedPhpDoc !== null && $classResolvedPhpDoc->areAllMethodsImpure()) {
7212+
$isPure = false;
7213+
}
7214+
}
7215+
72077216
return [$templateTypeMap, $phpDocParameterTypes, $phpDocImmediatelyInvokedCallableParameters, $phpDocClosureThisTypeParameters, $phpDocReturnType, $phpDocThrowType, $deprecatedDescription, $isDeprecated, $isInternal, $isFinal, $isPure, $acceptsNamedArguments, $isReadOnly, $docComment, $asserts, $selfOutType, $phpDocParameterOutTypes, $varTags, $isAllowedPrivateMutation];
72087217
}
72097218

0 commit comments

Comments
 (0)