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