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

Breadcrumb

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

function StaticReflectionParser::getStaticReflectionParserForDeclaringClass

Gets the PSR-0 parser for the declaring class.

Parameters

string $type The type: 'property' or 'method'.:

string $name The name of the property or method.:

Return value

StaticReflectionParser A static reflection parser for the declaring class.

Throws

ReflectionException

File

core/lib/Drupal/Component/Annotation/Doctrine/StaticReflectionParser.php, line 344

Class

StaticReflectionParser
Parses a file for namespaces/use/class declarations.

Namespace

Drupal\Component\Annotation\Doctrine

Code

public function getStaticReflectionParserForDeclaringClass($type, $name) {
    $this->parse();
    if (isset($this->docComment[$type][$name])) {
        return $this;
    }
    if (!empty($this->parentClassName)) {
        return $this->getParentStaticReflectionParser()
            ->getStaticReflectionParserForDeclaringClass($type, $name);
    }
    throw new ReflectionException('Invalid ' . $type . ' "' . $name . '"');
}
RSS feed
Powered by Drupal