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

Psr6CacheFactory::setContainer()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 3
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 4
ccs 3
cts 3
cp 1
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 1
crap 1
1
<?php
2
declare(strict_types=1);
3
4
namespace WShafer\PSR11FlySystem\Cache;
5
6
use League\Flysystem\Cached\Storage\Psr6Cache;
7
8 View Code Duplication
class Psr6CacheFactory 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 2
        return new Psr6Cache($service, $key, $ttl);
18
    }
19
}
20