You are here

public function AnnotatedClassDiscoveryAutomatedProviders::__construct in Drupal 9

Same name and namespace in other branches
  1. 8 core/modules/migrate/src/Plugin/Discovery/AnnotatedClassDiscoveryAutomatedProviders.php \Drupal\migrate\Plugin\Discovery\AnnotatedClassDiscoveryAutomatedProviders::__construct()

Constructs an AnnotatedClassDiscoveryAutomatedProviders 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 $root_namespaces: 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 $plugin_definition_annotation_name: The name of the annotation that contains the plugin definition. Defaults to 'Drupal\Component\Annotation\Plugin'.

string[] $annotation_namespaces: Additional namespaces to scan for annotation definitions.

Overrides AnnotatedClassDiscovery::__construct

File

core/modules/migrate/src/Plugin/Discovery/AnnotatedClassDiscoveryAutomatedProviders.php, line 46

Class

AnnotatedClassDiscoveryAutomatedProviders
Determines providers based on a class's and its parent's namespaces.

Namespace

Drupal\migrate\Plugin\Discovery

Code

public function __construct($subdir, \Traversable $root_namespaces, $plugin_definition_annotation_name = 'Drupal\\Component\\Annotation\\Plugin', array $annotation_namespaces = []) {
  parent::__construct($subdir, $root_namespaces, $plugin_definition_annotation_name, $annotation_namespaces);
  $this->finder = new ClassFinder();
}