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)
166
166
[^\n.]+
167
167
(?:
168
168
(?! \. \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
170
170
[^\n.]+ # Include anything else
171
171
)*
172
172
\.?
Original file line number Diff line number Diff line change @@ -33,6 +33,31 @@ public function tearDown(): void
33
33
m::close ();
34
34
}
35
35
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
+
36
61
public function testInterpretingASimpleDocBlock (): void
37
62
{
38
63
/**
Original file line number Diff line number Diff line change @@ -48,6 +48,21 @@ public function testDocBlockCanHaveASummary(): void
48
48
$ this ->assertSame ($ summary , $ fixture ->getSummary ());
49
49
}
50
50
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
+
51
66
/**
52
67
* @covers ::__construct
53
68
* @covers ::getDescription
You can’t perform that action at this time.
0 commit comments