- Issue created by @chrisolof
- Status changed to Needs review
over 1 year ago 5:15pm 5 October 2023 - last update
over 1 year ago 41 pass
Currently ExtraFieldDisplayManagerInterface and ExtraFieldManagerBaseInterface stand alone. They claim no relationship to eachother nor anything in Drupal core.
But looking at the classes that implement them, ExtraFieldDisplayManager and ExtraFieldManagerBase, it's clear inheritance actually does exist here. ExtraFieldDisplayManager extends ExtraFieldManagerBase, which in turn extends Drupal\Core\Plugin\DefaultPluginManager.
By failing to declare inheritance in the plugin manager interfaces we hide all of the inherited properties and methods actually available in an object of type ExtraFieldDisplayManagerInterface or ExtraFieldManagerBaseInterface.
Declaring inheritance in these interfaces would benefit downstream code by allowing it to confidently use inherited methods and properties, as well as improve the experience for developers utilizing code intelligence tools like PHP Intelephense.
I suspect we have a similar situation with the form-related interfaces.
Declare that ExtraFieldDisplayManagerInterface extends ExtraFieldManagerBaseInterface and declare that ExtraFieldManagerBaseInterface extends Drupal\Component\Plugin\PluginManagerInterface.
Investigate the form-related plugin manager interface(s) and see if they could also declare inheritance.
Review.
None.
All inherited properties and methods on plugin managers will become available / visible / declared.
Needs review
2.0
Code