Updated Drupal to 8.6. This goes with the following updates because it's possible...
[yaffs-website] / web / core / modules / filter / src / FilterPluginManager.php
1 <?php
2
3 namespace Drupal\filter;
4
5 use Drupal\Component\Plugin\FallbackPluginManagerInterface;
6 use Drupal\Core\Cache\CacheBackendInterface;
7 use Drupal\Core\Extension\ModuleHandlerInterface;
8 use Drupal\Core\Plugin\DefaultPluginManager;
9
10 /**
11  * Manages text processing filters.
12  *
13  * @see hook_filter_info_alter()
14  * @see \Drupal\filter\Annotation\Filter
15  * @see \Drupal\filter\Plugin\FilterInterface
16  * @see \Drupal\filter\Plugin\FilterBase
17  * @see plugin_api
18  */
19 class FilterPluginManager extends DefaultPluginManager implements FallbackPluginManagerInterface {
20
21   /**
22    * Constructs a FilterPluginManager 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_backend
28    *   Cache backend instance to use.
29    * @param \Drupal\Core\Extension\ModuleHandlerInterface $module_handler
30    *   The module handler to invoke the alter hook with.
31    */
32   public function __construct(\Traversable $namespaces, CacheBackendInterface $cache_backend, ModuleHandlerInterface $module_handler) {
33     parent::__construct('Plugin/Filter', $namespaces, $module_handler, 'Drupal\filter\Plugin\FilterInterface', 'Drupal\filter\Annotation\Filter');
34     $this->alterInfo('filter_info');
35     $this->setCacheBackend($cache_backend, 'filter_plugins');
36   }
37
38   /**
39    * {@inheritdoc}
40    */
41   public function getFallbackPluginId($plugin_id, array $configuration = []) {
42     return 'filter_null';
43   }
44
45 }