@@ -39,13 +39,13 @@ discard block |
||
39 | 39 | private function validateBooleans($config): void |
40 | 40 | { |
41 | 41 | // Check boolean parameters |
42 | - if (! Validator::key('overwrite', Validator::boolType())->validate($config)) { |
|
42 | + if (!Validator::key('overwrite', Validator::boolType())->validate($config)) { |
|
43 | 43 | throw new InvalidConfigException('"overwrite" parameter must be set as a boolean.'); |
44 | 44 | } |
45 | - if (! Validator::key('auto', Validator::boolType())->validate($config)) { |
|
45 | + if (!Validator::key('auto', Validator::boolType())->validate($config)) { |
|
46 | 46 | throw new InvalidConfigException('"auto" parameter must be set as a boolean.'); |
47 | 47 | } |
48 | - if (! Validator::key('ignore', Validator::boolType())->validate($config)) { |
|
48 | + if (!Validator::key('ignore', Validator::boolType())->validate($config)) { |
|
49 | 49 | throw new InvalidConfigException('"ignore" parameter must be set as a boolean.'); |
50 | 50 | } |
51 | 51 | } |
@@ -60,10 +60,10 @@ discard block |
||
60 | 60 | private function validateStrings($config): void |
61 | 61 | { |
62 | 62 | // Check string parameters |
63 | - if (! Validator::key('include', Validator::stringType())->validate($config)) { |
|
63 | + if (!Validator::key('include', Validator::stringType())->validate($config)) { |
|
64 | 64 | throw new InvalidConfigException('"include" parameter must be set as a string.'); |
65 | 65 | } |
66 | - if (! Validator::key('exclude', Validator::stringType())->validate($config)) { |
|
66 | + if (!Validator::key('exclude', Validator::stringType())->validate($config)) { |
|
67 | 67 | throw new InvalidConfigException('"exclude" parameter must be set as a string.'); |
68 | 68 | } |
69 | 69 | } |
@@ -78,20 +78,20 @@ discard block |
||
78 | 78 | private function validateDirsAndFiles($config): void |
79 | 79 | { |
80 | 80 | // Check that dirs exists |
81 | - if (! Validator::key('dirs', Validator::arrayType())->validate($config)) { |
|
81 | + if (!Validator::key('dirs', Validator::arrayType())->validate($config)) { |
|
82 | 82 | throw new InvalidConfigException('"dirs" parameter is not an array.'); |
83 | 83 | } |
84 | - if (! Validator::key('files', Validator::arrayType())->validate($config)) { |
|
84 | + if (!Validator::key('files', Validator::arrayType())->validate($config)) { |
|
85 | 85 | throw new InvalidConfigException('"files" parameter is not an array.'); |
86 | 86 | } |
87 | 87 | // Validate each dirs |
88 | - if (! Validator::arrayVal() |
|
88 | + if (!Validator::arrayVal() |
|
89 | 89 | ->each(Validator::stringType(), Validator::stringType())->validate($config['dirs']) |
90 | 90 | ) { |
91 | 91 | throw new InvalidConfigException('Some directories in "dirs" parameter are not strings.'); |
92 | 92 | } |
93 | 93 | // Validate each dirs |
94 | - if (! Validator::arrayVal() |
|
94 | + if (!Validator::arrayVal() |
|
95 | 95 | ->each(Validator::stringType(), Validator::stringType())->validate($config['files']) |
96 | 96 | ) { |
97 | 97 | throw new InvalidConfigException('Some files in "files" parameter are not strings.'); |
@@ -143,7 +143,7 @@ discard block |
||
143 | 143 | */ |
144 | 144 | public function addDirectory(string $sourceDirectory, string $targetDirectory): void |
145 | 145 | { |
146 | - if (! Validator::arrayType()->validate($this->config['dirs'])) { |
|
146 | + if (!Validator::arrayType()->validate($this->config['dirs'])) { |
|
147 | 147 | $this->config['dirs'] = []; |
148 | 148 | } |
149 | 149 | $this->config['dirs'][$sourceDirectory] = $targetDirectory; |
@@ -162,7 +162,7 @@ discard block |
||
162 | 162 | */ |
163 | 163 | public function addFile(string $sourceFile, string $targetFile): void |
164 | 164 | { |
165 | - if (! Validator::arrayType()->validate($this->config['files'])) { |
|
165 | + if (!Validator::arrayType()->validate($this->config['files'])) { |
|
166 | 166 | $this->config['files'] = []; |
167 | 167 | } |
168 | 168 | $this->config['files'][$sourceFile] = $targetFile; |
@@ -52,7 +52,7 @@ |
||
52 | 52 | ) { |
53 | 53 | $this->phpParser = $phpParser; |
54 | 54 | |
55 | - $this->nodeParsers = [ |
|
55 | + $this->nodeParsers = [ |
|
56 | 56 | Node\Stmt\Namespace_::class => new NamespaceNodeParser(), |
57 | 57 | Node\Stmt\Use_::class => new UseNodeParser(), |
58 | 58 | Node\Stmt\Function_::class => null, |