PhpFilesFactory   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 14
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
eloc 6
dl 0
loc 14
ccs 8
cts 8
cp 1
rs 10
c 0
b 0
f 0
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A type() 0 3 1
A create() 0 6 1
1
<?php
2
3
declare(strict_types=1);
4
5
/*
6
 *  This file is part of the Micro framework package.
7
 *
8
 *  (c) Stanislau Komar <[email protected]>
9
 *
10
 *  For the full copyright and license information, please view the LICENSE
11
 *  file that was distributed with this source code.
12
 */
13
14
namespace Micro\Plugin\Cache\Business\Adapter\Concrete;
15
16
use Micro\Plugin\Cache\Business\Adapter\ConcreteAdapterFactoryInterface;
17
use Micro\Plugin\Cache\Configuration\Adapter\CachePoolConfigurationInterface;
18
use Psr\Cache\CacheItemPoolInterface;
19
use Symfony\Component\Cache\Adapter\PhpFilesAdapter;
20
21
class PhpFilesFactory implements ConcreteAdapterFactoryInterface
22
{
23 1
    public function create(CachePoolConfigurationInterface $configuration): CacheItemPoolInterface
24
    {
25 1
        return new PhpFilesAdapter(
26 1
            $configuration->getNamespace(),
27 1
            $configuration->getDefaultLifetime(),
28 1
            $configuration->getDirectory(),
29 1
        );
30
    }
31
32 1
    public function type(): string
33
    {
34 1
        return 'php_files';
35
    }
36
}
37