1: | <?php declare(strict_types=1); |
2: | |
3: | namespace PhpParser\Node; |
4: | |
5: | class UnionType extends ComplexType { |
6: | /** @var (Identifier|Name|IntersectionType)[] Types */ |
7: | public array $types; |
8: | |
9: | /** |
10: | * Constructs a union type. |
11: | * |
12: | * @param (Identifier|Name|IntersectionType)[] $types Types |
13: | * @param array<string, mixed> $attributes Additional attributes |
14: | */ |
15: | public function __construct(array $types, array $attributes = []) { |
16: | $this->attributes = $attributes; |
17: | $this->types = $types; |
18: | } |
19: | |
20: | public function getSubNodeNames(): array { |
21: | return ['types']; |
22: | } |
23: | |
24: | public function getType(): string { |
25: | return 'UnionType'; |
26: | } |
27: | } |
28: |