function CKEditor5PluginManager::getDiscovery

Same name and namespace in other branches
  1. 10 core/modules/ckeditor5/src/Plugin/CKEditor5PluginManager.php \Drupal\ckeditor5\Plugin\CKEditor5PluginManager::getDiscovery()
  2. 11.x core/modules/ckeditor5/src/Plugin/CKEditor5PluginManager.php \Drupal\ckeditor5\Plugin\CKEditor5PluginManager::getDiscovery()

Overrides DefaultPluginManager::getDiscovery

File

core/modules/ckeditor5/src/Plugin/CKEditor5PluginManager.php, line 58

Class

CKEditor5PluginManager
Provides a CKEditor 5 plugin manager.

Namespace

Drupal\ckeditor5\Plugin

Code

protected function getDiscovery() {
    if (!$this->discovery) {
        $discovery = new AnnotatedClassDiscovery($this->subdir, $this->namespaces, $this->pluginDefinitionAnnotationName, $this->additionalAnnotationNamespaces);
        $discovery = new YamlDiscoveryDecorator($discovery, 'ckeditor5', $this->moduleHandler
            ->getModuleDirectories());
        // Note: adding translatable properties here is impossible because it only
        // supports top-level properties.
        // @see \Drupal\ckeditor5\Plugin\CKEditor5PluginDefinition::label()
        $discovery = new AnnotationBridgeDecorator($discovery, $this->pluginDefinitionAnnotationName);
        $discovery = new ContainerDerivativeDiscoveryDecorator($discovery);
        $this->discovery = $discovery;
    }
    return $this->discovery;
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.