Skip to content

Add ShellExecHandler and IssetExprHandler - #6156

Merged
ondrejmirtes merged 1 commit into
2.2.xfrom
shellexec-issetexpr-handlers
Jul 30, 2026
Merged

Add ShellExecHandler and IssetExprHandler#6156
ondrejmirtes merged 1 commit into
2.2.xfrom
shellexec-issetexpr-handlers

Conversation

@ondrejmirtes

Copy link
Copy Markdown
Member

Ported from the resolve-type-rewrite-2 branch in the 2.2.x handler shape (resolveType/specifyTypes instead of result callbacks).

ShellExecHandler: the backtick operator had no handler — its interpolated parts were never walked, so rules and collectors never saw the expressions inside backticks, and their throw/impure points were lost. The handler walks the parts, collects implicit __toString throw points, and prices the operator as string|false|null (shell_exec's return type) instead of mixed.

IssetExprHandler: the certainty marker wrapped around isset-tested expressions had no handler and priced as mixed; it now reports its inner expression's type, so it can be priced like any other node instead of being special-cased.

Zero analysis-output churn across the full test suite (the improved pricing has no current consumers asking); make phpstan and make cs clean.

🤖 Generated with Claude Code

https://claude.ai/code/session_01DaBZjgksga4c5s6Q9FniY7

Ported from the resolve-type-rewrite-2 branch in the 2.2.x handler
shape (resolveType/specifyTypes instead of result callbacks).

The backtick operator had no handler: its interpolated parts were never
walked, so node callbacks (rules, collectors) did not see the
expressions inside the backticks and their throw/impure points were
lost. The handler walks the parts like shell_exec() arguments, collects
the implicit __toString throw points, and prices the operator as
string|false|null instead of mixed.

IssetExpr - the certainty marker type specifications wrap around an
isset-tested expression - had no handler either and priced as mixed.
The specifications only ever read its certainty, but anything asking
for its type now gets the inner expression's type, letting the marker
be priced like any other node rather than being special-cased in the
resolution paths.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DaBZjgksga4c5s6Q9FniY7
@ondrejmirtes
ondrejmirtes merged commit f952a9a into 2.2.x Jul 30, 2026
743 of 745 checks passed
@ondrejmirtes
ondrejmirtes deleted the shellexec-issetexpr-handlers branch July 30, 2026 19:12
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