| 1: | <?php declare(strict_types = 1); |
| 2: | |
| 3: | namespace PHPStan\PhpDocParser\Ast\Type; |
| 4: | |
| 5: | use PHPStan\PhpDocParser\Ast\NodeAttributes; |
| 6: | use function implode; |
| 7: | |
| 8: | class IntersectionTypeNode implements TypeNode |
| 9: | { |
| 10: | |
| 11: | use NodeAttributes; |
| 12: | |
| 13: | /** @var TypeNode[] */ |
| 14: | public $types; |
| 15: | |
| 16: | public function __construct(array $types) |
| 17: | { |
| 18: | $this->types = $types; |
| 19: | } |
| 20: | |
| 21: | |
| 22: | public function __toString(): string |
| 23: | { |
| 24: | return '(' . implode(' & ', $this->types) . ')'; |
| 25: | } |
| 26: | |
| 27: | } |
| 28: |