EntityProviderManager::__construct()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 4
nc 1
nop 3
dl 0
loc 6
rs 9.4285
c 0
b 0
f 0
1
<?php
2
3
namespace Drupal\crop;
4
5
use Drupal\Core\Cache\CacheBackendInterface;
6
use Drupal\Core\Extension\ModuleHandlerInterface;
7
use Drupal\Core\Plugin\DefaultPluginManager;
8
9
/**
10
 * Manages crop entity provider plugins.
11
 */
12
class EntityProviderManager extends DefaultPluginManager {
13
14
  /**
15
   * Constructs a new EntityProviderManager.
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/Crop/EntityProvider', $namespaces, $module_handler, 'Drupal\crop\EntityProviderInterface', 'Drupal\crop\Annotation\CropEntityProvider');
27
28
    $this->alterInfo('crop_entity_provider_info');
29
    $this->setCacheBackend($cache_backend, 'crop_entity_provider_plugins');
30
  }
31
32
}
33