Extract function-call scope effects into FuncCallScopeEffectsHelper - #6279
Merged
Merged
Conversation
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.
Extracted from
resolve-type-rewrite-2(extraction series, follows #6274/#6275/#6278). A 1:1 manual move in the #6247 style: every moved line comes from mainline'sFuncCallHandler; the branch's helper (b1c4b9e830) served as the structural template (class name, method decomposition, placement).The scope-only side effects of a function call move out of
FuncCallHandler::processExpr()into a newFuncCallScopeEffectsHelper:applyArrayWalkResult()— the array_walk by-ref value writeback,applyCallScopeEffects()— the contiguous post-throw-point region: closure-impure$thisinvalidation, possibly-impure value remembering,json_last_error/file_get_contentspaired-read invalidation, the by-ref array functions (array_pop/array_shift/array_push/array_unshift/shuffle/array_splice/sorts),extract(),http_response_header,clearstatcache/openssl effects, output-buffer level tracking, and volatile-expression invalidation,getArrayFunctionAppendingType(), whose only callers moved with it.FuncCallHandlershrinks by ~440 lines; therememberPossiblyImpureFunctionValuesparameter moves to the helper with its only use. Two mainline-flow adaptations: the helper's remember block gains an explicit$parametersAcceptor !== nullguard (the handler's flow correlation with$functionReflectiondoesn't carry into the extracted method — the branch's helper has the identical guard), and nothing else changes semantically.Convergence: a whitespace-normalized diff against the branch's helper leaves 82 lines, all of one kind — the branch reads argument types from stored
ArgsResultresults while mainline prices via$scope->getType(). At the branch's next rebase its extraction commit reduces to exactly those read-style deltas.Gates: full suite 21155 tests / 96002 assertions green,
make phpstanclean (cold cache),make csclean.🤖 Generated with Claude Code
https://claude.ai/code/session_01R7pqAkCx4xP6WYxBo2nMJE