Skip to content

Conversation

jrfnl
Copy link
Member

@jrfnl jrfnl commented Aug 21, 2025

Description

If a return type included a class name containing an underscore, the type would be truncated at the underscore and would not take anything after it into account.

Bug introduced in PHPCS 2.8.1 via PR squizlabs/PHP_CodeSniffer#1310 and for some reason never reported... 😳

Fixed now.

Includes tests.

Fixes #1197

Suggested changelog entry

Fixed: Squiz.Commenting.FunctionComment: if the return type contained a class name with underscores, the return type would be truncated leading to incorrect results.

… the return type

If a return type included a class name containing an underscore, the type would be truncated at the underscore and would not take anything after it into account.

Bug introduced in PHPCS 2.8.1 via PR squizlabs/PHP_CodeSniffer 1310 and for some reason never reported... 😳

Fixed now.

Includes tests.

Fixes 1197
@jrfnl jrfnl added this to the 3.13.3 milestone Aug 21, 2025
@jrfnl jrfnl merged commit 566f699 into master Aug 21, 2025
80 checks passed
@jrfnl jrfnl deleted the feature/1197-squiz-functioncomment-bug-classname-truncated branch August 21, 2025 23:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Squiz.Commenting.FunctionComment truncates class name if it contains underscores

1 participant