public function testGetOutput() { $this->inst->setReturn('string'); $this->inst->setArgument(new Argument('string:name=\'username\'')); $this->inst->setArgument(new Argument('int:age')); $this->inst->setDescription('Description test method'); $output = $this->inst->getOutput(); $this->assertEquals('string test(string $name = \'username\', int $age) Description test method', $output); }
/** * @param string $name * @param array $args Each arg is Argument expression * @param string $return * @param string $description * @return DocBlock * * @see Argument::__construct() */ public function tagMethod($name, array $args = null, $return = null, $description = null) { $method = new Method($name); if ($args !== null) { foreach ($args as $arg) { $method->setArgument(new Argument($arg)); } } if ($return !== null) { $method->setReturn($return); } if ($description !== null) { $method->setDescription($description); } return $this->make('method', [$method->getOutput()]); }