Add plugin manager interface inheritance

Created on 5 October 2023, 9 months ago

Problem/Motivation

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.

Steps to reproduce

Proposed resolution

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.

Remaining tasks

Review.

User interface changes

None.

API changes

All inherited properties and methods on plugin managers will become available / visible / declared.

Data model changes

✨ Feature request
Status

Needs review

Version

2.0

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States chrisolof

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.69.0 2024