public function testReadWrite()
 {
     $param = new ParamTag('string $a the string');
     $this->assertEquals('string', $param->getType());
     $this->assertEquals('$a', $param->getVariable());
     $this->assertEquals('the string', $param->getDescription());
     $this->assertFalse($param->isVariadic());
     $this->assertEquals('@param string $a the string', $param->toString());
     $param = new ParamTag('string ...$a');
     $this->assertEmpty($param->getDescription());
     $this->assertTrue($param->isVariadic());
     $this->assertEquals('@param string ...$a', $param->toString());
 }
Exemplo n.º 2
0
 /**
  * Returns a docblock tag for this parameter
  * 
  * @return ParamTag
  */
 public function getDocblockTag()
 {
     return ParamTag::create()->setType($this->getType() ?: 'mixed')->setVariable($this->getName())->setDescription($this->getTypeDescription());
 }