Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PHP 8.0 | Squiz/BlockComment: prevent false positives with attributes #3398

Conversation

jrfnl
Copy link
Contributor

@jrfnl jrfnl commented Jul 23, 2021

PHP 8.0+ attributes can be placed between a docblock and the function/class declaration it applies to.

The Squiz.Commenting.BlockComment sniff did not yet take this into account when determining whether a comment was a docblock or an block comment incorrectly using the docblock syntax.

This would result in false positive Block comments must be started with /* errors.

Fixed now.

PHP 8.0+ attributes can be placed between a docblock and the function/class declaration it applies to.

The `Squiz.Commenting.BlockComment` sniff did not yet take this into account when determining whether a comment was a docblock or an block comment incorrectly using the docblock syntax.

This would result in false positive `Block comments must be started with /*` errors.

Fixed now.
@jrfnl jrfnl changed the title Squiz/BlockComment: prevent false positives with attributes PHP 8.0 | Squiz/BlockComment: prevent false positives with attributes Jul 23, 2021
@gsherwood gsherwood added this to the 3.6.1 milestone Jul 28, 2021
@gsherwood gsherwood merged commit 5f6d9ae into squizlabs:master Jul 29, 2021
@gsherwood
Copy link
Member

Thanks for fixing this

@jrfnl jrfnl deleted the php-8.0/squiz-blockcomment-support-attributes branch July 29, 2021 08:56
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.

2 participants