AssetManager\Service\AssetCacheManager::getProvider PHP Method

getProvider() private method

Get the cache provider. First checks to see if the provider is callable, then will attempt to get it from the service locator, finally will fallback to a class mapper.
private getProvider ( $path ) : array
$path
return array
    private function getProvider($path)
    {
        $cacheProvider = $this->getCacheProviderConfig($path);
        if (!$cacheProvider) {
            return null;
        }
        if (is_string($cacheProvider['cache']) && $this->serviceLocator->has($cacheProvider['cache'])) {
            return $this->serviceLocator->get($cacheProvider['cache']);
        }
        // Left here for BC.  Please consider defining a ZF2 service instead.
        if (is_callable($cacheProvider['cache'])) {
            return call_user_func($cacheProvider['cache'], $path);
        }
        $dir = '';
        $class = $cacheProvider['cache'];
        if (!empty($cacheProvider['options']['dir'])) {
            $dir = $cacheProvider['options']['dir'];
        }
        $class = $this->classMapper($class);
        return new $class($dir, $path);
    }