示例#1
0
 /**
  * Extracts data from reflection's docBlock and adds it to current $doc.
  *
  * @param $doc
  * @return bool $doc If docBlock
  * @throws \Exception
  */
 protected function parseDocBlock($doc)
 {
     if (!($docBlock = new DocBlock($this->reflection))) {
         return false;
     }
     if ($docBlock->getTagsByName(self::TAG_PREFIX . 'ignore')) {
         throw new \Exception("Ignoring due tag");
     }
     if (!$doc->shortDescription && ($value = $docBlock->getShortDescription())) {
         $doc->shortDescription = $value;
     }
     if (!$doc->longDescription && ($value = $docBlock->getLongDescription()->getContents())) {
         $doc->longDescription = $value;
     }
     $tags = $docBlock->getTags();
     $offset = strlen(self::TAG_PREFIX);
     foreach ($tags as $tag) {
         $name = $tag->getName();
         if (strpos($name, self::TAG_PREFIX) === 0) {
             $doc->addTag(substr($name, $offset), $tag);
         }
     }
     return (bool) $docBlock->getTagsByName('inherited') || (bool) $docBlock->getTagsByName('inheritdoc');
 }