Completed
Push — master ( 74d8c1...00f6f4 )
by Westin
08:22
created

PredisCacheFactory::__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\Predis;
7
8 View Code Duplication
class PredisCacheFactory extends ContainerAwareCacheAbstract
0 ignored issues
show
Duplication introduced by Westin Shafer
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 Predis($service, $key, $ttl);
18
    }
19
}
20