示例#1
0
 protected function prepareAnnotations(DocBlock $block)
 {
     if (!$block->hasDescription()) {
         $block->setInline(true);
     }
     if ($block->hasAnnotations()) {
         $block->unshiftAnnotation(null);
     }
     $block->unshiftAnnotation('var', $this->type);
 }
示例#2
0
 /**
  * {@inheritdoc}
  */
 protected function prepareObjDoc(DocBlock $doc)
 {
     if (null !== ($parent = $this->getParent())) {
         $resolver = $this->getImportResolver();
         $doc->unshiftAnnotation('see', $resolver->hasAlias($parent) ? $resolver->getAlias($parent) : $resolver->getImport($parent));
     }
     $doc->unshiftAnnotation($this->getType(), $this->getName());
 }
示例#3
0
 /**
  * {@inheritdoc}
  */
 protected function prepareObjDoc(DocBlock $block)
 {
     $block->unshiftAnnotation($this->getType(), $this->getName());
 }
示例#4
0
 /**
  * writeDoc
  *
  * @param Writer $writer
  *
  * @return void
  */
 protected function prepareDoc(DocBlock $doc)
 {
     if ($this->tagAutogenerated()) {
         $doc->setDescription($this->getAutoGenerateTag() . ($doc->hasDescription() ? PHP_EOL . $doc->getDescription() : ''));
     }
 }
示例#5
0
 /**
  * setLongDescription
  *
  * @return void
  */
 public function setLongDescription($description)
 {
     $this->docBlock->setLongDescription($description);
 }
示例#6
0
 /**
  * {@inheritdoc}
  */
 protected function prepareObjDoc(DocBlock $doc)
 {
     $resolver = $this->getImportResolver();
     if (!empty($this->interfaces)) {
         foreach (array_reverse($this->interfaces) as $interface) {
             $name = $resolver->hasAlias($interface) ? $resolver->getAlias($interface) : $interface;
             $doc->unshiftAnnotation('see', self::trimNs($name));
         }
     }
     if ($this->parent) {
         $name = $resolver->hasAlias($this->getParent()) ? $resolver->getAlias($this->getParent()) : $this->getParent();
         $doc->unshiftAnnotation('see', self::trimNs($name));
     }
     $doc->unshiftAnnotation($this->getType(), $this->getName());
 }
示例#7
0
 /**
  * {@inheritdoc}
  */
 protected function prepareAnnotations(DocBlock $block)
 {
     if (!$block->hasDescription()) {
         $block->setDescription($this->name);
     }
     foreach ($this->arguments as $argument) {
         $block->addParam($argument->getType(), $argument->getName());
     }
     if ('__construct' !== $this->name) {
         $block->setReturn($this->type);
     }
 }
示例#8
0
 /** @test */
 public function itShouldGetLongDescription()
 {
     $doc = new DocBlock();
     $doc->setLongDescription('Long description.');
     $this->assertSame('Long description.', $doc->getLongDescription());
 }