CacheFactory   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 18
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 1
Metric Value
wmc 1
eloc 5
c 1
b 0
f 1
dl 0
loc 18
ccs 2
cts 2
cp 1
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A get() 0 3 1
1
<?php
2
3
/**
4
 * Linna Framework.
5
 *
6
 * @author Sebastian Rapetti <[email protected]>
7
 * @copyright (c) 2018, Sebastian Rapetti
8
 * @license http://opensource.org/licenses/MIT MIT License
9
 */
10
declare(strict_types=1);
11
12
namespace Linna\Cache;
13
14
use Linna\Storage\AbstractStorageFactory;
15
use Psr\SimpleCache\CacheInterface;
16
17
/**
18
 * Storage Factory.
19
 */
20
class CacheFactory extends AbstractStorageFactory
21
{
22
    /**
23
     * @var array<mixed> Factory supported driver
24
     */
25
    protected array $supportedDriver = [
26
        'disk'       => DiskCache::class,
27
        'memcached'  => MemcachedCache::class,
28
    ];
29
30
    /**
31
     * Return Cache Resource.
32
     *
33
     * @return CacheInterface
34
     */
35 3
    public function get(): CacheInterface
36
    {
37 3
        return $this->returnStorageObject();
38
    }
39
}
40