Skip to content

Run the impossible-check and nullsafe rules on post-processing virtual nodes - #6157

Merged
ondrejmirtes merged 1 commit into
2.2.xfrom
call-expression-nodes
Jul 30, 2026
Merged

Run the impossible-check and nullsafe rules on post-processing virtual nodes#6157
ondrejmirtes merged 1 commit into
2.2.xfrom
call-expression-nodes

Conversation

@ondrejmirtes

Copy link
Copy Markdown
Member

Ported from the resolve-type-rewrite-2 branch. The impossible-check rules listened on the raw FuncCall/MethodCall/StaticCall and the nullsafe rules on the raw nullsafe nodes — both firing while the expression was still being processed, asking the scope to specify types (or read receiver types) before the node itself was done. NodeScopeResolver now emits FunctionCallExpressionNode/MethodCallExpressionNode/StaticMethodCallExpressionNode right after the call is processed and stored, and the nullsafe handlers emit NullsafeMethodCallExpressionNode/NullsafePropertyFetchExpressionNode carrying the receiver's entry-scope type — the rules run on the fully processed expression and stop re-asking the scope.

The five nodes extend NodeAbstract per f935366 (rule-facing virtual nodes must not reach getType()). On this branch they carry only what the 2.2.x rules read; the rewrite branch's versions additionally carry the call's ExpressionResult — that stays branch-side until the sweep.

Zero analysis-output churn: full test suite (twice — before and after slimming the nodes), all five rules' test suites, make phpstan and make cs green.

🤖 Generated with Claude Code

https://claude.ai/code/session_01DaBZjgksga4c5s6Q9FniY7

…l nodes

Ported from the resolve-type-rewrite-2 branch. The impossible-check
rules listened on the raw call nodes and the nullsafe rules on the raw
nullsafe nodes - both firing while the expression was still being
processed, asking the scope to specify types or read receiver types
before the node itself was done. NodeScopeResolver now emits
FunctionCallExpressionNode / MethodCallExpressionNode /
StaticMethodCallExpressionNode after the call is processed and stored,
and the nullsafe handlers emit NullsafeMethodCallExpressionNode /
NullsafePropertyFetchExpressionNode carrying the receiver's entry-scope
type, so the rules run on the fully processed expression.

The rule-facing nodes extend NodeAbstract, following f935366.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DaBZjgksga4c5s6Q9FniY7
@ondrejmirtes
ondrejmirtes merged commit b9d4cb6 into 2.2.x Jul 30, 2026
453 of 454 checks passed
@ondrejmirtes
ondrejmirtes deleted the call-expression-nodes branch July 30, 2026 19:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant