59e706016a23bfe2f4a12c7757343271a0b28513
[GitHub/WoltLab/WCF.git] /
1 <?php
2
3 declare(strict_types=1);
4
5 namespace CuyZ\Valinor\Type\Parser\Factory\Specifications;
6
7 use CuyZ\Valinor\Type\Parser\Lexer\AliasLexer;
8 use CuyZ\Valinor\Type\Parser\Lexer\TypeLexer;
9 use ReflectionClass;
10 use ReflectionFunction;
11 use Reflector;
12
13 /** @internal */
14 final class AliasSpecification implements TypeParserSpecification
15 {
16 public function __construct(
17 /** @var ReflectionClass<object>|ReflectionFunction */
18 private Reflector $reflection
19 ) {}
20
21 public function transform(TypeLexer $lexer): TypeLexer
22 {
23 return new AliasLexer($lexer, $this->reflection);
24 }
25 }