Skip to content

Conversation

carusogabriel
Copy link
Contributor

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 😄

@package,
@since,
@subpackage,
@uses,
Copy link
Member

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

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Copy link
Member

@alcaeus alcaeus left a 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,
Copy link
Member

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.

Copy link
Member

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

Copy link
Member

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!

Copy link
Member

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

Copy link
Contributor

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). 👍

Copy link
Member

@lcobucci lcobucci left a 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

@package,
@since,
@subpackage,
@uses,
Copy link
Member

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).

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Copy link
Contributor

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.

@carusogabriel
Copy link
Contributor Author

Ready to Merge?

@Ocramius Ocramius added this to the 4.0.0 milestone Feb 11, 2018
@Ocramius Ocramius self-assigned this Feb 11, 2018
@Ocramius
Copy link
Member

🚢

@Ocramius Ocramius merged commit 5a96a58 into master Feb 11, 2018
@Ocramius Ocramius deleted the forbidden-annotations branch February 11, 2018 13:18
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.

5 participants