getAnnotationReader example


    $this->rootNamespacesIterator = $root_namespaces;
    $plugin_namespaces = [];
    parent::__construct($plugin_namespaces$plugin_definition_annotation_name$annotation_namespaces);
  }

  /** * {@inheritdoc} */
  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;
  }

  /** * {@inheritdoc} */
  

    }
    return $this->annotationReader;
  }

  /** * {@inheritdoc} */
  public function getDefinitions() {
    $definitions = [];

    $reader = $this->getAnnotationReader();

    // Clear the annotation loaders of any previous annotation classes.     AnnotationRegistry::reset();
    // Register the namespaces of classes that can be used for annotations.     AnnotationRegistry::registerLoader('class_exists');

    // Search for classes within all PSR-4 namespace locations.     foreach ($this->getPluginNamespaces() as $namespace => $dirs) {
      foreach ($dirs as $dir) {
        if (file_exists($dir)) {
          $iterator = new \RecursiveIteratorIterator(
            
use ExpectDeprecationTrait;

    /** * @group legacy */
    public function testAnnotationReaderAutowiring()
    {
        $this->expectDeprecation('Since symfony/framework-bundle 6.4: Enabling the integration of Doctrine annotations is deprecated. Set the "framework.annotations.enabled" config option to false.');

        static::bootKernel(['root_config' => 'no_annotations_cache.yml', 'environment' => 'no_annotations_cache']);

        $annotationReader = self::getContainer()->get('test.autowiring_types.autowired_services')->getAnnotationReader();
        $this->assertInstanceOf(AnnotationReader::class$annotationReader);
    }

    /** * @group legacy */
    public function testCachedAnnotationReaderAutowiring()
    {
        $this->expectDeprecation('Since symfony/framework-bundle 6.4: Enabling the integration of Doctrine annotations is deprecated. Set the "framework.annotations.enabled" config option to false.');

        static::bootKernel(['root_config' => 'with_annotations.yml', 'environment' => 'with_annotations']);

        
return $provider && $provider !== 'component';
    }));
    $annotation->setProviders($providers);
  }

  /** * {@inheritdoc} */
  public function getDefinitions() {
    $definitions = [];

    $reader = $this->getAnnotationReader();

    // Clear the annotation loaders of any previous annotation classes.     AnnotationRegistry::reset();
    // Register the namespaces of classes that can be used for annotations.     AnnotationRegistry::registerLoader('class_exists');

    // Search for classes within all PSR-4 namespace locations.     foreach ($this->getPluginNamespaces() as $namespace => $dirs) {
      foreach ($dirs as $dir) {
        if (file_exists($dir)) {
          $iterator = new \RecursiveIteratorIterator(
            
Home | Imprint | This part of the site doesn't use cookies.