Config   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 26
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A getAdapter() 0 4 1
A getAdapterOptions() 0 4 1
1
<?php
2
3
namespace Spiral\PhpFastCache;
4
5
use Spiral\Core\InjectableConfig;
6
7
class Config extends InjectableConfig
8
{
9
    const CONFIG = 'modules/spiralPhpFastCache';
10
11
    /** @var array */
12
    protected $config = [
13
        'adapter'  => '',
14
        'adapters' => []
15
    ];
16
17
    /**
18
     * @return string
19
     */
20
    public function getAdapter(): string
21
    {
22
        return $this->config['adapter'];
23
    }
24
25
    /**
26
     * @return array
27
     */
28
    public function getAdapterOptions(): array
29
    {
30
        return $this->config['adapters'][$this->getAdapter()];
31
    }
32
}