@@ -52,15 +52,15 @@ discard block |
||
52 | 52 | protected function validate($config): void |
53 | 53 | { |
54 | 54 | // Check that $config is an array |
55 | - if (! Validator::arrayType()->validate($config)) { |
|
55 | + if (!Validator::arrayType()->validate($config)) { |
|
56 | 56 | throw new InvalidConfigException('The config must be an array.'); |
57 | 57 | } |
58 | 58 | |
59 | 59 | // Check boolean parameters |
60 | - if (! Validator::key('interface', Validator::boolType())->validate($config)) { |
|
60 | + if (!Validator::key('interface', Validator::boolType())->validate($config)) { |
|
61 | 61 | throw new InvalidConfigException('"interface" parameter must be set as a boolean.'); |
62 | 62 | } |
63 | - if (! Validator::key('auto', Validator::boolType())->validate($config)) { |
|
63 | + if (!Validator::key('auto', Validator::boolType())->validate($config)) { |
|
64 | 64 | throw new InvalidConfigException('"auto" parameter must be set as a boolean.'); |
65 | 65 | } |
66 | 66 | |
@@ -77,11 +77,11 @@ discard block |
||
77 | 77 | private function validatePhpdoc($config): void |
78 | 78 | { |
79 | 79 | // Check that dirs key exists |
80 | - if (! Validator::key('phpdoc', Validator::arrayType())->validate($config)) { |
|
80 | + if (!Validator::key('phpdoc', Validator::arrayType())->validate($config)) { |
|
81 | 81 | throw new InvalidConfigException('"phpdoc" parameter is not an array.'); |
82 | 82 | } |
83 | 83 | // Validate each phpdoc |
84 | - if (! Validator::arrayVal() |
|
84 | + if (!Validator::arrayVal() |
|
85 | 85 | ->each(Validator::stringType(), Validator::stringType())->validate($config['phpdoc']) |
86 | 86 | ) { |
87 | 87 | throw new InvalidConfigException('Some annotation in "phpdoc" parameter are not strings.'); |
@@ -21,7 +21,7 @@ |
||
21 | 21 | protected function decode(string $configPath): array |
22 | 22 | { |
23 | 23 | $configArray = require $configPath; |
24 | - if (! is_array($configArray)) { |
|
24 | + if (!is_array($configArray)) { |
|
25 | 25 | throw new InvalidConfigException('Invalid PHP config'); |
26 | 26 | } |
27 | 27 | return $configArray; |
@@ -26,7 +26,7 @@ |
||
26 | 26 | */ |
27 | 27 | public static function decode($string) |
28 | 28 | { |
29 | - if (! is_string($string)) { |
|
29 | + if (!is_string($string)) { |
|
30 | 30 | throw new JsonException('Json decode parameter must be a string'); |
31 | 31 | } |
32 | 32 |
@@ -28,7 +28,7 @@ |
||
28 | 28 | } catch (JsonException $exception) { |
29 | 29 | throw new InvalidConfigException('Unable to parse JSON config'); |
30 | 30 | } |
31 | - if (! is_array($configArray)) { |
|
31 | + if (!is_array($configArray)) { |
|
32 | 32 | throw new InvalidConfigException('Invalid JSON config'); |
33 | 33 | } |
34 | 34 | return $configArray; |
@@ -45,7 +45,7 @@ |
||
45 | 45 | */ |
46 | 46 | public function doRun(InputInterface $input, OutputInterface $output): int |
47 | 47 | { |
48 | - if (! $output->isQuiet()) { |
|
48 | + if (!$output->isQuiet()) { |
|
49 | 49 | $output->writeln(sprintf( |
50 | 50 | "PhpUnitGen by Paul Thébaud (version <info>%s</info>).\n", |
51 | 51 | $this->getVersion() |
@@ -184,12 +184,12 @@ discard block |
||
184 | 184 | */ |
185 | 185 | protected function getConfigurationFactory(string $path): AbstractConsoleConfigFactory |
186 | 186 | { |
187 | - if (! file_exists($path)) { |
|
187 | + if (!file_exists($path)) { |
|
188 | 188 | throw new InvalidConfigException(sprintf('Config file "%s" does not exists', $path)); |
189 | 189 | } |
190 | 190 | |
191 | 191 | $extension = pathinfo($path, PATHINFO_EXTENSION); |
192 | - if (! Validator::key($extension)->validate(static::CONSOLE_CONFIG_FACTORIES)) { |
|
192 | + if (!Validator::key($extension)->validate(static::CONSOLE_CONFIG_FACTORIES)) { |
|
193 | 193 | throw new InvalidConfigException( |
194 | 194 | sprintf('Config file "%s" must have .yml, .json or .php extension', $path) |
195 | 195 | ); |
@@ -209,10 +209,10 @@ discard block |
||
209 | 209 | */ |
210 | 210 | protected function validatePathsExist(InputInterface $input): void |
211 | 211 | { |
212 | - if (! is_string($input->getArgument('source'))) { |
|
212 | + if (!is_string($input->getArgument('source'))) { |
|
213 | 213 | throw new Exception('Missing the source path'); |
214 | 214 | } |
215 | - if (! is_string($input->getArgument('target'))) { |
|
215 | + if (!is_string($input->getArgument('target'))) { |
|
216 | 216 | throw new Exception('Missing the target path'); |
217 | 217 | } |
218 | 218 | } |
@@ -68,7 +68,7 @@ discard block |
||
68 | 68 | */ |
69 | 69 | public function get($id): object |
70 | 70 | { |
71 | - if (! Validator::stringType()->validate($id)) { |
|
71 | + if (!Validator::stringType()->validate($id)) { |
|
72 | 72 | throw new ContainerException('Identifier is not a string'); |
73 | 73 | } |
74 | 74 | return $this->resolveInstance($id); |
@@ -125,7 +125,7 @@ discard block |
||
125 | 125 | throw new ContainerException(sprintf('Class "%s" does not exists', $class)); |
126 | 126 | } |
127 | 127 | |
128 | - if (! $reflection->isInstantiable()) { |
|
128 | + if (!$reflection->isInstantiable()) { |
|
129 | 129 | throw new ContainerException(sprintf('Class "%s" is not instantiable', $class)); |
130 | 130 | } |
131 | 131 | return $this->buildInstance($reflection); |
@@ -43,7 +43,7 @@ |
||
43 | 43 | } catch (JsonException $exception) { |
44 | 44 | throw new AnnotationParseException('"params" annotation content is invalid (invalid JSON content)'); |
45 | 45 | } |
46 | - if (! Validator::arrayVal()->each(Validator::stringType(), Validator::intType())->validate($decoded)) { |
|
46 | + if (!Validator::arrayVal()->each(Validator::stringType(), Validator::intType())->validate($decoded)) { |
|
47 | 47 | throw new AnnotationParseException('"params" annotation content is invalid (must contains strings only)'); |
48 | 48 | } |
49 | 49 | $this->parameters = $decoded; |
@@ -43,7 +43,7 @@ |
||
43 | 43 | } catch (JsonException $exception) { |
44 | 44 | throw new AnnotationParseException('"assertion" annotation content is invalid (invalid JSON content)'); |
45 | 45 | } |
46 | - if (! is_string($decoded)) { |
|
46 | + if (!is_string($decoded)) { |
|
47 | 47 | throw new AnnotationParseException( |
48 | 48 | '"assertion" annotation content is invalid (expected value must be a string)' |
49 | 49 | ); |