1: <?php declare(strict_types = 1);
2:
3: namespace PHPStan\PhpDoc\Tag;
4:
5: use PHPStan\Analyser\NameScope;
6: use PHPStan\PhpDocParser\Ast\PhpDoc\TemplateTagValueNode;
7: use PHPStan\PhpDocParser\Ast\Type\TypeNode;
8: use PHPStan\Type\TypeAlias;
9:
10: /**
11: * @api
12: */
13: final class TypeAliasTag
14: {
15:
16: /**
17: * @param list<TemplateTagValueNode> $templateTagValueNodes the alias's own parameters, like the T of `Foo<T>`
18: */
19: public function __construct(
20: private string $aliasName,
21: private TypeNode $typeNode,
22: private NameScope $nameScope,
23: private array $templateTagValueNodes = [],
24: )
25: {
26: }
27:
28: public function getAliasName(): string
29: {
30: return $this->aliasName;
31: }
32:
33: public function getTypeAlias(): TypeAlias
34: {
35: return new TypeAlias(
36: $this->typeNode,
37: $this->nameScope,
38: $this->aliasName,
39: $this->templateTagValueNodes,
40: );
41: }
42:
43: }
44: