3 namespace Drupal\filter;
5 use Drupal\Component\Plugin\FallbackPluginManagerInterface;
6 use Drupal\Core\Cache\CacheBackendInterface;
7 use Drupal\Core\Extension\ModuleHandlerInterface;
8 use Drupal\Core\Plugin\DefaultPluginManager;
11 * Manages text processing filters.
13 * @see hook_filter_info_alter()
14 * @see \Drupal\filter\Annotation\Filter
15 * @see \Drupal\filter\Plugin\FilterInterface
16 * @see \Drupal\filter\Plugin\FilterBase
19 class FilterPluginManager extends DefaultPluginManager implements FallbackPluginManagerInterface {
22 * Constructs a FilterPluginManager object.
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.
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');
41 public function getFallbackPluginId($plugin_id, array $configuration = []) {