-
Notifications
You must be signed in to change notification settings - Fork 51
[RFC] Add more forbiddenAnnotations #28
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
Conversation
lib/Doctrine/ruleset.xml
Outdated
@package, | ||
@since, | ||
@subpackage, | ||
@uses, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@uses
is complimentary with @covers
in test suites, and affects phpunit at runtime when using strict coverage checks
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, I see it https://phpunit.de/manual/current/en/appendixes.annotations.html, sorry!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
name="forbiddenAnnotations" | ||
type="array" | ||
value=" | ||
@api, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@api
can be useful when dealing with BC promises or the lack thereof, but I don't think we use it for now, so it's probably ok to include it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If it is public
and it is not marked @internal
then it is already API :P
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't make it so simple!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is that simple :P
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agreed, @api
adds maintenance overhead. Any public or non-final protected is typically public API by design. At least it motivates devs to think about API & what should be exposed and what not (looking at you SF). 👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a small detail
lib/Doctrine/ruleset.xml
Outdated
@package, | ||
@since, | ||
@subpackage, | ||
@uses, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This shouldn't be added IMO since PHPUnit uses it for explicit coverage definition (@covers
and @uses
).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, I see it https://phpunit.de/manual/current/en/appendixes.annotations.html, sorry!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 @uses
is already whitelisted btw.
4c9de74
to
7a34ebd
Compare
Ready to Merge? |
🚢 |
There are some annotations in https://github.com/php-fig/fig-standards/blob/master/proposed/phpdoc.md#7-tags that we some a few occurrences in our repos, but as minimal, I want to vote to forbidden them in our CS 😄