Quantcast
Viewing all articles
Browse latest Browse all 294883

rename PluginInspectionInterface::getDefinition() to getPluginDefinition()

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 ?


Viewing all articles
Browse latest Browse all 294883

Trending Articles