mirror of
https://github.com/barryvdh/ReflectionDocBlock.git
synced 2026-08-18 10:07:12 +00:00
@@ -166,7 +166,7 @@ final class DocBlockFactory implements DocBlockFactoryInterface
|
|||||||
[^\n.]+
|
[^\n.]+
|
||||||
(?:
|
(?:
|
||||||
(?! \. \n | \n{2} ) # End summary upon a dot followed by newline or two newlines
|
(?! \. \n | \n{2} ) # End summary upon a dot followed by newline or two newlines
|
||||||
[\n.] (?! [ \t]* @\pL ) # End summary when an @ is found as first character on a new line
|
[\n.]* (?! [ \t]* @\pL ) # End summary when an @ is found as first character on a new line
|
||||||
[^\n.]+ # Include anything else
|
[^\n.]+ # Include anything else
|
||||||
)*
|
)*
|
||||||
\.?
|
\.?
|
||||||
|
|||||||
@@ -33,6 +33,31 @@ class InterpretingDocBlocksTest extends TestCase
|
|||||||
m::close();
|
m::close();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function testInterpretingSummaryWithEllipsis(): void
|
||||||
|
{
|
||||||
|
$docblock = <<<DOCBLOCK
|
||||||
|
/**
|
||||||
|
* This is a short (...) description.
|
||||||
|
*
|
||||||
|
* This is a long description.
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
DOCBLOCK;
|
||||||
|
|
||||||
|
$factory = DocBlockFactory::createInstance();
|
||||||
|
$phpdoc = $factory->create($docblock);
|
||||||
|
|
||||||
|
$summary = 'This is a short (...) description.';
|
||||||
|
$description = 'This is a long description.';
|
||||||
|
|
||||||
|
$this->assertInstanceOf(DocBlock::class, $phpdoc);
|
||||||
|
$this->assertSame($summary, $phpdoc->getSummary());
|
||||||
|
$this->assertSame($description, $phpdoc->getDescription()->render());
|
||||||
|
$this->assertCount(1, $phpdoc->getTags());
|
||||||
|
$this->assertTrue($phpdoc->hasTag('return'));
|
||||||
|
}
|
||||||
|
|
||||||
public function testInterpretingASimpleDocBlock(): void
|
public function testInterpretingASimpleDocBlock(): void
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -48,6 +48,21 @@ class DocBlockTest extends TestCase
|
|||||||
$this->assertSame($summary, $fixture->getSummary());
|
$this->assertSame($summary, $fixture->getSummary());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @covers ::__construct
|
||||||
|
* @covers ::getSummary
|
||||||
|
*
|
||||||
|
* @uses \phpDocumentor\Reflection\DocBlock\Description
|
||||||
|
*/
|
||||||
|
public function testDocBlockCanHaveEllipsisInSummary(): void
|
||||||
|
{
|
||||||
|
$summary = 'This is a short (...) description.';
|
||||||
|
|
||||||
|
$fixture = new DocBlock($summary);
|
||||||
|
|
||||||
|
$this->assertSame($summary, $fixture->getSummary());
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @covers ::__construct
|
* @covers ::__construct
|
||||||
* @covers ::getDescription
|
* @covers ::getDescription
|
||||||
|
|||||||
Reference in New Issue
Block a user