-
Notifications
You must be signed in to change notification settings - Fork 1.5k
PHPORM-146: Add override attribute everywhere #3412
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
base: 5.x
Are you sure you want to change the base?
Conversation
Apparently |
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 is huge, and will be very helpful to detect when a parent method is removed.
I spotted some tiny changes.
We squash-merge. So you can refine the commit message in the merge box in GitHub. |
d5e0610
to
99ea95c
Compare
da2f424
to
5c296f9
Compare
* | ||
* @return Collection | ||
*/ | ||
/** Shorthand to get the results of the relationship. */ |
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.
Without @inheritdoc
you lose the phpdoc for the parameter and the return type that are described in the parent method; isn't 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.
Hm maybe I misunderstood your previous comment, but didn't you say there's no point in just having inheritdoc
when we already have #[Override]
?
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.
Ah wait, you said "when a method is not documented". So you're saying it won't parse the parent's phpdoc in this case because there is a comment.
I think the comment is identical to the parent's, so I should probably just remove it then
to keep track of the methods we're overriding on the base builder
5c296f9
to
51526a5
Compare
Closes PHPORM-146
Adds the override attribute in every class that extends a Laravel base class, so that PHP will show errors if ever the base methods are renamed or removed.
Also adds in a few corrections to phpdoc declarations where necessary.
Checklist
Add tests and ensure they pass(not applicable)