Code Duplication    Length = 21-21 lines in 6 locations

src/DisplayManager.php 1 location

@@ 12-32 (lines=21) @@
9
/**
10
 * Manages entity browser display plugins.
11
 */
12
class DisplayManager extends DefaultPluginManager {
13
14
  /**
15
   * Constructs a new EntityBrowserDisplayManager.
16
   *
17
   * @param \Traversable $namespaces
18
   *   An object that implements \Traversable which contains the root paths
19
   *   keyed by the corresponding namespace to look for plugin implementations.
20
   * @param \Drupal\Core\Cache\CacheBackendInterface $cache_backend
21
   *   Cache backend instance to use.
22
   * @param \Drupal\Core\Extension\ModuleHandlerInterface $module_handler
23
   *   The module handler.
24
   */
25
  public function __construct(\Traversable $namespaces, CacheBackendInterface $cache_backend, ModuleHandlerInterface $module_handler) {
26
    parent::__construct('Plugin/EntityBrowser/Display', $namespaces, $module_handler, 'Drupal\entity_browser\DisplayInterface', 'Drupal\entity_browser\Annotation\EntityBrowserDisplay');
27
28
    $this->alterInfo('entity_browser_display_info');
29
    $this->setCacheBackend($cache_backend, 'entity_browser_display_plugins');
30
  }
31
32
}
33

src/FieldWidgetDisplayManager.php 1 location

@@ 12-32 (lines=21) @@
9
/**
10
 * Manages entity browser field widget display plugins.
11
 */
12
class FieldWidgetDisplayManager extends DefaultPluginManager {
13
14
  /**
15
   * Constructs a new FieldWidgetDisplayManager.
16
   *
17
   * @param \Traversable $namespaces
18
   *   An object that implements \Traversable which contains the root paths
19
   *   keyed by the corresponding namespace to look for plugin implementations.
20
   * @param \Drupal\Core\Cache\CacheBackendInterface $cache_backend
21
   *   Cache backend instance to use.
22
   * @param \Drupal\Core\Extension\ModuleHandlerInterface $module_handler
23
   *   The module handler.
24
   */
25
  public function __construct(\Traversable $namespaces, CacheBackendInterface $cache_backend, ModuleHandlerInterface $module_handler) {
26
    parent::__construct('Plugin/EntityBrowser/FieldWidgetDisplay', $namespaces, $module_handler, 'Drupal\entity_browser\FieldWidgetDisplayInterface', 'Drupal\entity_browser\Annotation\EntityBrowserFieldWidgetDisplay');
27
28
    $this->alterInfo('entity_browser_field_widget_display_info');
29
    $this->setCacheBackend($cache_backend, 'entity_browser_field_widget_display_plugins');
30
  }
31
32
}
33

src/SelectionDisplayManager.php 1 location

@@ 12-32 (lines=21) @@
9
/**
10
 * Manages entity browser selection display plugins.
11
 */
12
class SelectionDisplayManager extends DefaultPluginManager {
13
14
  /**
15
   * Constructs a new SelectionDisplayManager.
16
   *
17
   * @param \Traversable $namespaces
18
   *   An object that implements \Traversable which contains the root paths
19
   *   keyed by the corresponding namespace to look for plugin implementations.
20
   * @param \Drupal\Core\Cache\CacheBackendInterface $cache_backend
21
   *   Cache backend instance to use.
22
   * @param \Drupal\Core\Extension\ModuleHandlerInterface $module_handler
23
   *   The module handler.
24
   */
25
  public function __construct(\Traversable $namespaces, CacheBackendInterface $cache_backend, ModuleHandlerInterface $module_handler) {
26
    parent::__construct('Plugin/EntityBrowser/SelectionDisplay', $namespaces, $module_handler, 'Drupal\entity_browser\SelectionDisplayInterface', 'Drupal\entity_browser\Annotation\EntityBrowserSelectionDisplay');
27
28
    $this->alterInfo('entity_browser_selection_display_info');
29
    $this->setCacheBackend($cache_backend, 'entity_browser_selection_display_plugins');
30
  }
31
32
}
33

src/WidgetManager.php 1 location

@@ 12-32 (lines=21) @@
9
/**
10
 * Manages entity browser widget plugins.
11
 */
12
class WidgetManager extends DefaultPluginManager {
13
14
  /**
15
   * Constructs a new WidgetManager.
16
   *
17
   * @param \Traversable $namespaces
18
   *   An object that implements \Traversable which contains the root paths
19
   *   keyed by the corresponding namespace to look for plugin implementations.
20
   * @param \Drupal\Core\Cache\CacheBackendInterface $cache_backend
21
   *   Cache backend instance to use.
22
   * @param \Drupal\Core\Extension\ModuleHandlerInterface $module_handler
23
   *   The module handler.
24
   */
25
  public function __construct(\Traversable $namespaces, CacheBackendInterface $cache_backend, ModuleHandlerInterface $module_handler) {
26
    parent::__construct('Plugin/EntityBrowser/Widget', $namespaces, $module_handler, 'Drupal\entity_browser\WidgetInterface', 'Drupal\entity_browser\Annotation\EntityBrowserWidget');
27
28
    $this->alterInfo('entity_browser_widget_info');
29
    $this->setCacheBackend($cache_backend, 'entity_browser_widget_plugins');
30
  }
31
32
}
33

src/WidgetSelectorManager.php 1 location

@@ 12-32 (lines=21) @@
9
/**
10
 * Manages entity browser widget selector plugins.
11
 */
12
class WidgetSelectorManager extends DefaultPluginManager {
13
14
  /**
15
   * Constructs a new WidgetManager.
16
   *
17
   * @param \Traversable $namespaces
18
   *   An object that implements \Traversable which contains the root paths
19
   *   keyed by the corresponding namespace to look for plugin implementations.
20
   * @param \Drupal\Core\Cache\CacheBackendInterface $cache_backend
21
   *   Cache backend instance to use.
22
   * @param \Drupal\Core\Extension\ModuleHandlerInterface $module_handler
23
   *   The module handler.
24
   */
25
  public function __construct(\Traversable $namespaces, CacheBackendInterface $cache_backend, ModuleHandlerInterface $module_handler) {
26
    parent::__construct('Plugin/EntityBrowser/WidgetSelector', $namespaces, $module_handler, 'Drupal\entity_browser\WidgetSelectorInterface', 'Drupal\entity_browser\Annotation\EntityBrowserWidgetSelector');
27
28
    $this->alterInfo('entity_browser_widget_selector_info');
29
    $this->setCacheBackend($cache_backend, 'entity_browser_widget_selector_plugins');
30
  }
31
32
}
33

src/WidgetValidationManager.php 1 location

@@ 12-32 (lines=21) @@
9
/**
10
 * Manages entity browser widget validation plugins.
11
 */
12
class WidgetValidationManager extends DefaultPluginManager {
13
14
  /**
15
   * Constructs a new WidgetValidationManager.
16
   *
17
   * @param \Traversable $namespaces
18
   *   An object that implements \Traversable which contains the root paths
19
   *   keyed by the corresponding namespace to look for plugin implementations.
20
   * @param \Drupal\Core\Cache\CacheBackendInterface $cache_backend
21
   *   Cache backend instance to use.
22
   * @param \Drupal\Core\Extension\ModuleHandlerInterface $module_handler
23
   *   The module handler.
24
   */
25
  public function __construct(\Traversable $namespaces, CacheBackendInterface $cache_backend, ModuleHandlerInterface $module_handler) {
26
    parent::__construct('Plugin/EntityBrowser/WidgetValidation', $namespaces, $module_handler, 'Drupal\entity_browser\WidgetValidationInterface', 'Drupal\entity_browser\Annotation\EntityBrowserWidgetValidation');
27
28
    $this->alterInfo('entity_browser_widget_validation_info');
29
    $this->setCacheBackend($cache_backend, 'entity_browser_widget_validation_plugins');
30
  }
31
32
}
33