diff --git a/core/lib/Drupal/Component/Plugin/Discovery/AnnotatedClassDiscovery.php b/core/lib/Drupal/Component/Plugin/Discovery/AnnotatedClassDiscovery.php index 13f853d..6110bd1 100644 --- a/core/lib/Drupal/Component/Plugin/Discovery/AnnotatedClassDiscovery.php +++ b/core/lib/Drupal/Component/Plugin/Discovery/AnnotatedClassDiscovery.php @@ -27,13 +27,6 @@ class AnnotatedClassDiscovery implements DiscoveryInterface { protected $pluginNamespaces; /** - * The namespaces of classes that can be used as annotations. - * - * @var array - */ - protected $annotationNamespaces; - - /** * The name of the annotation that contains the plugin definition. * * The class corresponding to this name must implement @@ -49,16 +42,12 @@ class AnnotatedClassDiscovery implements DiscoveryInterface { * @param array $plugin_namespaces * (optional) An array of namespace that may contain plugin implementations. * Defaults to an empty array. - * @param array $annotation_namespaces - * (optional) The namespaces of classes that can be used as annotations. - * Defaults to an empty array. * @param string $plugin_definition_annotation_name * (optional) The name of the annotation that contains the plugin definition. * Defaults to 'Drupal\Component\Annotation\Plugin'. */ - function __construct($plugin_namespaces = array(), $annotation_namespaces = array(), $plugin_definition_annotation_name = 'Drupal\Component\Annotation\Plugin') { + function __construct($plugin_namespaces = array(), $plugin_definition_annotation_name = 'Drupal\Component\Annotation\Plugin') { $this->pluginNamespaces = $plugin_namespaces; - $this->annotationNamespaces = $annotation_namespaces; $this->pluginDefinitionAnnotationName = $plugin_definition_annotation_name; } @@ -80,8 +69,10 @@ public function getDefinitions() { $reader->addGlobalIgnoredName('endlink'); $reader->addGlobalIgnoredName('file'); + // Clear the annotation loaders of any previous annotation classes. + AnnotationRegistry::reset(); // Register the namespaces of classes that can be used for annotations. - AnnotationRegistry::registerAutoloadNamespaces($this->getAnnotationNamespaces()); + AnnotationRegistry::registerLoader('class_exists'); // Search for classes within all PSR-0 namespace locations. foreach ($this->getPluginNamespaces() as $namespace => $dirs) { @@ -111,6 +102,10 @@ public function getDefinitions() { } } } + + // Don't let annotation loaders pile up. + AnnotationRegistry::reset(); + return $definitions; } @@ -121,11 +116,4 @@ protected function getPluginNamespaces() { return $this->pluginNamespaces; } - /** - * Returns an array of PSR-0 namespaces to search for annotation classes. - */ - protected function getAnnotationNamespaces() { - return $this->annotationNamespaces; - } - } diff --git a/core/lib/Drupal/Core/Action/ActionManager.php b/core/lib/Drupal/Core/Action/ActionManager.php index a3bfeda..4d9b232 100644 --- a/core/lib/Drupal/Core/Action/ActionManager.php +++ b/core/lib/Drupal/Core/Action/ActionManager.php @@ -28,7 +28,7 @@ class ActionManager extends PluginManagerBase { * keyed by the corresponding namespace to look for plugin implementations. */ public function __construct(\Traversable $namespaces) { - $this->discovery = new AnnotatedClassDiscovery('Plugin/Action', $namespaces, array(), 'Drupal\Core\Annotation\Action'); + $this->discovery = new AnnotatedClassDiscovery('Plugin/Action', $namespaces, 'Drupal\Core\Annotation\Action'); $this->discovery = new AlterDecorator($this->discovery, 'action_info'); $this->factory = new ContainerFactory($this); diff --git a/core/lib/Drupal/Core/Condition/ConditionManager.php b/core/lib/Drupal/Core/Condition/ConditionManager.php index 7f5d630..aa15d56 100644 --- a/core/lib/Drupal/Core/Condition/ConditionManager.php +++ b/core/lib/Drupal/Core/Condition/ConditionManager.php @@ -36,10 +36,7 @@ public function __construct(\Traversable $namespaces, CacheBackendInterface $cac $this->alterInfo($module_handler, 'condition_info'); $this->setCacheBackend($cache_backend, $language_manager, 'condition'); - $annotation_namespaces = array( - 'Drupal\Core\Condition\Annotation' => DRUPAL_ROOT . '/core/lib', - ); - parent::__construct('Plugin/Condition', $namespaces, $annotation_namespaces, 'Drupal\Core\Condition\Annotation\Condition'); + parent::__construct('Plugin/Condition', $namespaces, 'Drupal\Core\Condition\Annotation\Condition'); } /** diff --git a/core/lib/Drupal/Core/Entity/EntityManager.php b/core/lib/Drupal/Core/Entity/EntityManager.php index b8ff7bc..367ac7f 100644 --- a/core/lib/Drupal/Core/Entity/EntityManager.php +++ b/core/lib/Drupal/Core/Entity/EntityManager.php @@ -143,10 +143,7 @@ public function __construct(\Traversable $namespaces, ContainerInterface $contai } protected function doDiscovery($namespaces) { - $annotation_namespaces = array( - 'Drupal\Core\Entity\Annotation' => DRUPAL_ROOT . '/core/lib', - ); - $this->discovery = new AnnotatedClassDiscovery('Entity', $namespaces, $annotation_namespaces, 'Drupal\Core\Entity\Annotation\EntityType'); + $this->discovery = new AnnotatedClassDiscovery('Entity', $namespaces, 'Drupal\Core\Entity\Annotation\EntityType'); $this->discovery = new InfoHookDecorator($this->discovery, 'entity_info'); $this->discovery = new AlterDecorator($this->discovery, 'entity_info'); $this->discovery = new CacheDecorator($this->discovery, 'entity_info:' . $this->languageManager->getLanguage(Language::TYPE_INTERFACE)->id, 'cache', CacheBackendInterface::CACHE_PERMANENT, array('entity_info' => TRUE)); diff --git a/core/lib/Drupal/Core/Entity/Field/FieldTypePluginManager.php b/core/lib/Drupal/Core/Entity/Field/FieldTypePluginManager.php index 0be215e..5269769 100644 --- a/core/lib/Drupal/Core/Entity/Field/FieldTypePluginManager.php +++ b/core/lib/Drupal/Core/Entity/Field/FieldTypePluginManager.php @@ -42,10 +42,7 @@ class FieldTypePluginManager extends DefaultPluginManager { * The module handler. */ public function __construct(\Traversable $namespaces, CacheBackendInterface $cache_backend, LanguageManager $language_manager, ModuleHandlerInterface $module_handler) { - $annotation_namespaces = array( - 'Drupal\Core\Entity\Annotation' => DRUPAL_ROOT . '/core/lib', - ); - parent::__construct('Plugin/field/field_type', $namespaces, $annotation_namespaces, 'Drupal\Core\Entity\Annotation\FieldType'); + parent::__construct('Plugin/field/field_type', $namespaces, 'Drupal\Core\Entity\Annotation\FieldType'); $this->alterInfo($module_handler, 'field_info'); $this->setCacheBackend($cache_backend, $language_manager, 'field_types'); diff --git a/core/lib/Drupal/Core/Menu/LocalActionManager.php b/core/lib/Drupal/Core/Menu/LocalActionManager.php index c99dd83..39ea454 100644 --- a/core/lib/Drupal/Core/Menu/LocalActionManager.php +++ b/core/lib/Drupal/Core/Menu/LocalActionManager.php @@ -65,7 +65,7 @@ class LocalActionManager extends DefaultPluginManager { * The language manager. */ public function __construct(\Traversable $namespaces, ControllerResolverInterface $controller_resolver, Request $request, ModuleHandlerInterface $module_handler, CacheBackendInterface $cache_backend, LanguageManager $language_manager) { - parent::__construct('Plugin/Menu/LocalAction', $namespaces, array(), 'Drupal\Core\Annotation\Menu\LocalAction'); + parent::__construct('Plugin/Menu/LocalAction', $namespaces, 'Drupal\Core\Annotation\Menu\LocalAction'); $this->controllerResolver = $controller_resolver; $this->request = $request; diff --git a/core/lib/Drupal/Core/Plugin/DefaultPluginManager.php b/core/lib/Drupal/Core/Plugin/DefaultPluginManager.php index f802b0c..d6b0609 100644 --- a/core/lib/Drupal/Core/Plugin/DefaultPluginManager.php +++ b/core/lib/Drupal/Core/Plugin/DefaultPluginManager.php @@ -96,16 +96,13 @@ class DefaultPluginManager extends PluginManagerBase implements PluginManagerInt * @param \Traversable $namespaces * An object that implements \Traversable which contains the root paths * keyed by the corresponding namespace to look for plugin implementations. - * @param array $annotation_namespaces - * (optional) The namespaces of classes that can be used as annotations. - * Defaults to an empty array. * @param string $plugin_definition_annotation_name * (optional) The name of the annotation that contains the plugin definition. * Defaults to 'Drupal\Component\Annotation\Plugin'. */ - public function __construct($subdir, \Traversable $namespaces, $annotation_namespaces = array(), $plugin_definition_annotation_name = 'Drupal\Component\Annotation\Plugin') { + public function __construct($subdir, \Traversable $namespaces, $plugin_definition_annotation_name = 'Drupal\Component\Annotation\Plugin') { $this->subdir = $subdir; - $this->discovery = new AnnotatedClassDiscovery($subdir, $namespaces, $annotation_namespaces, $plugin_definition_annotation_name); + $this->discovery = new AnnotatedClassDiscovery($subdir, $namespaces, $plugin_definition_annotation_name); $this->discovery = new ContainerDerivativeDiscoveryDecorator($this->discovery); $this->factory = new ContainerFactory($this); } diff --git a/core/lib/Drupal/Core/Plugin/Discovery/AnnotatedClassDiscovery.php b/core/lib/Drupal/Core/Plugin/Discovery/AnnotatedClassDiscovery.php index 63c87ab..e033caf 100644 --- a/core/lib/Drupal/Core/Plugin/Discovery/AnnotatedClassDiscovery.php +++ b/core/lib/Drupal/Core/Plugin/Discovery/AnnotatedClassDiscovery.php @@ -2,7 +2,7 @@ /** * @file - * Definition of Drupal\Core\Plugin\Discovery\AnnotatedClassDiscovery. + * Contains \Drupal\Core\Plugin\Discovery\AnnotatedClassDiscovery. */ namespace Drupal\Core\Plugin\Discovery; @@ -41,24 +41,17 @@ class AnnotatedClassDiscovery extends ComponentAnnotatedClassDiscovery { * 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. - * @param array $annotation_namespaces - * (optional) The namespaces of classes that can be used as annotations. - * Defaults to an empty array. * @param string $plugin_definition_annotation_name * (optional) The name of the annotation that contains the plugin definition. * Defaults to 'Drupal\Component\Annotation\Plugin'. */ - function __construct($subdir, \Traversable $root_namespaces, $annotation_namespaces = array(), $plugin_definition_annotation_name = 'Drupal\Component\Annotation\Plugin') { + function __construct($subdir, \Traversable $root_namespaces, $plugin_definition_annotation_name = 'Drupal\Component\Annotation\Plugin') { if ($subdir) { $this->subdir = str_replace('/', '\\', $subdir); } $this->rootNamespacesIterator = $root_namespaces; - $annotation_namespaces += array( - 'Drupal\Component\Annotation' => DRUPAL_ROOT . '/core/lib', - 'Drupal\Core\Annotation' => DRUPAL_ROOT . '/core/lib', - ); $plugin_namespaces = array(); - parent::__construct($plugin_namespaces, $annotation_namespaces, $plugin_definition_annotation_name); + parent::__construct($plugin_namespaces, $plugin_definition_annotation_name); } /** diff --git a/core/lib/Drupal/Core/TypedData/TypedDataManager.php b/core/lib/Drupal/Core/TypedData/TypedDataManager.php index 6f85867..0e786bd 100644 --- a/core/lib/Drupal/Core/TypedData/TypedDataManager.php +++ b/core/lib/Drupal/Core/TypedData/TypedDataManager.php @@ -49,10 +49,7 @@ public function __construct(\Traversable $namespaces, CacheBackendInterface $cac $this->alterInfo($module_handler, 'data_type_info'); $this->setCacheBackend($cache_backend, $language_manager, 'typed_data:types'); - $annotation_namespaces = array( - 'Drupal\Core\TypedData\Annotation' => DRUPAL_ROOT . '/core/lib', - ); - parent::__construct('Plugin/DataType', $namespaces, $annotation_namespaces, 'Drupal\Core\TypedData\Annotation\DataType'); + parent::__construct('Plugin/DataType', $namespaces, 'Drupal\Core\TypedData\Annotation\DataType'); } /** diff --git a/core/modules/aggregator/lib/Drupal/aggregator/Plugin/AggregatorPluginManager.php b/core/modules/aggregator/lib/Drupal/aggregator/Plugin/AggregatorPluginManager.php index 6362b51..aca0216 100644 --- a/core/modules/aggregator/lib/Drupal/aggregator/Plugin/AggregatorPluginManager.php +++ b/core/modules/aggregator/lib/Drupal/aggregator/Plugin/AggregatorPluginManager.php @@ -36,11 +36,7 @@ public function __construct($type, \Traversable $namespaces, CacheBackendInterfa 'processor' => 'Drupal\aggregator\Annotation\AggregatorProcessor', ); - $annotation_namespaces = array( - 'Drupal\aggregator\Annotation' => DRUPAL_ROOT . '/core/modules/aggregator/lib', - ); - - parent::__construct("Plugin/aggregator/$type", $namespaces, $annotation_namespaces, $type_annotations[$type]); + parent::__construct("Plugin/aggregator/$type", $namespaces, $type_annotations[$type]); $this->setCacheBackend($cache_backend, $language_manager, "aggregator_$type"); } diff --git a/core/modules/block/lib/Drupal/block/Plugin/Type/BlockManager.php b/core/modules/block/lib/Drupal/block/Plugin/Type/BlockManager.php index 9c30cfb..639af44 100644 --- a/core/modules/block/lib/Drupal/block/Plugin/Type/BlockManager.php +++ b/core/modules/block/lib/Drupal/block/Plugin/Type/BlockManager.php @@ -52,8 +52,7 @@ class BlockManager extends DefaultPluginManager { * The translation manager. */ public function __construct(\Traversable $namespaces, CacheBackendInterface $cache_backend, LanguageManager $language_manager, ModuleHandlerInterface $module_handler, TranslationInterface $translation_manager) { - $annotation_namespaces = array('Drupal\block\Annotation' => $namespaces['Drupal\block']); - parent::__construct('Plugin/Block', $namespaces, $annotation_namespaces, 'Drupal\block\Annotation\Block'); + parent::__construct('Plugin/Block', $namespaces, 'Drupal\block\Annotation\Block'); $this->alterInfo($module_handler, 'block'); $this->setCacheBackend($cache_backend, $language_manager, 'block_plugins'); diff --git a/core/modules/ckeditor/lib/Drupal/ckeditor/CKEditorPluginManager.php b/core/modules/ckeditor/lib/Drupal/ckeditor/CKEditorPluginManager.php index dc69f7e..8c04cd2 100644 --- a/core/modules/ckeditor/lib/Drupal/ckeditor/CKEditorPluginManager.php +++ b/core/modules/ckeditor/lib/Drupal/ckeditor/CKEditorPluginManager.php @@ -33,8 +33,7 @@ class CKEditorPluginManager extends DefaultPluginManager { * The module handler to invoke the alter hook with. */ public function __construct(\Traversable $namespaces, CacheBackendInterface $cache_backend, LanguageManager $language_manager, ModuleHandlerInterface $module_handler) { - $annotation_namespaces = array('Drupal\ckeditor\Annotation' => $namespaces['Drupal\ckeditor']); - parent::__construct('Plugin/CKEditorPlugin', $namespaces, $annotation_namespaces, 'Drupal\ckeditor\Annotation\CKEditorPlugin'); + parent::__construct('Plugin/CKEditorPlugin', $namespaces, 'Drupal\ckeditor\Annotation\CKEditorPlugin'); $this->alterInfo($module_handler, 'ckeditor_plugin_info'); $this->setCacheBackend($cache_backend, $language_manager, 'ckeditor_plugin'); } diff --git a/core/modules/edit/lib/Drupal/edit/Plugin/InPlaceEditorManager.php b/core/modules/edit/lib/Drupal/edit/Plugin/InPlaceEditorManager.php index 79f8013..324c7a6 100644 --- a/core/modules/edit/lib/Drupal/edit/Plugin/InPlaceEditorManager.php +++ b/core/modules/edit/lib/Drupal/edit/Plugin/InPlaceEditorManager.php @@ -29,8 +29,7 @@ class InPlaceEditorManager extends PluginManagerBase { * keyed by the corresponding namespace to look for plugin implementations, */ public function __construct(\Traversable $namespaces) { - $annotation_namespaces = array('Drupal\edit\Annotation' => $namespaces['Drupal\edit']); - $this->discovery = new AnnotatedClassDiscovery('Plugin/InPlaceEditor', $namespaces, $annotation_namespaces, 'Drupal\edit\Annotation\InPlaceEditor'); + $this->discovery = new AnnotatedClassDiscovery('Plugin/InPlaceEditor', $namespaces, 'Drupal\edit\Annotation\InPlaceEditor'); $this->discovery = new AlterDecorator($this->discovery, 'edit_editor'); $this->discovery = new CacheDecorator($this->discovery, 'edit:editor'); $this->factory = new DefaultFactory($this->discovery); diff --git a/core/modules/editor/lib/Drupal/editor/Plugin/EditorManager.php b/core/modules/editor/lib/Drupal/editor/Plugin/EditorManager.php index 9adf267..b9592f5 100644 --- a/core/modules/editor/lib/Drupal/editor/Plugin/EditorManager.php +++ b/core/modules/editor/lib/Drupal/editor/Plugin/EditorManager.php @@ -31,8 +31,7 @@ class EditorManager extends DefaultPluginManager { * The module handler to invoke the alter hook with. */ public function __construct(\Traversable $namespaces, CacheBackendInterface $cache_backend, LanguageManager $language_manager, ModuleHandlerInterface $module_handler) { - $annotation_namespaces = array('Drupal\editor\Annotation' => $namespaces['Drupal\editor']); - parent::__construct('Plugin/Editor', $namespaces, $annotation_namespaces, 'Drupal\editor\Annotation\Editor'); + parent::__construct('Plugin/Editor', $namespaces, 'Drupal\editor\Annotation\Editor'); $this->alterInfo($module_handler, 'editor_info'); $this->setCacheBackend($cache_backend, $language_manager, 'editor'); } diff --git a/core/modules/entity_reference/lib/Drupal/entity_reference/Plugin/Type/SelectionPluginManager.php b/core/modules/entity_reference/lib/Drupal/entity_reference/Plugin/Type/SelectionPluginManager.php index 11582f2..2f7edf2 100644 --- a/core/modules/entity_reference/lib/Drupal/entity_reference/Plugin/Type/SelectionPluginManager.php +++ b/core/modules/entity_reference/lib/Drupal/entity_reference/Plugin/Type/SelectionPluginManager.php @@ -27,8 +27,7 @@ class SelectionPluginManager extends DefaultPluginManager { * {@inheritdoc} */ public function __construct(\Traversable $namespaces, CacheBackendInterface $cache_backend, LanguageManager $language_manager, ModuleHandlerInterface $module_handler) { - $annotation_namespaces = array('Drupal\entity_reference\Annotation' => $namespaces['Drupal\entity_reference']); - $this->discovery = new AnnotatedClassDiscovery('Plugin/entity_reference/selection', $namespaces, $annotation_namespaces, 'Drupal\entity_reference\Annotation\EntityReferenceSelection'); + $this->discovery = new AnnotatedClassDiscovery('Plugin/entity_reference/selection', $namespaces, 'Drupal\entity_reference\Annotation\EntityReferenceSelection'); // We're not using the parent constructor because we use a different factory // method and don't need the derivative discovery decorator. diff --git a/core/modules/field/lib/Drupal/field/Plugin/Type/Formatter/FormatterPluginManager.php b/core/modules/field/lib/Drupal/field/Plugin/Type/Formatter/FormatterPluginManager.php index c916a9f..f663959 100644 --- a/core/modules/field/lib/Drupal/field/Plugin/Type/Formatter/FormatterPluginManager.php +++ b/core/modules/field/lib/Drupal/field/Plugin/Type/Formatter/FormatterPluginManager.php @@ -54,9 +54,8 @@ class FormatterPluginManager extends DefaultPluginManager { * The 'field type' plugin manager. */ public function __construct(\Traversable $namespaces, CacheBackendInterface $cache_backend, ModuleHandlerInterface $module_handler, LanguageManager $language_manager, FieldTypePluginManager $field_type_manager) { - $annotation_namespaces = array('Drupal\field\Annotation' => $namespaces['Drupal\field']); - parent::__construct('Plugin/field/formatter', $namespaces, $annotation_namespaces, 'Drupal\field\Annotation\FieldFormatter'); + parent::__construct('Plugin/field/formatter', $namespaces, 'Drupal\field\Annotation\FieldFormatter'); $this->setCacheBackend($cache_backend, $language_manager, 'field_formatter_types'); $this->alterInfo($module_handler, 'field_formatter_info'); diff --git a/core/modules/field/lib/Drupal/field/Plugin/Type/Widget/WidgetPluginManager.php b/core/modules/field/lib/Drupal/field/Plugin/Type/Widget/WidgetPluginManager.php index 0fe4be9..5559e8a 100644 --- a/core/modules/field/lib/Drupal/field/Plugin/Type/Widget/WidgetPluginManager.php +++ b/core/modules/field/lib/Drupal/field/Plugin/Type/Widget/WidgetPluginManager.php @@ -54,9 +54,7 @@ class WidgetPluginManager extends DefaultPluginManager { * The 'field type' plugin manager. */ public function __construct(\Traversable $namespaces, CacheBackendInterface $cache_backend, ModuleHandlerInterface $module_handler, LanguageManager $language_manager, FieldTypePluginManager $field_type_manager) { - $annotation_namespaces = array('Drupal\field\Annotation' => $namespaces['Drupal\field']); - - parent::__construct('Plugin/field/widget', $namespaces, $annotation_namespaces, 'Drupal\field\Annotation\FieldWidget'); + parent::__construct('Plugin/field/widget', $namespaces, 'Drupal\field\Annotation\FieldWidget'); $this->setCacheBackend($cache_backend, $language_manager, 'field_widget_types'); $this->alterInfo($module_handler, 'field_widget_info'); diff --git a/core/modules/filter/lib/Drupal/filter/FilterPluginManager.php b/core/modules/filter/lib/Drupal/filter/FilterPluginManager.php index e2aae54..1a1fcc0 100644 --- a/core/modules/filter/lib/Drupal/filter/FilterPluginManager.php +++ b/core/modules/filter/lib/Drupal/filter/FilterPluginManager.php @@ -39,8 +39,7 @@ class FilterPluginManager extends DefaultPluginManager { * The module handler to invoke the alter hook with. */ public function __construct(\Traversable $namespaces, CacheBackendInterface $cache_backend, LanguageManager $language_manager, ModuleHandlerInterface $module_handler) { - $annotation_namespaces = array('Drupal\filter\Annotation' => $namespaces['Drupal\filter']); - parent::__construct('Plugin/Filter', $namespaces, $annotation_namespaces, 'Drupal\filter\Annotation\Filter'); + parent::__construct('Plugin/Filter', $namespaces, 'Drupal\filter\Annotation\Filter'); $this->alterInfo($module_handler, 'filter_info'); $this->setCacheBackend($cache_backend, $language_manager, 'filter_plugins', array('filter_formats' => TRUE)); } diff --git a/core/modules/image/lib/Drupal/image/ImageEffectManager.php b/core/modules/image/lib/Drupal/image/ImageEffectManager.php index 64e251e..631a151 100644 --- a/core/modules/image/lib/Drupal/image/ImageEffectManager.php +++ b/core/modules/image/lib/Drupal/image/ImageEffectManager.php @@ -21,8 +21,7 @@ class ImageEffectManager extends DefaultPluginManager { * {@inheritdoc} */ public function __construct(\Traversable $namespaces, CacheBackendInterface $cache_backend, LanguageManager $language_manager, ModuleHandlerInterface $module_handler) { - $annotation_namespaces = array('Drupal\image\Annotation' => $namespaces['Drupal\image']); - parent::__construct('Plugin/ImageEffect', $namespaces, $annotation_namespaces, 'Drupal\image\Annotation\ImageEffect'); + parent::__construct('Plugin/ImageEffect', $namespaces, 'Drupal\image\Annotation\ImageEffect'); $this->alterInfo($module_handler, 'image_effect_info'); $this->setCacheBackend($cache_backend, $language_manager, 'image_effect'); diff --git a/core/modules/search/lib/Drupal/search/SearchPluginManager.php b/core/modules/search/lib/Drupal/search/SearchPluginManager.php index 3821791..ce0e17c 100644 --- a/core/modules/search/lib/Drupal/search/SearchPluginManager.php +++ b/core/modules/search/lib/Drupal/search/SearchPluginManager.php @@ -28,8 +28,7 @@ class SearchPluginManager extends DefaultPluginManager { * {@inheritdoc} */ public function __construct(\Traversable $namespaces, ConfigFactory $config_factory) { - $annotation_namespaces = array('Drupal\search\Annotation' => $namespaces['Drupal\search']); - parent::__construct('Plugin/Search', $namespaces, $annotation_namespaces, 'Drupal\search\Annotation\SearchPlugin'); + parent::__construct('Plugin/Search', $namespaces, 'Drupal\search\Annotation\SearchPlugin'); $this->configFactory = $config_factory; } diff --git a/core/modules/system/lib/Drupal/system/Plugin/ImageToolkitManager.php b/core/modules/system/lib/Drupal/system/Plugin/ImageToolkitManager.php index dc22c51..77e90c1 100644 --- a/core/modules/system/lib/Drupal/system/Plugin/ImageToolkitManager.php +++ b/core/modules/system/lib/Drupal/system/Plugin/ImageToolkitManager.php @@ -28,8 +28,7 @@ class ImageToolkitManager extends DefaultPluginManager { * The language manager. */ public function __construct(\Traversable $namespaces, CacheBackendInterface $cache_backend, LanguageManager $language_manager) { - $annotation_namespaces = array('Drupal\system\Annotation' => $namespaces['Drupal\system']); - parent::__construct('Plugin/ImageToolkit', $namespaces, $annotation_namespaces, 'Drupal\system\Annotation\ImageToolkit'); + parent::__construct('Plugin/ImageToolkit', $namespaces, 'Drupal\system\Annotation\ImageToolkit'); $this->setCacheBackend($cache_backend, $language_manager, 'image_toolkit'); } diff --git a/core/modules/system/lib/Drupal/system/Tests/Plugin/Discovery/CustomAnnotationClassDiscoveryTest.php b/core/modules/system/lib/Drupal/system/Tests/Plugin/Discovery/CustomAnnotationClassDiscoveryTest.php index b572919..d61c013 100644 --- a/core/modules/system/lib/Drupal/system/Tests/Plugin/Discovery/CustomAnnotationClassDiscoveryTest.php +++ b/core/modules/system/lib/Drupal/system/Tests/Plugin/Discovery/CustomAnnotationClassDiscoveryTest.php @@ -42,12 +42,9 @@ protected function setUp() { ), ); $root_namespaces = new \ArrayObject(array('Drupal\plugin_test' => DRUPAL_ROOT . '/core/modules/system/tests/modules/plugin_test/lib')); - $annotation_namespaces = array( - 'Drupal\plugin_test\Plugin\Annotation' => DRUPAL_ROOT . '/core/modules/system/tests/modules/plugin_test/lib', - ); - $this->discovery = new AnnotatedClassDiscovery('Plugin/plugin_test/custom_annotation', $root_namespaces, $annotation_namespaces, 'Drupal\plugin_test\Plugin\Annotation\PluginExample'); - $this->emptyDiscovery = new AnnotatedClassDiscovery('Plugin/non_existing_module/non_existing_plugin_type', $root_namespaces, $annotation_namespaces, 'Drupal\plugin_test\Plugin\Annotation\PluginExample'); + $this->discovery = new AnnotatedClassDiscovery('Plugin/plugin_test/custom_annotation', $root_namespaces, 'Drupal\plugin_test\Plugin\Annotation\PluginExample'); + $this->emptyDiscovery = new AnnotatedClassDiscovery('Plugin/non_existing_module/non_existing_plugin_type', $root_namespaces, 'Drupal\plugin_test\Plugin\Annotation\PluginExample'); } } diff --git a/core/modules/tour/lib/Drupal/tour/TipPluginManager.php b/core/modules/tour/lib/Drupal/tour/TipPluginManager.php index fb18d3b..e1b7c23 100644 --- a/core/modules/tour/lib/Drupal/tour/TipPluginManager.php +++ b/core/modules/tour/lib/Drupal/tour/TipPluginManager.php @@ -31,8 +31,7 @@ class TipPluginManager extends DefaultPluginManager { * The module handler to invoke the alter hook with. */ public function __construct(\Traversable $namespaces, CacheBackendInterface $cache_backend, LanguageManager $language_manager, ModuleHandlerInterface $module_handler) { - $annotation_namespaces = array('Drupal\tour\Annotation' => $namespaces['Drupal\tour']); - parent::__construct('Plugin/tour/tip', $namespaces, $annotation_namespaces, 'Drupal\tour\Annotation\Tip'); + parent::__construct('Plugin/tour/tip', $namespaces, 'Drupal\tour\Annotation\Tip'); $this->alterInfo($module_handler, 'tour_tips_info'); $this->setCacheBackend($cache_backend, $language_manager, 'tour'); diff --git a/core/modules/views/lib/Drupal/views/Plugin/Discovery/ViewsHandlerDiscovery.php b/core/modules/views/lib/Drupal/views/Plugin/Discovery/ViewsHandlerDiscovery.php index 460ef5a..a3a08c0 100644 --- a/core/modules/views/lib/Drupal/views/Plugin/Discovery/ViewsHandlerDiscovery.php +++ b/core/modules/views/lib/Drupal/views/Plugin/Discovery/ViewsHandlerDiscovery.php @@ -41,16 +41,12 @@ function __construct($type, \Traversable $root_namespaces) { $this->type = $type; $this->rootNamespacesIterator = $root_namespaces; - $annotation_namespaces = array( - 'Drupal\Component\Annotation' => DRUPAL_ROOT . '/core/lib', - ); $plugin_namespaces = array(); foreach ($root_namespaces as $namespace => $dir) { $plugin_namespaces["$namespace\\Plugin\\views\\{$type}"] = array($dir); } $this->pluginNamespaces = $plugin_namespaces; - $this->annotationNamespaces = $annotation_namespaces; $this->pluginDefinitionAnnotationName = 'Drupal\Component\Annotation\PluginID'; } diff --git a/core/modules/views/lib/Drupal/views/Plugin/ViewsPluginManager.php b/core/modules/views/lib/Drupal/views/Plugin/ViewsPluginManager.php index d603fba..87172d9 100644 --- a/core/modules/views/lib/Drupal/views/Plugin/ViewsPluginManager.php +++ b/core/modules/views/lib/Drupal/views/Plugin/ViewsPluginManager.php @@ -34,9 +34,8 @@ class ViewsPluginManager extends DefaultPluginManager { * The module handler to invoke the alter hook with. */ public function __construct($type, \Traversable $namespaces, CacheBackendInterface $cache_backend, LanguageManager $language_manager, ModuleHandlerInterface $module_handler) { - $annotation_namespaces = array('Drupal\views\Annotation' => $namespaces['Drupal\views']); $plugin_definition_annotation_name = 'Drupal\views\Annotation\Views' . Container::camelize($type); - parent::__construct("Plugin/views/$type", $namespaces, $annotation_namespaces, $plugin_definition_annotation_name); + parent::__construct("Plugin/views/$type", $namespaces, $plugin_definition_annotation_name); $this->defaults += array( 'parent' => 'parent',