Conditions | 2 |
Paths | 2 |
Total Lines | 13 |
Lines | 0 |
Ratio | 0 % |
Tests | 7 |
CRAP Score | 2 |
Changes | 0 |
1 | <?php |
||
10 | 5 | public function getCache(\SimpleXMLElement $element) |
|
11 | { |
||
12 | $config = [ |
||
13 | 5 | 'adapter' => (string)$element->adapter, |
|
14 | 'options' => [] |
||
15 | ]; |
||
16 | 5 | if (isset($element->options)) { |
|
17 | 3 | $options = json_encode($element->options); |
|
18 | 3 | $config['options'] = json_decode($options, true); |
|
19 | } |
||
20 | 5 | $cache = StorageFactory::factory($config); |
|
21 | 5 | return $cache; |
|
22 | } |
||
23 | |||
25 |