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