protected function createConnector(array $config): CacheInterface
    {
        $cacheConfig = $config['cache'];

        if (($cache = $this->cacheManager) !== null) {
            if ($cache->hasDriver($cacheConfig['driver'])) {
                return new Psr6Cache(
                    $cache->getDriver($cacheConfig['driver']),
                    $cacheConfig['key'],
                    $cacheConfig['expire']
                );
            }
        }

        if ($this->manager->hasConnection($cacheConfig['driver'])) {
            return new Adapter(
                $this->manager->createConnection($config),
                $cacheConfig['key'],
                $cacheConfig['expire']
            );
        }

        throw new InvalidArgumentException(\sprintf('Unsupported driver [%s].', $cacheConfig['driver']));
    }
protected function createConnector(array $config): CacheInterface
    {
        $cacheConfig = $config['cache'];

        if (($cache = $this->cacheManager) !== null) {
            if ($cache->hasDriver($cacheConfig['driver'])) {
                return new Psr6Cache(
                    $cache->getDriver($cacheConfig['driver']),
                    $cacheConfig['key'],
                    $cacheConfig['expire']
                );
            }
        }

        if ($this->manager->hasConnection($cacheConfig['driver'])) {
            return new Adapter(
                $this->manager->createConnection($config),
                $cacheConfig['key'],
                $cacheConfig['expire']
            );
        }

        throw new InvalidArgumentException(\sprintf('Unsupported driver [%s].', $cacheConfig['driver']));
    }
protected function createConnector ( array $ config ) : CacheInterface { $ cacheConfig = $ config [ 'cache' ] ; if ( ( $ cache = $ this -> cacheManager ) !== null ) { if ( $ cache -> hasDriver ( $ cacheConfig [ 'driver' ] ) ) { return new Psr6Cache ( $ cache -> getDriver ( $ cacheConfig [ 'driver' ] ) , $ cacheConfig [ 'key' ] , $ cacheConfig [ 'expire' ] ) ; } } if ( $ this -> manager -> hasConnection ( $ cacheConfig [ 'driver' ] ) ) { return new Adapter ( $ this -> manager -> createConnection ( $ config ) , $ cacheConfig [ 'key' ] , $ cacheConfig [ 'expire' ] ) ; } throw new InvalidArgumentException ( \ sprintf ( 'Unsupported driver [%s].' , $ cacheConfig [ 'driver' ] ) ) ; }
Create a connector instance based on the configuration.

@param array $config

@throws \InvalidArgumentException

@return \League\Flysystem\Cached\CacheInterface
Create a connector instance based on the configuration .