public function generateDocblock() { $docblock = $this->getDocblock(); $docblock->setShortDescription($this->getDescription()); $docblock->setLongDescription($this->getLongDescription()); $type = $this->getType(); if (!empty($type)) { $docblock->appendTag(VarTag::create()->setType($type)->setDescription($this->getTypeDescription())); } }
public function testDocblock() { $expected = '/** * @var mixed $foo bar */'; $docblock = new Docblock(); $var = VarTag::create()->setType('mixed')->setVariable('foo')->setDescription('bar'); $docblock->appendTag($var); $this->assertEquals($expected, $docblock->toString()); }