Quantcast
Channel: Issues for Drupal core
Viewing all articles
Browse latest Browse all 292206

Replace @inheritdoc annotations with #[\Override]

$
0
0

Problem/Motivation

PHP 8.3 introduced the Override attribute which, in general, is a signal to the PHP compiler that a method is intended to override a parent method of the same name or implement an interface with the named method. If it does not match either of these conditions, an exception is thrown. The intent is to help catch errors in inheritance and changes in class heirarchy/interface shape and ensure better hygiene.

See the RFC description here.

Also, @inheritdoc annotations are looking pretty old-school these days especially given smarter IDEs, static analysis tools and a more general move to less-verbose code.

Proposed resolution

Replace most/all instances of @inheritdoc with an #[\Override] method annotation.

Remaining tasks

Do the thing.

User interface changes

None.

API changes

None.

Data model changes

None.

Release notes snippet

TBD.


Viewing all articles
Browse latest Browse all 292206

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>