Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. AnnotationReader.php

function AnnotationReader::__construct

Initializes a new AnnotationReader.

Throws

AnnotationException

File

vendor/doctrine/annotations/lib/Doctrine/Common/Annotations/AnnotationReader.php, line 108

Class

AnnotationReader
A reader for docblock annotations.

Namespace

Doctrine\Common\Annotations

Code

public function __construct(?DocParser $parser = null) {
    if (extension_loaded('Zend Optimizer+') && (filter_var(ini_get('zend_optimizerplus.save_comments'), FILTER_VALIDATE_BOOLEAN) === false || filter_var(ini_get('opcache.save_comments'), FILTER_VALIDATE_BOOLEAN) === false)) {
        throw AnnotationException::optimizerPlusSaveComments();
    }
    if (extension_loaded('Zend OPcache') && filter_var(ini_get('opcache.save_comments'), FILTER_VALIDATE_BOOLEAN) === false) {
        throw AnnotationException::optimizerPlusSaveComments();
    }
    // Make sure that the IgnoreAnnotation annotation is loaded
    class_exists(IgnoreAnnotation::class);
    $this->parser = $parser ?: new DocParser();
    $this->preParser = new DocParser();
    $this->preParser
        ->setImports(self::$globalImports);
    $this->preParser
        ->setIgnoreNotImportedAnnotations(true);
    $this->preParser
        ->setIgnoredAnnotationNames(self::$globalIgnoredNames);
    $this->phpParser = new PhpParser();
}

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal