CacheFactory::get()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 1
Metric Value
eloc 1
c 1
b 0
f 1
dl 0
loc 3
ccs 2
cts 2
cp 1
rs 10
cc 1
nc 1
nop 0
crap 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