1: <?php declare(strict_types = 1);
2:
3: namespace PHPStan\PhpDoc\Tag;
4:
5: use PHPStan\Turbo\ReferencedByTurboExtension;
6: use PHPStan\Type\Generic\TemplateTypeVariance;
7: use PHPStan\Type\Type;
8:
9: /**
10: * @api
11: */
12: #[ReferencedByTurboExtension(key: 'templateTag')]
13: final class TemplateTag
14: {
15:
16: /**
17: * @param non-empty-string $name
18: */
19: public function __construct(private string $name, private Type $bound, private ?Type $default, private TemplateTypeVariance $variance)
20: {
21: }
22:
23: /**
24: * @return non-empty-string
25: */
26: public function getName(): string
27: {
28: return $this->name;
29: }
30:
31: public function getBound(): Type
32: {
33: return $this->bound;
34: }
35:
36: public function getDefault(): ?Type
37: {
38: return $this->default;
39: }
40:
41: public function getVariance(): TemplateTypeVariance
42: {
43: return $this->variance;
44: }
45:
46: }
47: