mirror of
https://github.com/danog/phpdoc-parser.git
synced 2024-11-26 20:15:11 +01:00
Fix PhpDocNode end newline print
This commit is contained in:
parent
b2169b6c87
commit
86b0a001af
@ -271,7 +271,7 @@ class PhpDocNode implements Node
|
||||
|
||||
public function __toString(): string
|
||||
{
|
||||
return "/**\n * " . implode("\n * ", $this->children) . '*/';
|
||||
return "/**\n * " . implode("\n * ", $this->children) . "\n */";
|
||||
}
|
||||
|
||||
}
|
||||
|
32
tests/PHPStan/Ast/PhpDoc/NodePrintTest.php
Normal file
32
tests/PHPStan/Ast/PhpDoc/NodePrintTest.php
Normal file
@ -0,0 +1,32 @@
|
||||
<?php declare(strict_types = 1);
|
||||
|
||||
namespace PHPStan\PhpDocParser\Ast\PhpDoc;
|
||||
|
||||
use PHPStan\PhpDocParser\Ast\Node;
|
||||
use PHPUnit\Framework\TestCase;
|
||||
|
||||
final class NodePrintTest extends TestCase
|
||||
{
|
||||
|
||||
/**
|
||||
* @dataProvider providePhpDocData
|
||||
*/
|
||||
public function testPrintMultiline(Node $node, string $expectedPrinted): void
|
||||
{
|
||||
$this->assertSame($expectedPrinted, (string) $node);
|
||||
}
|
||||
|
||||
|
||||
public function providePhpDocData(): \Iterator
|
||||
{
|
||||
yield [
|
||||
new PhpDocNode([
|
||||
new PhpDocTextNode('It works'),
|
||||
]),
|
||||
'/**
|
||||
* It works
|
||||
*/',
|
||||
];
|
||||
}
|
||||
|
||||
}
|
Loading…
Reference in New Issue
Block a user