public static function getCacheProvider($type, $configuration, $namespace = null, $providers = [])
{
$providers = array_merge(static::$supportedProviders, $providers);
if (!array_key_exists($type, $providers)) {
throw new \RuntimeException('Unsupported Doctrine cache provider specified: ' . $type . '. Check your configuration.');
}
if (class_exists($providers[$type])) {
$cache = $providers[$type]::getCacheProvider($configuration);
} else {
throw new ClassNotFoundException('Class not found [' . $providers[$type] . ']', new \ErrorException());
}
$cache->setNamespace($namespace);
return $cache;
}