protected function AnnotatedClassDiscovery::getAnnotationReader in Drupal 10
Same name in this branch
- 10 core/lib/Drupal/Core/Plugin/Discovery/AnnotatedClassDiscovery.php \Drupal\Core\Plugin\Discovery\AnnotatedClassDiscovery::getAnnotationReader()
- 10 core/lib/Drupal/Component/Annotation/Plugin/Discovery/AnnotatedClassDiscovery.php \Drupal\Component\Annotation\Plugin\Discovery\AnnotatedClassDiscovery::getAnnotationReader()
Same name and namespace in other branches
- 8 core/lib/Drupal/Core/Plugin/Discovery/AnnotatedClassDiscovery.php \Drupal\Core\Plugin\Discovery\AnnotatedClassDiscovery::getAnnotationReader()
- 9 core/lib/Drupal/Core/Plugin/Discovery/AnnotatedClassDiscovery.php \Drupal\Core\Plugin\Discovery\AnnotatedClassDiscovery::getAnnotationReader()
File
- core/lib/ Drupal/ Core/ Plugin/ Discovery/ AnnotatedClassDiscovery.php, line 70 
Class
- AnnotatedClassDiscovery
- Defines a discovery mechanism to find annotated plugins in PSR-4 namespaces.
Namespace
Drupal\Core\Plugin\DiscoveryCode
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;
}