You are here

public function TypedDefinitionEnsuringPluginDiscoveryDecorator::__construct in Plugin 8.2

Constructs a new instance.

Parameters

\Drupal\plugin\PluginType\PluginTypeInterface $plugin_type: The plugin type of which to decorate definitions.

\Drupal\Component\Plugin\Discovery\DiscoveryInterface|NULL $decorated_discovery: The decorated discovery, or NULL to use the plugin type's default discovery.

Overrides PluginDiscoveryDecorator::__construct

File

src/PluginDiscovery/TypedDefinitionEnsuringPluginDiscoveryDecorator.php, line 30

Class

TypedDefinitionEnsuringPluginDiscoveryDecorator
Provides plugin discovery that ensures all definitions implement \Drupal\Component\Plugin\PluginDefinitionInterface.

Namespace

Drupal\plugin\PluginDiscovery

Code

public function __construct(PluginTypeInterface $plugin_type, DiscoveryInterface $decorated_discovery = NULL) {
  parent::__construct($decorated_discovery ?: $plugin_type
    ->getPluginManager());
  $this->pluginType = $plugin_type;
}