You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Fixphpstan/phpstan#14001: Type loss in foreach when using StatementResult::getScope()
- Changed StatementResult, StatementExitPoint, and ReturnStatement to store
and return MutatingScope instead of Scope, since mergeWith() is only on
MutatingScope and calling it on Scope produced ErrorType, poisoning the
variable type across foreach loop iterations
- Added toMutatingScope() calls in NodeScopeResolver where ReturnStatement
is constructed from a Scope-typed callback parameter
- Fixed a null check on getClassReflection() in NodeScopeResolver that was
exposed by the more precise type tracking
- Removed now-redundant toMutatingScope() calls on ReturnStatement::getScope()
- New regression test in tests/PHPStan/Analyser/nsrt/bug-14001.php
0 commit comments