File tree Expand file tree Collapse file tree 1 file changed +11
-1
lines changed
Expand file tree Collapse file tree 1 file changed +11
-1
lines changed Original file line number Diff line number Diff line change @@ -839,7 +839,17 @@ public function createUserlandMethodReflection(ClassReflection $fileDeclaringCla
839839 }
840840 $ isInternal = $ resolvedPhpDoc ->isInternal ();
841841 $ isFinal = $ resolvedPhpDoc ->isFinal ();
842- $ isPure = $ resolvedPhpDoc ->isPure ();
842+ $ isPure = null ;
843+ foreach ($ actualDeclaringClass ->getAncestors () as $ className => $ _ ) {
844+ if ($ this ->signatureMapProvider ->hasMethodMetadata ($ className , $ methodReflection ->getName ())) {
845+ $ hasSideEffects = $ this ->signatureMapProvider ->getMethodMetadata ($ className , $ methodReflection ->getName ())['hasSideEffects ' ];
846+ $ isPure = !$ hasSideEffects ;
847+
848+ break ;
849+ }
850+ }
851+
852+ $ isPure ??= $ resolvedPhpDoc ->isPure ();
843853 $ asserts = Assertions::createFromResolvedPhpDocBlock ($ resolvedPhpDoc );
844854 $ acceptsNamedArguments = $ resolvedPhpDoc ->acceptsNamedArguments ();
845855 $ selfOutType = $ resolvedPhpDoc ->getSelfOutTag () !== null ? $ resolvedPhpDoc ->getSelfOutTag ()->getType () : null ;
You can’t perform that action at this time.
0 commit comments