Skip to content

Fix SwitchedTypeAndNameFixer to handle generic types with commas in @param#34

Merged
TomasVotruba merged 1 commit into
mainfrom
fix-switched-type-name-generics
Jul 2, 2026
Merged

Fix SwitchedTypeAndNameFixer to handle generic types with commas in @param#34
TomasVotruba merged 1 commit into
mainfrom
fix-switched-type-name-generics

Conversation

@TomasVotruba

Copy link
Copy Markdown
Member

Type regex stopped at the comma inside generics like array<int, string>, so @param $submittedArray array<int, string> was mangled instead of reordered.

Extended the type pattern to allow a <...> generic block (with commas and spaces) as part of the type.

Before:

@param $submittedArray array<int, string>

After:

@param array<int, string> $submittedArray

Added fixture wrong4.php.inc. phpstan/rector/ecs/phpunit green.

@TomasVotruba TomasVotruba enabled auto-merge (squash) July 2, 2026 13:15
@TomasVotruba TomasVotruba merged commit 9575ed4 into main Jul 2, 2026
7 checks passed
@TomasVotruba TomasVotruba deleted the fix-switched-type-name-generics branch July 2, 2026 13:15
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