Skip to content

Reset expression analysis state in ExpressionResultTest - #6254

Open
simPod wants to merge 1 commit into
phpstan:2.2.xfrom
simPod:test/reset-expression-analysis-state
Open

Reset expression analysis state in ExpressionResultTest#6254
simPod wants to merge 1 commit into
phpstan:2.2.xfrom
simPod:test/reset-expression-analysis-state

Conversation

@simPod

@simPod simPod commented Aug 24, 2026

Copy link
Copy Markdown
Contributor

ExpressionResultTest calls NodeScopeResolver::processExprNode() directly for multiple data-provider cases. Unlike normal file analysis, this path did not reset per-file resolver state first.

Cached closure types can therefore survive between cases and be read again when PHP reuses a spl_object_id(). Reset the resolver before each direct expression analysis so the test follows the normal per-file lifecycle and does not depend on test order.

@simPod
simPod marked this pull request as ready for review August 24, 2026 13:44
@phpstan-bot

Copy link
Copy Markdown
Collaborator

This pull request has been marked as ready for review.

@simPod
simPod force-pushed the test/reset-expression-analysis-state branch from 4868219 to c975247 Compare August 24, 2026 14:19
@simPod
simPod force-pushed the test/reset-expression-analysis-state branch from c975247 to 617d53d Compare August 24, 2026 14:34
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.

2 participants