Code Coverage
 
Lines
Functions and Methods
Classes and Traits
Total
100.00% covered (success)
100.00%
9 / 9
100.00% covered (success)
100.00%
1 / 1
CRAP
100.00% covered (success)
100.00%
1 / 1
ProviderPluginManager
100.00% covered (success)
100.00%
9 / 9
100.00% covered (success)
100.00%
1 / 1
1
100.00% covered (success)
100.00%
1 / 1
 __construct
100.00% covered (success)
100.00%
9 / 9
100.00% covered (success)
100.00%
1 / 1
1
1<?php
2
3declare(strict_types=1);
4
5namespace Drupal\authorization\Provider;
6
7use Drupal\Core\Cache\CacheBackendInterface;
8use Drupal\Core\Extension\ModuleHandlerInterface;
9use Drupal\Core\Plugin\DefaultPluginManager;
10use Drupal\authorization\Annotation\AuthorizationProvider;
11
12/**
13 * Manages search Provider plugins.
14 *
15 * @see \Drupal\authorization\Annotation\AuthorizationProvider
16 * @see \Drupal\authorization\Provider\ProviderInterface
17 * @see \Drupal\authorization\Provider\ProviderPluginBase
18 * @see plugin_api
19 */
20class ProviderPluginManager extends DefaultPluginManager {
21
22  /**
23   * Constructs a ProviderPluginManager object.
24   *
25   * @param \Traversable $namespaces
26   *   An object that implements \Traversable which contains the root paths
27   *   keyed by the corresponding namespace to look for plugin implementations.
28   * @param \Drupal\Core\Cache\CacheBackendInterface $cache_provider
29   *   The cache Provider instance to use.
30   * @param \Drupal\Core\Extension\ModuleHandlerInterface $module_handler
31   *   The module handler.
32   */
33  public function __construct(
34    \Traversable $namespaces,
35    CacheBackendInterface $cache_provider,
36    ModuleHandlerInterface $module_handler,
37  ) {
38    parent::__construct(
39      'Plugin/authorization/Provider',
40      $namespaces,
41      $module_handler,
42      ProviderInterface::class,
43      AuthorizationProvider::class
44    );
45    $this->setCacheBackend($cache_provider, 'authorization_providers');
46    $this->alterInfo('authorization_provider_info');
47  }
48
49}