Skip to content

Small extractions: isGenerator node memo, keep-void yield checks - #6161

Merged
ondrejmirtes merged 3 commits into
2.2.xfrom
extract-small-chunk-a
Jul 31, 2026
Merged

Small extractions: isGenerator node memo, keep-void yield checks#6161
ondrejmirtes merged 3 commits into
2.2.xfrom
extract-small-chunk-a

Conversation

@ondrejmirtes

Copy link
Copy Markdown
Member

Three small branch-agnostic pieces extracted from the resolve-type-rewrite branch:

  • PhpFunctionFromParserNodeReflection::isGenerator() memoizes the whole-body yield scan on the AST node (reflections for the same node are recreated per ask, so an instance property would not stick; the memo lives and dies with the parser-cached AST).
  • YieldFromTypeRule/YieldTypeRule read the operand through getKeepVoidType() — behavior-neutral today (suite unchanged), keeps the void check honest independent of the void-to-null projection at value reads.
  • Doc rider: drop the duplicated @internal docblock on hasAcceptorTemplateOrLateResolvableParameterType().

All suites pass unchanged: NodeScopeResolverTest 1694, full suite 17811, make phpstan, make cs.

🤖 Generated with Claude Code

https://claude.ai/code/session_01DaBZjgksga4c5s6Q9FniY7

ondrejmirtes and others added 3 commits July 31, 2026 14:00
The scan walks the whole function body and reflections for the same node
are recreated per ask, so the answer is memoized on the node itself and
lives and dies with the parser-cached AST.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DaBZjgksga4c5s6Q9FniY7
…terType

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DaBZjgksga4c5s6Q9FniY7
@ondrejmirtes
ondrejmirtes merged commit 1ee9b9b into 2.2.x Jul 31, 2026
741 of 744 checks passed
@ondrejmirtes
ondrejmirtes deleted the extract-small-chunk-a branch July 31, 2026 12:06
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