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 ParamImmediatelyInvokedCallableTagValueNode implements PhpDocTagValueNode
9: {
10:
11: use NodeAttributes;
12:
13: public string $parameterName;
14:
15: /** @var string (may be empty) */
16: public string $description;
17:
18: public function __construct(string $parameterName, string $description)
19: {
20: $this->parameterName = $parameterName;
21: $this->description = $description;
22: }
23:
24: public function __toString(): string
25: {
26: return trim("{$this->parameterName} {$this->description}");
27: }
28:
29: /**
30: * @param array<string, mixed> $properties
31: */
32: public static function __set_state(array $properties): self
33: {
34: $instance = new self($properties['parameterName'], $properties['description']);
35: if (isset($properties['attributes'])) {
36: foreach ($properties['attributes'] as $key => $value) {
37: $instance->setAttribute($key, $value);
38: }
39: }
40: return $instance;
41: }
42:
43: }
44: