Conditions | 3 |
Paths | 1 |
Total Lines | 16 |
Code Lines | 9 |
Lines | 0 |
Ratio | 0 % |
Changes | 3 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
26 | public function boot(Container $container): void |
||
27 | { |
||
28 | $container->bindSingleton(ReaderInterface::class, function () use ($container) { |
||
29 | $factory = new Factory(); |
||
30 | |||
31 | if ($container->has(CacheInterface::class)) { |
||
32 | $factory = $factory->withCache( |
||
33 | $container->get(CacheInterface::class) |
||
34 | ); |
||
35 | } elseif ($container->has(CacheItemInterface::class)) { |
||
36 | $factory = $factory->withCache( |
||
37 | $container->get(CacheItemInterface::class) |
||
38 | ); |
||
39 | } |
||
40 | |||
41 | return $factory->create(); |
||
42 | }); |
||
45 |