Conditions | 5 |
Paths | 4 |
Total Lines | 18 |
Code Lines | 10 |
Lines | 0 |
Ratio | 0 % |
Tests | 10 |
CRAP Score | 5.0187 |
Changes | 0 |
1 | <?php |
||
27 | 6 | public function __construct(array $config) |
|
28 | { |
||
29 | 6 | if (!isset($config['adapter_name']) || !is_string($config['adapter_name'])) { |
|
30 | 1 | throw new InvalidCacheConfig('Invalid Adapter Name. Is Not A String OR Is Missing!'); |
|
31 | } |
||
32 | 5 | $this->adapterName = $config['adapter_name']; |
|
33 | |||
34 | 5 | unset($config['adapter_name']); |
|
35 | 5 | $this->settings = $config; |
|
36 | |||
37 | 5 | if (isset($config['adapter_namespace'])) { |
|
38 | 1 | if (!is_string($config['adapter_namespace'])) { |
|
39 | 1 | throw new InvalidCacheConfig('Invalid Adapter Namespace. Is Not A String!'); |
|
40 | } |
||
41 | |||
42 | $this->adapterNamespace = $config['adapter_namespace']; |
||
43 | } |
||
44 | 4 | } |
|
45 | |||
70 |