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

Breadcrumb

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

function AnnotationReader::collectParsingMetadata

Collects parsing metadata for a given class or function.

Parameters

ReflectionClass|ReflectionFunction $reflection:

2 calls to AnnotationReader::collectParsingMetadata()
AnnotationReader::getIgnoredAnnotationNames in vendor/doctrine/annotations/lib/Doctrine/Common/Annotations/AnnotationReader.php
Returns the ignored annotations for the given class or function.
AnnotationReader::getImports in vendor/doctrine/annotations/lib/Doctrine/Common/Annotations/AnnotationReader.php
Retrieves imports for a class or a function.

File

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

Class

AnnotationReader
A reader for docblock annotations.

Namespace

Doctrine\Common\Annotations

Code

private function collectParsingMetadata($reflection) : void {
    $type = $reflection instanceof ReflectionClass ? 'class' : 'function';
    $name = $reflection->getName();
    $ignoredAnnotationNames = self::$globalIgnoredNames;
    $annotations = $this->preParser
        ->parse($reflection->getDocComment(), $type . ' ' . $name);
    foreach ($annotations as $annotation) {
        if (!$annotation instanceof IgnoreAnnotation) {
            continue;
        }
        foreach ($annotation->names as $annot) {
            $ignoredAnnotationNames[$annot] = true;
        }
    }
    $this->imports[$type][$name] = array_merge(self::$globalImports, $this->phpParser
        ->parseUseStatements($reflection), [
        '__NAMESPACE__' => $reflection->getNamespaceName(),
        'self' => $name,
    ]);
    $this->ignoredAnnotationNames[$type][$name] = $ignoredAnnotationNames;
}

API Navigation

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