protected function adapt(AdapterInterface $adapter, array $config): FilesystemContract
    {
        if (isset($config['cache']) && \is_array($config['cache'])) {
            $cacheFactory = new CachedFactory($this, $this->getCacheManager());

            $adapter = new CachedAdapter($adapter, $cacheFactory->getConnection($config));

            unset($config['cache']);
        }

        return new FilesystemAdapter($adapter, $config);
    }
protected function adapt(AdapterInterface $adapter, array $config): FilesystemContract
    {
        if (isset($config['cache']) && \is_array($config['cache'])) {
            $cacheFactory = new CachedFactory($this, $this->getCacheManager());

            $adapter = new CachedAdapter($adapter, $cacheFactory->getConnection($config));

            unset($config['cache']);
        }

        return new FilesystemAdapter($adapter, $config);
    }
protected function adapt ( AdapterInterface $ adapter , array $ config ) : FilesystemContract { if ( isset ( $ config [ 'cache' ] ) && \ is_array ( $ config [ 'cache' ] ) ) { $ cacheFactory = new CachedFactory ( $ this , $ this -> getCacheManager ( ) ) ; $ adapter = new CachedAdapter ( $ adapter , $ cacheFactory -> getConnection ( $ config ) ) ; unset ( $ config [ 'cache' ] ) ; } return new FilesystemAdapter ( $ adapter , $ config ) ; }
Adapt the filesystem implementation.

@param \League\Flysystem\AdapterInterface $adapter
@param array                              $config

@return \Viserio\Component\Contract\Filesystem\Filesystem
Adapt the filesystem implementation .