File tree Expand file tree Collapse file tree 2 files changed +21
-1
lines changed Expand file tree Collapse file tree 2 files changed +21
-1
lines changed Original file line number Diff line number Diff line change @@ -271,7 +271,14 @@ public function getTypeAliasImportTagValues(string $tagName = '@phpstan-import-t
271271
272272 public function __toString (): string
273273 {
274- return "/** \n * " . implode ("\n * " , $ this ->children ) . "\n */ " ;
274+ $ children = array_map (
275+ static function (PhpDocChildNode $ child ): string {
276+ $ s = (string ) $ child ;
277+ return $ s === '' ? '' : ' ' . $ s ;
278+ },
279+ $ this ->children
280+ );
281+ return "/** \n * " . implode ("\n * " , $ children ) . "\n */ " ;
275282 }
276283
277284}
Original file line number Diff line number Diff line change @@ -25,6 +25,19 @@ public function providePhpDocData(): \Iterator
2525 ]),
2626 '/**
2727 * It works
28+ */ ' ,
29+ ];
30+
31+ yield [
32+ new PhpDocNode ([
33+ new PhpDocTextNode ('It works ' ),
34+ new PhpDocTextNode ('' ),
35+ new PhpDocTextNode ('with empty lines ' ),
36+ ]),
37+ '/**
38+ * It works
39+ *
40+ * with empty lines
2841 */ ' ,
2942 ];
3043 }
You can’t perform that action at this time.
0 commit comments