File tree Expand file tree Collapse file tree 3 files changed +41
-1
lines changed
Expand file tree Collapse file tree 3 files changed +41
-1
lines changed Original file line number Diff line number Diff line change @@ -166,7 +166,7 @@ private function splitDocBlock(string $comment)
166166 [^\n.]+
167167 (?:
168168 (?! \. \n | \n{2} ) # End summary upon a dot followed by newline or two newlines
169- [\n.] (?! [ \t]* @\pL ) # End summary when an @ is found as first character on a new line
169+ [\n.]* (?! [ \t]* @\pL ) # End summary when an @ is found as first character on a new line
170170 [^\n.]+ # Include anything else
171171 )*
172172 \.?
Original file line number Diff line number Diff line change @@ -33,6 +33,31 @@ public function tearDown(): void
3333 m::close ();
3434 }
3535
36+ public function testInterpretingSummaryWithEllipsis (): void
37+ {
38+ $ docblock = <<<DOCBLOCK
39+ /**
40+ * This is a short (...) description.
41+ *
42+ * This is a long description.
43+ *
44+ * @return void
45+ */
46+ DOCBLOCK ;
47+
48+ $ factory = DocBlockFactory::createInstance ();
49+ $ phpdoc = $ factory ->create ($ docblock );
50+
51+ $ summary = 'This is a short (...) description. ' ;
52+ $ description = 'This is a long description. ' ;
53+
54+ $ this ->assertInstanceOf (DocBlock::class, $ phpdoc );
55+ $ this ->assertSame ($ summary , $ phpdoc ->getSummary ());
56+ $ this ->assertSame ($ description , $ phpdoc ->getDescription ()->render ());
57+ $ this ->assertCount (1 , $ phpdoc ->getTags ());
58+ $ this ->assertTrue ($ phpdoc ->hasTag ('return ' ));
59+ }
60+
3661 public function testInterpretingASimpleDocBlock (): void
3762 {
3863 /**
Original file line number Diff line number Diff line change @@ -48,6 +48,21 @@ public function testDocBlockCanHaveASummary(): void
4848 $ this ->assertSame ($ summary , $ fixture ->getSummary ());
4949 }
5050
51+ /**
52+ * @covers ::__construct
53+ * @covers ::getSummary
54+ *
55+ * @uses \phpDocumentor\Reflection\DocBlock\Description
56+ */
57+ public function testDocBlockCanHaveEllipsisInSummary (): void
58+ {
59+ $ summary = 'This is a short (...) description. ' ;
60+
61+ $ fixture = new DocBlock ($ summary );
62+
63+ $ this ->assertSame ($ summary , $ fixture ->getSummary ());
64+ }
65+
5166 /**
5267 * @covers ::__construct
5368 * @covers ::getDescription
You can’t perform that action at this time.
0 commit comments