1: <?php declare(strict_types = 1);
2:
3: namespace PHPStan\PhpDocParser\Ast\PhpDoc;
4:
5: use PHPStan\PhpDocParser\Ast\NodeAttributes;
6: use function trim;
7:
8: class DeprecatedTagValueNode implements PhpDocTagValueNode
9: {
10:
11: use NodeAttributes;
12:
13: /** @var string (may be empty) */
14: public string $description;
15:
16: public function __construct(string $description)
17: {
18: $this->description = $description;
19: }
20:
21: public function __toString(): string
22: {
23: return trim($this->description);
24: }
25:
26: /**
27: * @param array<string, mixed> $properties
28: */
29: public static function __set_state(array $properties): self
30: {
31: $instance = new self($properties['description']);
32: if (isset($properties['attributes'])) {
33: foreach ($properties['attributes'] as $key => $value) {
34: $instance->setAttribute($key, $value);
35: }
36: }
37: return $instance;
38: }
39:
40: }
41: