Unverified Commit 84af9646 authored by Alex Pott's avatar Alex Pott
Browse files

Issue #3494360 by donquixote, smustgrave, godotislate, berdir: Use ::class...

Issue #3494360 by donquixote, smustgrave, godotislate, berdir: Use ::class instead of string literals in plugin managers
parent bffe9690
Loading
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -33,7 +33,7 @@ class ActionManager extends DefaultPluginManager implements CategorizingPluginMa
   *   The module handler to invoke the alter hook with.
   */
  public function __construct(\Traversable $namespaces, CacheBackendInterface $cache_backend, ModuleHandlerInterface $module_handler) {
    parent::__construct('Plugin/Action', $namespaces, $module_handler, 'Drupal\Core\Action\ActionInterface', Action::class, 'Drupal\Core\Annotation\Action');
    parent::__construct('Plugin/Action', $namespaces, $module_handler, ActionInterface::class, Action::class, 'Drupal\Core\Annotation\Action');
    $this->alterInfo('action_info');
    $this->setCacheBackend($cache_backend, 'action_info');
  }
+1 −1
Original line number Diff line number Diff line
@@ -39,7 +39,7 @@ class ArchiverManager extends DefaultPluginManager {
   *   The file handler.
   */
  public function __construct(\Traversable $namespaces, CacheBackendInterface $cache_backend, ModuleHandlerInterface $module_handler, FileSystemInterface $file_system) {
    parent::__construct('Plugin/Archiver', $namespaces, $module_handler, 'Drupal\Core\Archiver\ArchiverInterface', Archiver::class, 'Drupal\Core\Archiver\Annotation\Archiver');
    parent::__construct('Plugin/Archiver', $namespaces, $module_handler, ArchiverInterface::class, Archiver::class, 'Drupal\Core\Archiver\Annotation\Archiver');
    $this->alterInfo('archiver_info');
    $this->setCacheBackend($cache_backend, 'archiver_info_plugins');
    $this->fileSystem = $file_system;
+1 −1
Original line number Diff line number Diff line
@@ -46,7 +46,7 @@ class BlockManager extends DefaultPluginManager implements BlockManagerInterface
   *   The logger.
   */
  public function __construct(\Traversable $namespaces, CacheBackendInterface $cache_backend, ModuleHandlerInterface $module_handler, LoggerInterface $logger) {
    parent::__construct('Plugin/Block', $namespaces, $module_handler, 'Drupal\Core\Block\BlockPluginInterface', Block::class, 'Drupal\Core\Block\Annotation\Block');
    parent::__construct('Plugin/Block', $namespaces, $module_handler, BlockPluginInterface::class, Block::class, 'Drupal\Core\Block\Annotation\Block');

    $this->alterInfo($this->getType());
    $this->setCacheBackend($cache_backend, 'block_plugins');
+1 −1
Original line number Diff line number Diff line
@@ -29,7 +29,7 @@ class VariantManager extends DefaultPluginManager {
   *   The module handler to invoke the alter hook with.
   */
  public function __construct(\Traversable $namespaces, CacheBackendInterface $cache_backend, ModuleHandlerInterface $module_handler) {
    parent::__construct('Plugin/DisplayVariant', $namespaces, $module_handler, 'Drupal\Core\Display\VariantInterface', DisplayVariant::class, 'Drupal\Core\Display\Annotation\DisplayVariant');
    parent::__construct('Plugin/DisplayVariant', $namespaces, $module_handler, VariantInterface::class, DisplayVariant::class, 'Drupal\Core\Display\Annotation\DisplayVariant');

    $this->setCacheBackend($cache_backend, 'variant_plugins');
    $this->alterInfo('display_variant_plugin');
+1 −1
Original line number Diff line number Diff line
@@ -26,7 +26,7 @@ public function __construct(\Traversable $namespaces, CacheBackendInterface $cac
    $this->alterInfo('entity_reference_selection');
    $this->setCacheBackend($cache_backend, 'entity_reference_selection_plugins');

    parent::__construct('Plugin/EntityReferenceSelection', $namespaces, $module_handler, 'Drupal\Core\Entity\EntityReferenceSelection\SelectionInterface', EntityReferenceSelection::class, 'Drupal\Core\Entity\Annotation\EntityReferenceSelection');
    parent::__construct('Plugin/EntityReferenceSelection', $namespaces, $module_handler, SelectionInterface::class, EntityReferenceSelection::class, 'Drupal\Core\Entity\Annotation\EntityReferenceSelection');
  }

  /**
Loading