public function testDotSeperation()
    {
        $fixture = <<<DOCBLOCK
/**
 * This is a short description. This is a long description.
 * This is a continuation of the long description.
 */
DOCBLOCK;
        $object = new DocBlock($fixture);
        $this->assertEquals('This is a short description.', $object->getShortDescription());
        $this->assertEquals("This is a long description.\nThis is a continuation of the long " . "description.", $object->getLongDescription()->getContents());
    }
示例#2
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');
 }