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.2 | Squiz/VariableComment: allow for stand-alone null/true/false types and more #211

Merged

Conversation

jrfnl
Copy link
Member

@jrfnl jrfnl commented Jan 2, 2024

Description

PHP 8.2 | Squiz/VariableComment: allow for stand-alone null/true/false types

Since PHP 8.2, stand-alone use of true, false and null is allowed.

However, if these were used as the type for a property, the docblock would not be found.

Fixed now.

Includes unit tests.

Squiz/VariableComment: allow for various other missing types

There were some more allowed types missing from the list of tokens to skip over to find a docblock.

Fixed now.

Includes unit tests.

Suggested changelog entry

  • Squiz.Commenting.VariableComment : docblocks were incorrectly being flagged as missing when a property declaration used PHP 8.2+ stand-alone true/false/null type declarations
  • Squiz.Commenting.VariableComment : docblocks were incorrectly being flagged as missing when a property declaration used PHP native parent, self or a namespace relative class name type declaration

Related issues/external references

Related to #178 and #209

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
    • This change is only breaking for integrators, not for external standards or end-users.
  • Documentation improvement

jrfnl added 2 commits January 10, 2024 01:45
…e types

Since PHP 8.2, stand-alone use of `true`, `false` and `null` is allowed.

However, if these were used as the type for a property, the docblock would not be found.

Fixed now.

Includes unit tests.
There were some more allowed types missing from the list of tokens to skip over to find a docblock.

Fixed now.

Includes unit tests.
@jrfnl jrfnl force-pushed the feature/squiz-variablecomment-allow-for-more-missing-types branch from 60c95d8 to b04f0a6 Compare January 10, 2024 00:45
@jrfnl jrfnl merged commit cbb5548 into master Jan 10, 2024
44 checks passed
@jrfnl jrfnl deleted the feature/squiz-variablecomment-allow-for-more-missing-types branch January 10, 2024 00:55
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.

1 participant