Conditions | 5 |
Paths | 9 |
Total Lines | 10 |
Code Lines | 6 |
Lines | 0 |
Ratio | 0 % |
Tests | 6 |
CRAP Score | 5.0729 |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
16 | 2 | public function apply_config($config, $required = []){ |
|
17 | 2 | foreach ($config as $key => $value){ |
|
18 | 2 | if(property_exists($this, $key)){ |
|
19 | 2 | $this->{$key} = $value; |
|
20 | } |
||
21 | } |
||
22 | |||
23 | 2 | foreach ($required as $conf){ |
|
24 | 2 | if(!isset($config[$conf])){ |
|
25 | throw new ConfigRequiredException($conf); |
||
26 | } |
||
29 | } |