Conditions | 2 |
Paths | 2 |
Total Lines | 14 |
Code Lines | 6 |
Lines | 0 |
Ratio | 0 % |
Tests | 0 |
CRAP Score | 6 |
Changes | 0 |
1 | <?php |
||
24 | public function __invoke(ContainerInterface $container) |
||
25 | { |
||
26 | /** @var ModuleOptions $options */ |
||
27 | $options = $container->get(ModuleOptions::class); |
||
28 | |||
29 | if (!$container->has($options->getCache())) { |
||
30 | throw new InvalidArgumentException('Images cache storage is not set.'); |
||
31 | } |
||
32 | |||
33 | /** @var StorageInterface $storage */ |
||
34 | $storage = $container->get($options->getCache()); |
||
35 | |||
36 | return new CacheManager($storage); |
||
37 | } |
||
38 | } |
||
39 |