Code Duplication    Length = 12-12 lines in 3 locations

src/Cache/PredisCacheFactory.php 1 location

@@ 8-19 (lines=12) @@
5
6
use League\Flysystem\Cached\Storage\Predis;
7
8
class PredisCacheFactory extends ContainerAwareCacheAbstract
9
{
10
    public function __invoke(array $options)
11
    {
12
        $serviceName = $options['service'] ?? null;
13
        $key = $options['key'] ?? 'flysystem';
14
        $ttl = $options['ttl'] ?? null;
15
16
        $service = $this->getService($serviceName);
17
        return new Predis($service, $key, $ttl);
18
    }
19
}
20

src/Cache/Psr6CacheFactory.php 1 location

@@ 8-19 (lines=12) @@
5
6
use League\Flysystem\Cached\Storage\Psr6Cache;
7
8
class Psr6CacheFactory extends ContainerAwareCacheAbstract
9
{
10
    public function __invoke(array $options)
11
    {
12
        $serviceName = $options['service'] ?? null;
13
        $key = $options['key'] ?? 'flysystem';
14
        $ttl = $options['ttl'] ?? null;
15
16
        $service = $this->getService($serviceName);
17
        return new Psr6Cache($service, $key, $ttl);
18
    }
19
}
20

src/Cache/MemcachedCacheFactory.php 1 location

@@ 8-19 (lines=12) @@
5
6
use League\Flysystem\Cached\Storage\Memcached;
7
8
class MemcachedCacheFactory extends ContainerAwareCacheAbstract
9
{
10
    public function __invoke(array $options)
11
    {
12
        $serviceName = $options['service'] ?? null;
13
        $key = $options['key'] ?? 'flysystem';
14
        $ttl = $options['ttl'] ?? null;
15
16
        $service = $this->getService($serviceName);
17
        return new Memcached($service, $key, $ttl);
18
    }
19
}
20