class NoSourcePluginDecorator implements DiscoveryInterface (View source)

Remove definitions which refer to a non-existing source plugin.

Traits

Properties

protected DiscoveryInterface $decorated

The Discovery object being decorated.

Methods

array
getDefinitions()

Gets the definition of all plugins for this type.

getDefinition($plugin_id, $exception_on_invalid = TRUE)

{@inheritdoc}

array|null
doGetDefinition(array $definitions, string $plugin_id, bool $exception_on_invalid)

Gets a specific plugin definition.

hasDefinition($plugin_id)

{@inheritdoc}

__construct(DiscoveryInterface $decorated)

Constructs a NoSourcePluginDecorator object.

mixed
__call(string $method, array $args)

Passes through all unknown calls onto the decorated object.

Details

array getDefinitions()

Gets the definition of all plugins for this type.

Return Value

array

An array of plugin definitions (empty array if no definitions were found). Keys are plugin IDs.

getDefinition($plugin_id, $exception_on_invalid = TRUE)

{@inheritdoc}

Parameters

$plugin_id
$exception_on_invalid

protected array|null doGetDefinition(array $definitions, string $plugin_id, bool $exception_on_invalid)

Gets a specific plugin definition.

Parameters

array $definitions

An array of the available plugin definitions.

string $plugin_id

A plugin id.

bool $exception_on_invalid

If TRUE, an invalid plugin ID will cause an exception to be thrown; if FALSE, NULL will be returned.

Return Value

array|null

A plugin definition, or NULL if the plugin ID is invalid and $exception_on_invalid is TRUE.

Exceptions

PluginNotFoundException

hasDefinition($plugin_id)

{@inheritdoc}

Parameters

$plugin_id

__construct(DiscoveryInterface $decorated)

Constructs a NoSourcePluginDecorator object.

Parameters

DiscoveryInterface $decorated

The object implementing DiscoveryInterface that is being decorated.

mixed __call(string $method, array $args)

Passes through all unknown calls onto the decorated object.

Parameters

string $method

The method to call on the decorated object.

array $args

Call arguments.

Return Value

mixed

The return value from the method on the decorated object.