Completed
Push — master ( eda3d5...e52893 )
by Westin
10:43
created

MemcachedCacheFactory::__invoke()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 9
Code Lines 6

Duplication

Lines 9
Ratio 100 %

Importance

Changes 0
Metric Value
dl 9
loc 9
rs 9.6666
c 0
b 0
f 0
cc 1
eloc 6
nc 1
nop 1
1
<?php
2
declare(strict_types=1);
3
4
namespace WShafer\PSR11FlySystem\Cache;
5
6
use League\Flysystem\Cached\Storage\Memcached;
7
8 View Code Duplication
class MemcachedCacheFactory extends ContainerAwareCacheAbstract
0 ignored issues
show
Duplication introduced by
This class seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
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