1: <?php declare(strict_types = 1);
2:
3: namespace PHPStan\PhpDocParser\Ast\Type;
4:
5: use PHPStan\PhpDocParser\Ast\Node;
6: use PHPStan\PhpDocParser\Ast\NodeAttributes;
7: use function sprintf;
8:
9: class ArrayShapeUnsealedTypeNode implements Node
10: {
11:
12: use NodeAttributes;
13:
14: /** @var TypeNode */
15: public $valueType;
16:
17: /** @var TypeNode|null */
18: public $keyType;
19:
20: public function __construct(TypeNode $valueType, ?TypeNode $keyType)
21: {
22: $this->valueType = $valueType;
23: $this->keyType = $keyType;
24: }
25:
26: public function __toString(): string
27: {
28: if ($this->keyType !== null) {
29: return sprintf('<%s, %s>', $this->keyType, $this->valueType);
30: }
31: return sprintf('<%s>', $this->valueType);
32: }
33:
34: }
35: