Skip to content

Conversation

BackEndTea
Copy link
Contributor

@BackEndTea BackEndTea commented Feb 27, 2020

I've added this as part of the InvalidPhpDocTagValueRule, which is a level 2 rule.

Arguably this could also be its own rule, which could be implemented on level 0.

Fixes: phpstan/phpstan#3026

@BackEndTea BackEndTea force-pushed the fix/invalid-doc-comment branch from 1a30549 to f4dbac0 Compare February 27, 2020 13:45
@ondrejmirtes
Copy link
Member

Thank you! This should be a separate level 2 rule. I want to adhere to SRP, and checking for unknown tags is a completely separate concern than looking for parse errors in PHPDocs.

@BackEndTea
Copy link
Contributor Author

Sure, i'll rework this into its own rule.

Why a level 2 rule though? I'd think this is like a configuration error, and should be a level 0 check.

@ondrejmirtes
Copy link
Member

Level 0 and 1 do not read or rely on PHPDocs in any way.

@BackEndTea
Copy link
Contributor Author

Ah that makes sense

@BackEndTea BackEndTea force-pushed the fix/invalid-doc-comment branch from c7f70e8 to f786f98 Compare February 27, 2020 18:30
@ondrejmirtes
Copy link
Member

This is perfect, thank you! I'll change the wording of the error on master, but for now, I'm merging this :)

@ondrejmirtes ondrejmirtes merged commit 18d849e into phpstan:master Feb 28, 2020
@BackEndTea
Copy link
Contributor Author

Thanks @ondrejmirtes !

@BackEndTea BackEndTea deleted the fix/invalid-doc-comment branch February 28, 2020 08:12
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.

'Wrong' annotations aren't an issue for phpstan
2 participants