|
17 | 17 | use TypeLang\Mapper\Runtime\Parser\TypeParser; |
18 | 18 | use TypeLang\Mapper\Runtime\Parser\TypeParserInterface; |
19 | 19 | use TypeLang\Mapper\Runtime\Parser\TypeParserRuntime; |
20 | | -use TypeLang\Mapper\Runtime\Repository\InMemoryTypeRepository; |
21 | | -use TypeLang\Mapper\Runtime\Repository\LoggableTypeRepository; |
22 | | -use TypeLang\Mapper\Runtime\Repository\TraceableTypeRepository; |
| 20 | +use TypeLang\Mapper\Runtime\Repository\InMemoryTypeRepositoryRuntime; |
| 21 | +use TypeLang\Mapper\Runtime\Repository\LoggableTypeRepositoryRuntime; |
| 22 | +use TypeLang\Mapper\Runtime\Repository\TraceableTypeRepositoryRuntime; |
23 | 23 | use TypeLang\Mapper\Runtime\Repository\TypeRepository; |
24 | 24 | use TypeLang\Mapper\Runtime\Repository\TypeRepositoryInterface; |
| 25 | +use TypeLang\Mapper\Runtime\Repository\TypeRepositoryRuntime; |
25 | 26 | use TypeLang\Mapper\Type\TypeInterface; |
26 | 27 |
|
27 | 28 | final class Mapper implements NormalizerInterface, DenormalizerInterface |
@@ -57,20 +58,20 @@ private function createTypeParser(PlatformInterface $platform): TypeParserInterf |
57 | 58 |
|
58 | 59 | private function createTypeRepository(PlatformInterface $platform): TypeRepositoryInterface |
59 | 60 | { |
60 | | - $repository = TypeRepository::createFromPlatform( |
61 | | - platform: $platform, |
62 | | - parser: $this->parser, |
63 | | - ); |
| 61 | + $runtime = TypeRepositoryRuntime::createFromPlatform($platform, $this->parser); |
64 | 62 |
|
65 | 63 | if (($tracer = $this->config->getTracer()) !== null) { |
66 | | - $repository = new TraceableTypeRepository($tracer, $repository); |
| 64 | + $runtime = new TraceableTypeRepositoryRuntime($tracer, $runtime); |
67 | 65 | } |
68 | 66 |
|
69 | 67 | if (($logger = $this->config->getLogger()) !== null) { |
70 | | - $repository = new LoggableTypeRepository($logger, $repository); |
| 68 | + $runtime = new LoggableTypeRepositoryRuntime($logger, $runtime); |
71 | 69 | } |
72 | 70 |
|
73 | | - return new InMemoryTypeRepository($repository); |
| 71 | + return new TypeRepository( |
| 72 | + parser: $this->parser, |
| 73 | + runtime: new InMemoryTypeRepositoryRuntime($runtime), |
| 74 | + ); |
74 | 75 | } |
75 | 76 |
|
76 | 77 | /** |
|
0 commit comments