Conditions | 7 |
Paths | 6 |
Total Lines | 14 |
Code Lines | 7 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
25 | public function validate($configuration, $required) |
||
26 | { |
||
27 | // search for any null or empty field to throw an exception |
||
28 | $missing = ''; |
||
29 | foreach ($configuration as $key => $value) { |
||
30 | if (in_array($key, $required) && |
||
31 | (empty($value) || $value == null || $value == '') |
||
32 | ) { |
||
33 | $missing .= ' '.$key; |
||
34 | } |
||
35 | } |
||
36 | |||
37 | if ($missing) { |
||
38 | throw new MissingConfigurationException('Missed Configuration:'.$missing); |
||
39 | } |
||
42 |