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 ?

Files: 
CommentFileSizeAuthor
#17 PluginInspectionInterface-getPluginDefinition-1986802-17.patch24.34 KByched
PASSED: [[SimpleTest]]: [MySQL] 57,224 pass(es).
[ View ]
#12 PluginInspectionInterface-getPluginDefinition-1986802-12.patch24.28 KByched
FAILED: [[SimpleTest]]: [MySQL] Unable to apply patch PluginInspectionInterface-getPluginDefinition-1986802-12.patch. Unable to apply patch. See the log in the details link for more information.
[ View ]
#12 interdiff.txt577 bytesyched
#11 PluginInspectionInterface-getPluginDefinition-1986802-11.patch23.71 KByched
PASSED: [[SimpleTest]]: [MySQL] 56,489 pass(es).
[ View ]
#6 PluginInspectionInterface-getPluginDefinition-1986802-6bis.patch23.73 KByched
FAILED: [[SimpleTest]]: [MySQL] Unable to apply patch PluginInspectionInterface-getPluginDefinition-1986802-6bis.patch. Unable to apply patch. See the log in the details link for more information.
[ View ]
#5 PluginInspectionInterface-getPluginDefinition-1986802-6.patch25.56 KByched
PASSED: [[SimpleTest]]: [MySQL] 55,923 pass(es).
[ View ]
#2 PluginInspectionInterface-getPluginDefinition-1986802-2.patch25.64 KByched
PASSED: [[SimpleTest]]: [MySQL] 55,723 pass(es).
[ View ]

Comments

tim.plunkett’s picture

+1 from me

yched’s picture

Status:Active» Needs review
StatusFileSize
new25.64 KB
PASSED: [[SimpleTest]]: [MySQL] 55,723 pass(es).
[ View ]

Patch.

Status:Needs review» Needs work

The last submitted patch, PluginInspectionInterface-getPluginDefinition-1986802-2.patch, failed testing.

yched’s picture

Status:Needs work» Needs review

Cannot reproduce the fail locally.

#2: PluginInspectionInterface-getPluginDefinition-1986802-2.patch queued for re-testing.

yched’s picture

StatusFileSize
new25.56 KB
PASSED: [[SimpleTest]]: [MySQL] 55,923 pass(es).
[ View ]

Reroll.

yched’s picture

StatusFileSize
new23.73 KB
FAILED: [[SimpleTest]]: [MySQL] Unable to apply patch PluginInspectionInterface-getPluginDefinition-1986802-6bis.patch. Unable to apply patch. See the log in the details link for more information.
[ View ]

Reroll.

yched’s picture

[edit: removed my last comment, never mind]

yched’s picture

Status:Needs review» Needs work

The last submitted patch, PluginInspectionInterface-getPluginDefinition-1986802-6bis.patch, failed testing.

tim.plunkett’s picture

+1

yched’s picture

Status:Needs work» Needs review
StatusFileSize
new23.71 KB
PASSED: [[SimpleTest]]: [MySQL] 56,489 pass(es).
[ View ]

Reroll, + account for new "image toolkit" plugin type.

FWIW, @EclipseGc verbally +1'ed this in Portland.
RTBC anyone ? :-)

yched’s picture

StatusFileSize
new577 bytes
new24.28 KB
FAILED: [[SimpleTest]]: [MySQL] Unable to apply patch PluginInspectionInterface-getPluginDefinition-1986802-12.patch. Unable to apply patch. See the log in the details link for more information.
[ View ]

Reroll for new "action" plugin type.

tim.plunkett’s picture

Status:Needs review» Reviewed & tested by the community

RTBC if it comes back green. Thanks @yched.

yched’s picture

As 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.

yched’s picture

Status:Reviewed & tested by the community» Needs work
Issue tags:+EntityAPI, +Field API NG blocker

The last submitted patch, PluginInspectionInterface-getPluginDefinition-1986802-12.patch, failed testing.

yched’s picture

Status:Needs work» Reviewed & tested by the community
StatusFileSize
new24.34 KB
PASSED: [[SimpleTest]]: [MySQL] 57,224 pass(es).
[ View ]

Reroll.

alexpott’s picture

Status:Reviewed & tested by the community» Fixed

Committed 202fe60 and pushed to 8.x. Thanks!

yched’s picture

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