You are here

public function StaticReflectionParser::getDocComment in Drupal 9

Same name and namespace in other branches
  1. 10 core/lib/Drupal/Component/Annotation/Doctrine/StaticReflectionParser.php \Drupal\Component\Annotation\Doctrine\StaticReflectionParser::getDocComment()

Gets the doc comment.

Parameters

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

string $name The name of the property or method, not needed for 'class'.:

Return value

string The doc comment, empty string if none.

File

core/lib/Drupal/Component/Annotation/Doctrine/StaticReflectionParser.php, line 316
This class is a near-copy of Doctrine\Common\Reflection\StaticReflectionParser, which is part of the Doctrine project: <http://www.doctrine-project.org>. It was copied from version 1.2.2.

Class

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

Namespace

Drupal\Component\Annotation\Doctrine

Code

public function getDocComment($type = 'class', $name = '') {
  $this
    ->parse();
  return $name ? $this->docComment[$type][$name] : $this->docComment[$type];
}