function AttributeDiscoveryWithAnnotationsAutomatedProviders::__construct

Constructs an AttributeDiscoveryWithAnnotations object.

Parameters

string $subdir: Either the plugin's subdirectory, for example 'Plugin/views/filter', or empty string if plugins are located at the top level of the namespace.

\Traversable $rootNamespaces: An object that implements \Traversable which contains the root paths keyed by the corresponding namespace to look for plugin implementations. If $subdir is not an empty string, it will be appended to each namespace.

string $pluginDefinitionAttributeName: (optional) The name of the attribute that contains the plugin definition. Defaults to 'Drupal\Component\Plugin\Attribute\Plugin'.

string $pluginDefinitionAnnotationName: (optional) The name of the attribute that contains the plugin definition. Defaults to 'Drupal\Component\Annotation\Plugin'.

string[] $additionalNamespaces: (optional) Additional namespaces to scan for attribute definitions.

Overrides AttributeDiscoveryWithAnnotations::__construct

File

core/modules/migrate/src/Plugin/Discovery/AttributeDiscoveryWithAnnotationsAutomatedProviders.php, line 35

Class

AttributeDiscoveryWithAnnotationsAutomatedProviders
Enables both attribute and annotation discovery for plugin definitions.

Namespace

Drupal\migrate\Plugin\Discovery

Code

public function __construct(string $subdir, \Traversable $rootNamespaces, string $pluginDefinitionAttributeName = 'Drupal\\Component\\Plugin\\Attribute\\Plugin', string $pluginDefinitionAnnotationName = 'Drupal\\Component\\Annotation\\Plugin', array $additionalNamespaces = []) {
  parent::__construct($subdir, $rootNamespaces, $pluginDefinitionAttributeName, $pluginDefinitionAnnotationName, $additionalNamespaces);
  $this->finder = new ClassFinder();
  $this->attributeDiscovery = new AttributeClassDiscoveryAutomatedProviders($subdir, $rootNamespaces, $pluginDefinitionAttributeName);
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.