Conditions | 4 |
Paths | 5 |
Total Lines | 21 |
Code Lines | 10 |
Lines | 0 |
Ratio | 0 % |
Tests | 4 |
CRAP Score | 4.5923 |
Changes | 1 | ||
Bugs | 0 | Features | 1 |
1 | <?php |
||
32 | 4 | public function validateConfig(array $config): void |
|
33 | { |
||
34 | /* |
||
35 | * check required config |
||
36 | */ |
||
37 | foreach ([ |
||
38 | 4 | 'dirs_to_check', |
|
39 | 'show_empty_dir', |
||
40 | 'show_files_with_no_todos', |
||
41 | 'show_no_files_info', |
||
42 | ] as $key) { |
||
43 | 4 | if (!isset($config[$key])) { |
|
44 | 4 | throw new Exception('Field "'.$key.'" not set in config.'); |
|
45 | } |
||
46 | } |
||
47 | |||
48 | /* |
||
49 | * setting: dirs_to_check |
||
50 | */ |
||
51 | if (!\is_array($config['dirs_to_check'])) { |
||
52 | throw new Exception('Field "dirs_to_check" is not of type array.'); |
||
53 | } |
||
56 |