discovery) { $discovery = new AnnotatedClassDiscoveryAutomatedProviders($this->subdir, $this->namespaces, $this->pluginDefinitionAnnotationName, $this->additionalAnnotationNamespaces); $this->discovery = new ContainerDerivativeDiscoveryDecorator($discovery); } return $this->discovery; } /** * Finds plugin definitions. * * @return array * List of definitions to store in cache. * * @todo This is a temporary solution to the fact that migration source * plugins have more than one provider. This functionality will be moved to * core in https://www.drupal.org/node/2786355. */ protected function findDefinitions() { $definitions = $this->getDiscovery()->getDefinitions(); foreach ($definitions as $plugin_id => &$definition) { $this->processDefinition($definition, $plugin_id); } $this->alterDefinitions($definitions); return ProviderFilterDecorator::filterDefinitions($definitions, function ($provider) { return $this->providerExists($provider); }); } }