| Conditions | 5 | 
| Paths | 3 | 
| Total Lines | 17 | 
| Code Lines | 9 | 
| Lines | 0 | 
| Ratio | 0 % | 
| Tests | 0 | 
| CRAP Score | 30 | 
| Changes | 0 | ||
| 1 | <?php | ||
| 33 | private function buildAdapter(array $config, ContainerInterface $container): Cache\CacheProvider | ||
| 34 |     { | ||
| 35 | $isDebug = (bool) ($config['debug'] ?? false); | ||
| 36 | $redisConfig = $config['cache']['redis'] ?? null; | ||
| 37 | $apcuEnabled = ($this->apcuEnabled)(); | ||
| 38 | |||
| 39 |         if ($isDebug || (! $apcuEnabled && $redisConfig === null)) { | ||
| 40 | return new Cache\ArrayCache(); | ||
| 41 | } | ||
| 42 | |||
| 43 |         if ($redisConfig === null) { | ||
| 44 | return new Cache\ApcuCache(); | ||
| 45 | } | ||
| 46 | |||
| 47 | /** @var PredisClient $predis */ | ||
| 48 | $predis = $container->get(RedisFactory::SERVICE_NAME); | ||
| 49 | return new Cache\PredisCache($predis); | ||
| 50 | } | ||
| 52 |