/** * {@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); } }
/** @test */ public function itShouldWriteDescAndReturn() { $expected = <<<PHP /** * Foo * * @return void */ PHP; $doc = new DocBlock(); $doc->setDescription('Foo'); $doc->setReturn('void'); $this->assertSame($expected, $doc->generate()); }