-
Notifications
You must be signed in to change notification settings - Fork 265
PHPLIB-1117: Remove @api annotation #1087
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
* @see \MongoDB\Collection::watch() | ||
* @see https://mongodb.com/docs/manual/reference/method/db.watch/#mongodb-method-db.watch | ||
* | ||
* @psalm-type ResumeCallable = callable(array|object|null, bool): ChangeStreamIterator |
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.
CS fix: Incorrect order of annotations groups.
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.
One question about whether we should target function doc blocks as well but overall changes LGTM.
/** | ||
* All classes are public API by default, unless marked with @internal. | ||
*/ | ||
$rectorConfig->ruleWithConfiguration(RemoveAnnotationRector::class, ['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.
I don't think PHPLIB does this, but is there any harm of removing @api
from method annotations as well?
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.
There are no @api
left.
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.
I'm aware this removed everything that was in PHPLIB. I was just asking if it made sense to add a rule to remove method block annotations as well. I assume not, but was asking more to get a better understanding of how these rules are used.
Presumably, there's no need for even this rule to exist going forward (running at again would be a NOP) -- so I might be misunderstanding the purpose of collecting these rules in the rector configuration.
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.
The purpose of leaving these rules in place in the configuration file is to impose them on new developments or pending branches. If, for example, a developer forgets or ignores that @api
annotations are no longer used, this will be corrected automatically before the code review.
Fix PHPLIB-1117
All classes are public API by default, unless marked with
@internal
.These classes had none of these 2 annotations
@api
or@internal
and are part of the public api to be consistent with other*Result
classes.BulkWriteResult
Client
Collection
Database
DeleteResult
InsertManyResult
InsertOneResult
UpdateResult