diff --git a/src/CacheFactory.php b/src/CacheFactory.php index 93dccb1..f7f1f2f 100644 --- a/src/CacheFactory.php +++ b/src/CacheFactory.php @@ -57,11 +57,10 @@ protected function createWithConfig(ContainerInterface $container, $configKey) break; case ChainCache::class: - $providers = array_map(function($provider) use ($container) { return $this->createWithConfig($container, $provider); }, - $config['providers'] ?? [] + is_array($config['providers']) ? $config['providers'] : [] ); $cache = new $config['class']($providers); break;