fix storing of empty DocBlock

This commit is contained in:
Tomas Votruba 2018-04-28 12:12:13 +02:00
parent 0e3bf4824e
commit 49c834f324
3 changed files with 6 additions and 3 deletions

View File

@ -233,7 +233,12 @@ final class DocBlockAnalyzer
return; return;
} }
$node->setDocComment(new Doc($docBlock)); if (empty($docBlock)) {
$node->setAttribute('comments', null);
} else {
$node->setDocComment(new Doc($docBlock));
}
} }
/** /**

View File

@ -2,7 +2,6 @@
final class MyTest extends \PHPUnit_Framework_TestCase final class MyTest extends \PHPUnit_Framework_TestCase
{ {
public function test() public function test()
{ {
$this->expectException('FooException'); $this->expectException('FooException');

View File

@ -2,7 +2,6 @@
final class MyTest extends \PHPUnit_Framework_TestCase final class MyTest extends \PHPUnit_Framework_TestCase
{ {
public function testThrowExceptionWhenOperatorIsInvalid(): void public function testThrowExceptionWhenOperatorIsInvalid(): void
{ {
$this->expectException('Phpml\Exception\InvalidArgumentException'); $this->expectException('Phpml\Exception\InvalidArgumentException');