With the default settings the parser includes annotations, better known as doc comment tags, in the generated result. This means it extracts the type information of @var tags for properties, and types in @return + @throws tags of functions and methods. The current implementation tries to ignore all scalar types from boolean to void. You should disable this feature for project that have more or less invalid doc comments, because it could produce invalid results. $parser->setIgnoreAnnotations(); Note: Due to the fact that it is possible to use the same name for multiple classes and interfaces, and there is no way to determine to which package it belongs, while the parser handles class, interface or method signatures, the parser could/will create a code tree that doesn't reflect the real source structure.
Beispiel #1
0
 /**
  * Implements some quirks and hacks to support php here- and now-doc for
  * PHP 5.2.x versions :/
  *
  * @return \PDepend\Source\AST\ASTHeredoc
  * @since 1.0.0
  */
 protected function parseHeredoc()
 {
     $heredoc = parent::parseHeredoc();
     if (version_compare(phpversion(), "5.3.0alpha") >= 0) {
         return $heredoc;
     }
     // Consume dangling semicolon
     $this->tokenizer->next();
     $token = $this->tokenizer->next();
     preg_match('(/\\*(\'|")\\*/)', $token->image, $match);
     return $heredoc;
 }