- Issue created by @bradjones1
- π¦πΊAustralia mstrelan
FWIW there is a rector rule AddOverrideAttributeToOverriddenMethodsRector for adding the attribute. It won't remove the @inheritdoc annotation though.
- π¬π§United Kingdom longwave UK
I am not sure we could do this until Drupal 10 EOL because it feels like it would make cherry-picking backports from 11 to 10 much more difficult.
- π¬π§United Kingdom joachim
It's worth mentioning the opinion here: https://stitcher.io/blog/override-in-php-83
> we're adding runtime checks for something that could be determined by static analysers.
- πΊπΈUnited States bradjones1 Digital Nomad Life
I don't feel particularly strongly about this, mostly created the issue from a thread in Slack proposing this change.
From Brandt's blog, as pointed out in #5 -
Once again we're adding runtime checks for something that could be determined by static analysers.
I'm not sure I actually follow this. One of the main reasons for using the annotation is to identify where you _think_ you are overriding a method on a parent class or implementing an interface. If the parent class(es) or interface change, then you will get an error (and static analysis failure and/or notification in your IDE.) I think you would have to implement specific static analysis rules to do the same, and that seems a bit more complex than replacing a rather useless/outdated @inheritdoc with something that is more meaningful in modern PHP with Override.