Skip to content

Call the TypeTraverser callback with one argument - #8564

Merged
TomasVotruba merged 1 commit into
rectorphp:mainfrom
SanderMuller:traverse-callback-extra-argument
Oct 9, 2026
Merged

TomasVotruba merged 1 commit into
rectorphp:mainfrom
SanderMuller:traverse-callback-extra-argument

Conversation

@SanderMuller

@SanderMuller SanderMuller commented Oct 9, 2026 •

Copy link
Copy Markdown
Contributor

Five calls passed the $traverse callback of TypeTraverser::map() to itself as an extra argument: two in ObjectTypeMapper and three in TypeNormalizer. PHP ignores the extra argument, so nothing changes today.

With PHPStan Turbo loaded, TypeTraverser runs natively, and its callback rejects the extra argument with traverseInternal() expects exactly 1 argument, 2 given. I hit this while running Rector with Turbo: 4 files of rector-src failed that way, and pass with this change.

@TomasVotruba

Copy link
Copy Markdown
Member

LGTM, thanks 👍

@TomasVotruba
TomasVotruba merged commit e0dc680 into rectorphp:main Oct 9, 2026
50 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants