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
{{ message }}
Repository navigation
Commit bc36ada
Browse filesBrowse the repository at this point in the historyBrowse files
Apply the impure-call purity gate to a call's own key when it also carries asserts, and to nullsafe chain keys
- MethodCallHandler::specifyTypes(): the assert branch unioned the asserts with
an ungated specifyDefaultTypes(), so an @phpstan-impure method carrying
@phpstan-assert-if-true keyed its own truthiness. It now unions with
defaultMethodCallNarrowing(), which applies the same purity gate (and nullsafe
receiver fan) as the assert-less path.
- StaticCallHandler::specifyTypes(): same fix through defaultStaticCallNarrowing().
- DefaultNarrowingHelper::specifyDefaultTypesWithPlainTwin(): the `?->` node's own
key and the deeper chain's fully plain form are rebuilt nodes, so the identity-
based impure-point gate in createSubjectTypesFromResultState() never matched
them and an impure `$a?->b()` was remembered as true. The gate is now read once
off the walked twin node and applied to the whole key family.
- Extracted the impure-point gate into DefaultNarrowingHelper::isSubjectValueRemembered()
and reused it from createSubjectTypesFromResultState().
- Probed and found already correct: FuncCallHandler (fixed by 3b57b6b),
NewHandler and the callable-call assert path (neither unions a default key,
matching 2.2.x), conditional return types, type-specifying extensions,
@phpstan-assert / @phpstan-assert-if-false, static::/parent::/self:: calls,
interface methods, loops, match, empty(), ternary, ?:, first-class callables
and closures - with rememberPossiblyImpureFunctionValues both true and false.
0 commit comments