| Conditions | 4 |
| Paths | 1 |
| Total Lines | 15 |
| Code Lines | 11 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 0 |
| CRAP Score | 20 |
| Changes | 0 | ||
| 1 | <?php |
||
| 20 | public function register(ContainerInterface $app) |
||
| 21 | { |
||
| 22 | $app->closure(CacheInterface::class, function (Config $config, ContainerInterface $app) { |
||
| 23 | switch ($config->get('cache.type')) { |
||
| 24 | case 'apcu': |
||
| 25 | return new ApcuCache('wandu.'); |
||
| 26 | case 'memcached': |
||
| 27 | return new MemcachedCache($app->get(Memcached::class), 'wandu.'); |
||
| 28 | case 'redis': |
||
| 29 | return new RedisCache($app->get(Client::class), 'wandu.'); |
||
| 30 | default: |
||
| 31 | return new FilesystemCache('wandu.'); |
||
| 32 | } |
||
| 33 | }); |
||
| 34 | } |
||
| 35 | |||
| 43 |