function AnnotatedClassDiscovery::getAnnotationReader

Same name in this branch
  1. 11.x core/lib/Drupal/Component/Annotation/Plugin/Discovery/AnnotatedClassDiscovery.php \Drupal\Component\Annotation\Plugin\Discovery\AnnotatedClassDiscovery::getAnnotationReader()
Same name and namespace in other branches
  1. 9 core/lib/Drupal/Core/Plugin/Discovery/AnnotatedClassDiscovery.php \Drupal\Core\Plugin\Discovery\AnnotatedClassDiscovery::getAnnotationReader()
  2. 9 core/lib/Drupal/Component/Annotation/Plugin/Discovery/AnnotatedClassDiscovery.php \Drupal\Component\Annotation\Plugin\Discovery\AnnotatedClassDiscovery::getAnnotationReader()
  3. 8.9.x core/lib/Drupal/Core/Plugin/Discovery/AnnotatedClassDiscovery.php \Drupal\Core\Plugin\Discovery\AnnotatedClassDiscovery::getAnnotationReader()
  4. 8.9.x core/lib/Drupal/Component/Annotation/Plugin/Discovery/AnnotatedClassDiscovery.php \Drupal\Component\Annotation\Plugin\Discovery\AnnotatedClassDiscovery::getAnnotationReader()
  5. 10 core/lib/Drupal/Core/Plugin/Discovery/AnnotatedClassDiscovery.php \Drupal\Core\Plugin\Discovery\AnnotatedClassDiscovery::getAnnotationReader()
  6. 10 core/lib/Drupal/Component/Annotation/Plugin/Discovery/AnnotatedClassDiscovery.php \Drupal\Component\Annotation\Plugin\Discovery\AnnotatedClassDiscovery::getAnnotationReader()

Overrides AnnotatedClassDiscovery::getAnnotationReader

1 call to AnnotatedClassDiscovery::getAnnotationReader()
AnnotatedClassDiscoveryAutomatedProviders::getDefinitions in core/modules/migrate/src/Plugin/Discovery/AnnotatedClassDiscoveryAutomatedProviders.php
Gets the definition of all plugins for this type.

File

core/lib/Drupal/Core/Plugin/Discovery/AnnotatedClassDiscovery.php, line 74

Class

AnnotatedClassDiscovery
Defines a discovery mechanism to find annotated plugins in PSR-4 namespaces.

Namespace

Drupal\Core\Plugin\Discovery

Code

protected function getAnnotationReader() {
    if (!isset($this->annotationReader)) {
        $reader = parent::getAnnotationReader();
        // Add the Core annotation classes like @Translation.
        $reader->addNamespace('Drupal\\Core\\Annotation');
        $this->annotationReader = $reader;
    }
    return $this->annotationReader;
}

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