コード例 #1
0
 /**
  * Assemble DocBlock.
  *
  * @param DocBlock|null      $docBlock
  * @param DescriptorAbstract $target
  *
  * @return void
  */
 protected function assembleDocBlock($docBlock, $target)
 {
     if (!$docBlock) {
         return;
     }
     $target->setSummary($docBlock->getShortDescription());
     $target->setDescription($docBlock->getLongDescription()->getContents());
     /** @var DocBlock\Tag $tag */
     foreach ($docBlock->getTags() as $tag) {
         $tagDescriptor = $this->builder->buildDescriptor($tag);
         // allow filtering of tags
         if (!$tagDescriptor) {
             continue;
         }
         $target->getTags()->get($tag->getName(), new Collection())->add($tagDescriptor);
     }
 }
コード例 #2
0
 /**
  * @covers phpDocumentor\Descriptor\DescriptorAbstract::setSummary
  * @covers phpDocumentor\Descriptor\DescriptorAbstract::getSummary
  */
 public function testSettingAndGettingSummary()
 {
     $this->assertSame('', $this->fixture->getSummary());
     $this->fixture->setSummary('summary');
     $this->assertSame('summary', $this->fixture->getSummary());
 }