Skip to content

Conversation

anomiex
Copy link
Contributor

@anomiex anomiex commented Apr 3, 2024

Per request at phpstan/phpdoc-parser#235 (comment)

Hopefully I added the right tests in the right places, mostly I grepped for "psalm" then tried to add similar tests. Feel free to update the PR if necessary.

@ondrejmirtes
Copy link
Member

The implementation is wrong. You should test what happens which prefix has priority if more of them are present. @phpstan- should always win.

@anomiex
Copy link
Contributor Author

anomiex commented Apr 3, 2024

I just copied what seemed to be being done for @psalm-, for which the only place I saw priority logic is in PhpDocNodeResolver::resolveTemplateTags(), for which I put @phan- at a lower priority than both @psalm- and @phpstan-. The test case here seems to confirm that.

As I mentioned, feel free to update the PR. Or, if you want to point out specific test cases where @phan- is overriding @phpstan- (and where existing @psalm- doesn't have the same problem), I'll try to take a look when I have time.

Copy link
Member

@ondrejmirtes ondrejmirtes left a comment

Choose a reason for hiding this comment

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

InvalidPhpDocTagValueRule needs to ignore @phan- tags, same as it ignores @psalm-.

@ondrejmirtes ondrejmirtes merged commit dda4675 into phpstan:1.11.x Apr 5, 2024
@ondrejmirtes
Copy link
Member

Thanks a lot!

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