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

Squiz/VariableComment: allow union and intersection types to be detected #209

Merged

Conversation

fcool
Copy link
Contributor

@fcool fcool commented Jan 2, 2024

If one uses a union type for an object property, the doc-type-hint could not be related to the variable type.

Fixed now.

Includes unit test.

This is a continuation of #3757

Closes #178
Closes squizlabs/PHP_CodeSniffer#3757

@fcool
Copy link
Contributor Author

fcool commented Jan 2, 2024

I do not understand why the tests are failing - they are not locally - and I did not change anything regarding to alignment... so I would not expect any changes there...

@fcool fcool force-pushed the bugfix/union-types-variable-comment branch from 6b48b12 to 369ec5b Compare January 2, 2024 10:43
If one uses a union type for an object property, the doc-type-hint could not be related to the variable type.

Fixed now.

Includes unit test.
@fcool fcool force-pushed the bugfix/union-types-variable-comment branch from 369ec5b to ebb6b37 Compare January 2, 2024 10:50
@jrfnl jrfnl added this to the 3.x Next milestone Jan 2, 2024
Copy link
Member

@jrfnl jrfnl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@fcool Thank you for porting this PR over! All looks good to me. This fix will be included in the next release.

@jrfnl jrfnl merged commit eb88812 into PHPCSStandards:master Jan 2, 2024
38 checks passed
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/VariableComment: incorrectly flags missing docblock for properties with union/intersection type
3 participants