Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
Total | |
100.00% |
9 / 9 |
|
100.00% |
1 / 1 |
CRAP | |
100.00% |
1 / 1 |
VisitorsEventPluginManager | |
100.00% |
9 / 9 |
|
100.00% |
1 / 1 |
1 | |
100.00% |
1 / 1 |
__construct | |
100.00% |
9 / 9 |
|
100.00% |
1 / 1 |
1 |
1 | <?php |
2 | |
3 | namespace Drupal\visitors; |
4 | |
5 | use Drupal\Core\Cache\CacheBackendInterface; |
6 | use Drupal\Core\Extension\ModuleHandlerInterface; |
7 | use Drupal\Core\Plugin\DefaultPluginManager; |
8 | |
9 | /** |
10 | * Plugin manager for visitor event plugins. |
11 | */ |
12 | class VisitorsEventPluginManager extends DefaultPluginManager { |
13 | |
14 | /** |
15 | * Constructs a VisitorsEventPluginManager object. |
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 to invoke the alter hook with. |
24 | */ |
25 | public function __construct(\Traversable $namespaces, CacheBackendInterface $cache_backend, ModuleHandlerInterface $module_handler) { |
26 | parent::__construct( |
27 | 'Plugin/VisitorsEvent', |
28 | $namespaces, |
29 | $module_handler, |
30 | 'Drupal\visitors\VisitorsEventPluginInterface', |
31 | 'Drupal\visitors\Attribute\VisitorsEvent' |
32 | ); |
33 | |
34 | $this->alterInfo('visitors_event_info'); |
35 | $this->setCacheBackend($cache_backend, 'visitors_event_plugins'); |
36 | } |
37 | |
38 | } |