Code Duplication    Length = 21-21 lines in 6 locations

src/DisplayManager.php 1 location

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

src/FieldWidgetDisplayManager.php 1 location

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

src/SelectionDisplayManager.php 1 location

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

src/WidgetManager.php 1 location

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

src/WidgetSelectorManager.php 1 location

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

src/WidgetValidationManager.php 1 location

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