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