Config::getAdapter()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 0
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
}