mirror of
https://github.com/barryvdh/ReflectionDocBlock.git
synced 2026-08-18 18:13:13 +00:00
Merge remote-tracking branch 'warxcell/empty_var_name'
This commit is contained in:
@@ -111,8 +111,8 @@ class Var_ extends BaseTag implements Factory\StaticMethod
|
|||||||
*/
|
*/
|
||||||
public function __toString()
|
public function __toString()
|
||||||
{
|
{
|
||||||
return ($this->type ? $this->type . ' ' : '')
|
return ($this->type ? $this->type.' ' : '')
|
||||||
. '$' . $this->variableName
|
.(empty($this->variableName) ? null : ('$'.$this->variableName))
|
||||||
. ($this->description ? ' ' . $this->description : '');
|
.($this->description ? ' '.$this->description : '');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -37,6 +37,17 @@ class VarTest extends \PHPUnit_Framework_TestCase
|
|||||||
$this->assertSame('var', $fixture->getName());
|
$this->assertSame('var', $fixture->getName());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @uses \phpDocumentor\Reflection\DocBlock\Tags\Var_::__construct
|
||||||
|
* @covers \phpDocumentor\Reflection\DocBlock\Tags\BaseTag::render
|
||||||
|
*/
|
||||||
|
public function testIfVariableNameIsOmmitedIfEmpty()
|
||||||
|
{
|
||||||
|
$fixture = new Var_('', null, null);
|
||||||
|
|
||||||
|
$this->assertSame('@var', $fixture->render());
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @uses \phpDocumentor\Reflection\DocBlock\Tags\Var_::__construct
|
* @uses \phpDocumentor\Reflection\DocBlock\Tags\Var_::__construct
|
||||||
* @uses \phpDocumentor\Reflection\DocBlock\Tags\Var_::__toString
|
* @uses \phpDocumentor\Reflection\DocBlock\Tags\Var_::__toString
|
||||||
|
|||||||
Reference in New Issue
Block a user