Lines: 100.00%
| Line | Hits | Source |
|---|---|---|
| 1 | <?php | |
| 2 | ||
| 3 | declare(strict_types=1); | |
| 4 | ||
| 5 | namespace Drupal\visitors; | |
| 6 | ||
| 7 | use Drupal\Core\Cache\CacheBackendInterface; | |
| 8 | use Drupal\Core\Extension\ModuleHandlerInterface; | |
| 9 | use Drupal\Core\Plugin\DefaultPluginManager; | |
| 10 | ||
| 11 | /** | |
| 12 | * Plugin manager for site search detectors. | |
| 13 | */ | |
| 14 | class VisitorsSiteSearchPluginManager extends DefaultPluginManager { | |
| 15 | ||
| 16 | /** | |
| 17 | * Constructs a VisitorsSiteSearchPluginManager. | |
| 18 | * | |
| 19 | * @param \Traversable $namespaces | |
| 20 | * An object that implements \Traversable which contains the root paths | |
| 21 | * keyed by the corresponding namespace to look for plugin implementations. | |
| 22 | * @param \Drupal\Core\Cache\CacheBackendInterface $cache_backend | |
| 23 | * Cache backend instance to use. | |
| 24 | * @param \Drupal\Core\Extension\ModuleHandlerInterface $module_handler | |
| 25 | * The module handler to invoke the alter hook with. | |
| 26 | */ | |
| 27 | public function __construct(\Traversable $namespaces, CacheBackendInterface $cache_backend, ModuleHandlerInterface $module_handler) { | |
| 28 | 11 | parent::__construct( |
| 29 | 11 | 'Plugin/VisitorsSiteSearch', |
| 30 | 11 | $namespaces, |
| 31 | 11 | $module_handler, |
| 32 | 11 | 'Drupal\visitors\VisitorsSiteSearchInterface', |
| 33 | 11 | 'Drupal\visitors\Attribute\VisitorsSiteSearch', |
| 34 | 11 | ); |
| 35 | ||
| 36 | 11 | $this->alterInfo('visitors_site_search_info'); |
| 37 | 11 | $this->setCacheBackend($cache_backend, 'visitors_site_search_plugins'); |
| 38 | } | |
| 39 | ||
| 40 | } |