ApcuFactory::create()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 5
CRAP Score 1

Importance

Changes 0
Metric Value
cc 1
eloc 4
nc 1
nop 1
dl 0
loc 6
ccs 5
cts 5
cp 1
crap 1
rs 10
c 0
b 0
f 0
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\ApcuAdapter;
20
21
class ApcuFactory implements ConcreteAdapterFactoryInterface
22
{
23 1
    public function create(CachePoolConfigurationInterface $configuration): CacheItemPoolInterface
24
    {
25 1
        return new ApcuAdapter(
26 1
            $configuration->getNamespace(),
27 1
            $configuration->getDefaultLifetime(),
28 1
            $configuration->getVersion(),
29 1
        );
30
    }
31
32 4
    public function type(): string
33
    {
34 4
        return 'apcu';
35
    }
36
}
37