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