mirror of
https://github.com/barryvdh/ReflectionDocBlock.git
synced 2026-08-18 01:57:13 +00:00
@@ -26,6 +26,6 @@ class PassthroughFormatter implements Formatter
|
|||||||
*/
|
*/
|
||||||
public function format(Tag $tag)
|
public function format(Tag $tag)
|
||||||
{
|
{
|
||||||
return '@' . $tag->getName() . ' ' . (string)$tag;
|
return trim('@' . $tag->getName() . ' ' . (string)$tag);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -38,4 +38,21 @@ class PassthroughFormatterTest extends \PHPUnit_Framework_TestCase
|
|||||||
$fixture->format(new Generic('unknown-tag', new Description('This is a description')))
|
$fixture->format(new Generic('unknown-tag', new Description('This is a description')))
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @covers ::format
|
||||||
|
* @uses \phpDocumentor\Reflection\DocBlock\Description
|
||||||
|
* @uses \phpDocumentor\Reflection\DocBlock\Tags\BaseTag
|
||||||
|
* @uses \phpDocumentor\Reflection\DocBlock\Tags\Generic
|
||||||
|
*/
|
||||||
|
public function testFormatterToStringWitoutDescription()
|
||||||
|
{
|
||||||
|
$expected = '@unknown-tag';
|
||||||
|
$fixture = new PassthroughFormatter();
|
||||||
|
|
||||||
|
$this->assertSame(
|
||||||
|
$expected,
|
||||||
|
$fixture->format(new Generic('unknown-tag'))
|
||||||
|
);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user