| Conditions | 2 |
| Paths | 2 |
| Total Lines | 14 |
| Code Lines | 7 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 8 |
| CRAP Score | 2 |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 14 | 2 | public function __invoke(ContainerInterface $container, array $options): FilesystemCachePool |
|
| 15 | { |
||
| 16 | 2 | $flySystemServiceName = (string)($options['flySystemService'] ?? ''); |
|
| 17 | 2 | $folder = (string)($options['folder'] ?? 'cache'); |
|
| 18 | |||
| 19 | 2 | $flySystem = $container->get($flySystemServiceName); |
|
| 20 | |||
| 21 | 2 | if (!$flySystem instanceof FilesystemInterface) { |
|
| 22 | 1 | throw new InvalidConfigException( |
|
| 23 | 1 | 'Service provided for the filesystem must be an instance of ' . FilesystemInterface::class |
|
| 24 | ); |
||
| 25 | } |
||
| 26 | |||
| 27 | 1 | return new FilesystemCachePool($flySystem, $folder); |
|
| 28 | } |
||
| 30 |