CacheFactory   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 14
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Importance

Changes 0
Metric Value
wmc 1
lcom 0
cbo 2
dl 0
loc 14
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A __invoke() 0 6 1
1
<?php
2
/**
3
 * This File is Part of the Validus package.
4
 *
5
 * @copyright (c) 2018 Validus <https://github.com/ValidusPHP/>
6
 *
7
 * For the full copyright and license information, please view the LICENSE
8
 * file that was distributed with this source code.
9
 */
10
11
declare(strict_types=1);
12
13
namespace Validus\Cache\Simple;
14
15
use Psr\Cache\CacheItemPoolInterface;
16
use Psr\Container\ContainerInterface;
17
use Psr\SimpleCache\CacheInterface;
18
use Symfony\Component\Cache\Simple\Psr6Cache;
19
20
class CacheFactory
21
{
22
    /**
23
     * @param ContainerInterface $container
24
     *
25
     * @return CacheInterface
26
     */
27
    public function __invoke(ContainerInterface $container): CacheInterface
28
    {
29
        return new Psr6Cache(
30
            $container->get(CacheItemPoolInterface::class)
31
        );
32
    }
33
}
34