Add ShellExecHandler and IssetExprHandler - #6156
Merged
Merged
Conversation
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Ported from the resolve-type-rewrite-2 branch in the 2.2.x handler shape (
resolveType/specifyTypesinstead 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
__toStringthrow points, and prices the operator asstring|false|null(shell_exec's return type) instead ofmixed.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 phpstanandmake csclean.🤖 Generated with Claude Code
https://claude.ai/code/session_01DaBZjgksga4c5s6Q9FniY7