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 types to be detected #3757

Closed

Conversation

fcool
Copy link

@fcool fcool commented Feb 10, 2023

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.

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
Copy link
Author

fcool commented Feb 10, 2023

The unit test will fail, without the adjustment made in this PR, because it detects a missing @var annotation - which is incorrect ;)

@jrfnl
Copy link
Contributor

jrfnl commented Dec 30, 2023

@fcool In light of #3932, I'd like to invite you to recreate this PR in the https://github.com/PHPCSStandards/PHP_CodeSniffer repository.

There's a related issue open in that repo (PHPCSStandards/PHP_CodeSniffer#178) and it may be a good idea to add the T_TYPE_INTERSECTION token (+ test) to the PR as well.

If you don't have time to do so, I can cherrypick this commit if need be. Just let me know.

@fcool
Copy link
Author

fcool commented Jan 2, 2024

So if I understood everything correct, I need just to take over this PR to the new repository? And of course, adding T_TYPE_INTERSECTION?

Glad you stepped up, by the way.

@jrfnl
Copy link
Contributor

jrfnl commented Jan 2, 2024

So if I understood everything correct, I need just to take over this PR to the new repository? And of course, adding T_TYPE_INTERSECTION?

That would be great, yes!

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.

2 participants