PluginInspectionInterface is the way instanciated plugin objects (or code manipulating them) can access their own plugin_id and plugin_definition.
Method names are getPluginId() and getDefinition().
Underlying properties, defined by PluginBase, are $pluginId and $pluginDefinition.
Thus, getDefinition() method is inconsistent in that it lacks a "Plugin" prefix for context.
That's an actual issue with TypedData objects, which are plugins, and have an (unrelated) getDefinition() method of their own in TypedDatainterface. Thus, they currently don't extend PluginBase or implement PluginInspectionInterface - but #1969728: Implement Field API "field types" as TypedData Plugins needs it.
More generally, I think the term "definition" is of too common use to be "stolen" by Plugin API, which , when looking a the API of given plugin-based system, is merely an implementation detail. That's the very reason why getPluginId() was not named getId(), it would not be reasonable to steal the notion of "id".
Opinions, before I try to roll a patch ?
Comments
Comment #1
tim.plunkett+1 from me
Comment #2
yched CreditAttribution: yched commentedPatch.
Comment #4
yched CreditAttribution: yched commentedCannot reproduce the fail locally.
#2: PluginInspectionInterface-getPluginDefinition-1986802-2.patch queued for re-testing.
Comment #5
yched CreditAttribution: yched commentedReroll.
Comment #6
yched CreditAttribution: yched commentedReroll.
Comment #7
yched CreditAttribution: yched commented[edit: removed my last comment, never mind]
Comment #8
yched CreditAttribution: yched commented#6: PluginInspectionInterface-getPluginDefinition-1986802-6bis.patch queued for re-testing.
Comment #10
tim.plunkett+1
Comment #11
yched CreditAttribution: yched commentedReroll, + account for new "image toolkit" plugin type.
FWIW, @EclipseGc verbally +1'ed this in Portland.
RTBC anyone ? :-)
Comment #12
yched CreditAttribution: yched commentedReroll for new "action" plugin type.
Comment #13
tim.plunkettRTBC if it comes back green. Thanks @yched.
Comment #14
yched CreditAttribution: yched commentedAs explained in the OP, #1969728: Implement Field API "field types" as TypedData Plugins goes forward and adds a getPluginDefinition() method on TypedData classes.
I.e those get inspectability, without being able officially to implement PluginInspectionInterface, since the method in the interface is getDefinition(), and that method name is already taken in TypedDataInterface.
Works, but would be good to get cleaned up.
Thus, adding the relevant tags.
Comment #15
yched CreditAttribution: yched commented#12: PluginInspectionInterface-getPluginDefinition-1986802-12.patch queued for re-testing.
Comment #17
yched CreditAttribution: yched commentedReroll.
Comment #18
alexpottCommitted 202fe60 and pushed to 8.x. Thanks!
Comment #19
yched CreditAttribution: yched commentedOk, opened #2018323: Make TypedData implement PluginInspectionInterface then.