@@ -24,31 +24,31 @@ |
||
24 | 24 | parent::validate($config); |
25 | 25 | |
26 | 26 | // Check boolean parameters |
27 | - if (! Validator::key('overwrite', Validator::boolType())->validate($config)) { |
|
27 | + if (!Validator::key('overwrite', Validator::boolType())->validate($config)) { |
|
28 | 28 | throw new InvalidConfigException('"overwrite" parameter must be set as a boolean.'); |
29 | 29 | } |
30 | 30 | |
31 | - if (! Validator::key('auto', Validator::boolType())->validate($config)) { |
|
31 | + if (!Validator::key('auto', Validator::boolType())->validate($config)) { |
|
32 | 32 | throw new InvalidConfigException('"auto" parameter must be set as a boolean.'); |
33 | 33 | } |
34 | - if (! Validator::key('ignore', Validator::boolType())->validate($config)) { |
|
34 | + if (!Validator::key('ignore', Validator::boolType())->validate($config)) { |
|
35 | 35 | throw new InvalidConfigException('"ignore" parameter must be set as a boolean.'); |
36 | 36 | } |
37 | 37 | |
38 | 38 | // Check string parameters |
39 | - if (! Validator::key('include', Validator::stringType())->validate($config)) { |
|
39 | + if (!Validator::key('include', Validator::stringType())->validate($config)) { |
|
40 | 40 | throw new InvalidConfigException('"include" parameter must be set as a string.'); |
41 | 41 | } |
42 | - if (! Validator::key('exclude', Validator::stringType())->validate($config)) { |
|
42 | + if (!Validator::key('exclude', Validator::stringType())->validate($config)) { |
|
43 | 43 | throw new InvalidConfigException('"exclude" parameter must be set as a string.'); |
44 | 44 | } |
45 | 45 | |
46 | 46 | // Check that dirs exists |
47 | - if (! Validator::key('dirs', Validator::arrayType()->length(1, null))->validate($config)) { |
|
47 | + if (!Validator::key('dirs', Validator::arrayType()->length(1, null))->validate($config)) { |
|
48 | 48 | throw new InvalidConfigException('"dirs" parameter is not an array or does not contains elements.'); |
49 | 49 | } |
50 | 50 | // Validate each dirs |
51 | - if (! Validator::arrayVal() |
|
51 | + if (!Validator::arrayVal() |
|
52 | 52 | ->each(Validator::stringType(), Validator::stringType())->validate($config['dirs']) |
53 | 53 | ) { |
54 | 54 | throw new InvalidConfigException('Some directories in "dirs" parameter are not strings.'); |
@@ -43,12 +43,12 @@ |
||
43 | 43 | protected function validate($config): void |
44 | 44 | { |
45 | 45 | // Check that $config is an array |
46 | - if (! Validator::arrayType()->validate($config)) { |
|
46 | + if (!Validator::arrayType()->validate($config)) { |
|
47 | 47 | throw new InvalidConfigException('The config must be an array.'); |
48 | 48 | } |
49 | 49 | |
50 | 50 | // Check boolean parameters |
51 | - if (! Validator::key('interface', Validator::boolType())->validate($config)) { |
|
51 | + if (!Validator::key('interface', Validator::boolType())->validate($config)) { |
|
52 | 52 | throw new InvalidConfigException('"interface" parameter must be set as a boolean.'); |
53 | 53 | } |
54 | 54 | } |