Conditions | 4 |
Paths | 4 |
Total Lines | 15 |
Code Lines | 8 |
Lines | 0 |
Ratio | 0 % |
Tests | 8 |
CRAP Score | 4 |
Changes | 0 |
1 | <?php |
||
22 | 2 | public function config($config): void |
|
23 | { |
||
24 | 2 | $expected = ['environment', 'template_dir', 'cache_dir']; |
|
25 | |||
26 | 2 | foreach ($expected as $exp) { |
|
27 | 2 | if (count($config) == 3) { |
|
28 | 2 | if (!array_key_exists($exp, $config)) { |
|
29 | 2 | throw new Exception("The $exp configuration is expected"); |
|
30 | } |
||
31 | } else { |
||
32 | 2 | throw new Exception("The configuration expected only tree arguments"); |
|
33 | } |
||
34 | } |
||
35 | |||
36 | 2 | Tag::setConfig($config); |
|
37 | 2 | } |
|
112 |