Skip to content

Commit 7808535

Browse files
Fix
1 parent ed27e7b commit 7808535

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

7415+
if ($isPure === null && $scope->isInClass()) {
7416+
$classResolvedPhpDoc = $scope->getClassReflection()->getResolvedPhpDoc();
7417+
if ($classResolvedPhpDoc !== null && $classResolvedPhpDoc->areAllMethodsPure()) {
7418+
$isPure = true;
7419+
} elseif ($classResolvedPhpDoc !== null && $classResolvedPhpDoc->areAllMethodsImpure()) {
7420+
$isPure = false;
7421+
}
7422+
}
7423+
74157424
return [$templateTypeMap, $phpDocParameterTypes, $phpDocImmediatelyInvokedCallableParameters, $phpDocClosureThisTypeParameters, $phpDocReturnType, $phpDocThrowType, $deprecatedDescription, $isDeprecated, $isInternal, $isFinal, $isPure, $acceptsNamedArguments, $isReadOnly, $docComment, $asserts, $selfOutType, $phpDocParameterOutTypes, $varTags, $isAllowedPrivateMutation];
74167425
}
74177426

0 commit comments

Comments
 (0)