1: <?php declare(strict_types = 1);
2:
3: namespace PHPStan\PhpDocParser\Ast\PhpDoc\Doctrine;
4:
5: use PHPStan\PhpDocParser\Ast\NodeAttributes;
6: use PHPStan\PhpDocParser\Ast\PhpDoc\PhpDocTagValueNode;
7: use function trim;
8:
9: class DoctrineTagValueNode implements PhpDocTagValueNode
10: {
11:
12: use NodeAttributes;
13:
14: /** @var DoctrineAnnotation */
15: public $annotation;
16:
17: /** @var string (may be empty) */
18: public $description;
19:
20:
21: public function __construct(
22: DoctrineAnnotation $annotation,
23: string $description
24: )
25: {
26: $this->annotation = $annotation;
27: $this->description = $description;
28: }
29:
30:
31: public function __toString(): string
32: {
33: return trim("{$this->annotation} {$this->description}");
34: }
35:
36: }
37: