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