Skip to content

Commit

Permalink
Description is required (but might be empty)
Browse files Browse the repository at this point in the history
  • Loading branch information
ondrejmirtes committed Apr 23, 2019
1 parent 7b31746 commit 9558a70
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions src/Ast/PhpDoc/DeprecatedTagValueNode.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,18 @@
class DeprecatedTagValueNode implements PhpDocTagValueNode
{

/** @var string|null (may be empty) */
/** @var string (may be empty) */
public $description;

public function __construct(?string $description = null)
public function __construct(string $description)
{
$this->description = $description;
}


public function __toString(): string
{
return $this->description ? trim($this->description) : '';
return trim($this->description);
}

}
2 changes: 1 addition & 1 deletion tests/PHPStan/Parser/PhpDocParserTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -977,7 +977,7 @@ public function provideDeprecatedTagsData(): \Iterator
new PhpDocNode([
new PhpDocTagNode(
'@deprecated',
new DeprecatedTagValueNode()
new DeprecatedTagValueNode('')
),
]),
];
Expand Down

0 comments on commit 9558a70

Please sign in to comment.