1: <?php declare(strict_types = 1);
2:
3: namespace PHPStan\Type\Generic;
4:
5: use PHPStan\Turbo\ShadowedByTurboExtension;
6: use PHPStan\Type\IntersectionType;
7: use PHPStan\Type\Type;
8:
9: /** @api */
10: #[ShadowedByTurboExtension(implementation: __DIR__ . '/../../../turbo-ext/src/TemplateIntersectionType.cpp')]
11: final class TemplateIntersectionType extends IntersectionType implements TemplateType
12: {
13:
14: /** @use TemplateTypeTrait<IntersectionType> */
15: use TemplateTypeTrait;
16:
17: /**
18: * @param non-empty-string $name
19: */
20: public function __construct(
21: TemplateTypeScope $scope,
22: TemplateTypeStrategy $templateTypeStrategy,
23: TemplateTypeVariance $templateTypeVariance,
24: string $name,
25: IntersectionType $bound,
26: ?Type $default,
27: )
28: {
29: parent::__construct($bound->getTypes());
30:
31: $this->scope = $scope;
32: $this->strategy = $templateTypeStrategy;
33: $this->variance = $templateTypeVariance;
34: $this->name = $name;
35: $this->bound = $bound;
36: $this->default = $default;
37: }
38:
39: }
40: