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

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

chrisolof created an issue. See original summary.

chrisolof’s picture

Issue summary: View changes
Status: Active » Needs review
StatusFileSize
new1.73 KB

Patch attached.

pcambra’s picture

Version: 8.x-2.x-dev » 3.0.x-dev

idebr made their first commit to this issue’s fork.

idebr’s picture

The patch in #2 is now available as a merge request

  • pcambra committed 08a2c672 on 3.0.x
    Issue #3392015: Add plugin manager interface inheritance
    
pcambra’s picture

Status: Needs review » Fixed

Awesome, thanks both!

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.