Skip to content

Skip @param comment text mistaken as switched type#35

Merged
TomasVotruba merged 3 commits into
mainfrom
skip-comment-not-type
Jul 2, 2026
Merged

Skip @param comment text mistaken as switched type#35
TomasVotruba merged 3 commits into
mainfrom
skip-comment-not-type

Conversation

@TomasVotruba

Copy link
Copy Markdown
Member

Lines like:

@param        $extra  Can be used by model to determine what to unlock

were wrongly reordered — Can matched the type pattern and got swapped with $extra. The trailing words are a description, not a type.

Fix: anchor the type match to end of line ((?=\s*$)), so only a lone trailing type token is reordered. A type followed by a comment sentence is left untouched.

Added no-change fixture skip_comment.php.inc. phpstan/rector/ecs/phpunit green.

@TomasVotruba TomasVotruba force-pushed the skip-comment-not-type branch from 17dbbda to a717536 Compare July 2, 2026 13:20
@TomasVotruba TomasVotruba merged commit d045326 into main Jul 2, 2026
7 checks passed
@TomasVotruba TomasVotruba deleted the skip-comment-not-type branch July 2, 2026 13:36
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