@@ -35,7 +35,7 @@ |
||
| 35 | 35 | */ |
| 36 | 36 | public function doRun(InputInterface $input, OutputInterface $output) |
| 37 | 37 | { |
| 38 | - if (! $output->isQuiet()) { |
|
| 38 | + if (!$output->isQuiet()) { |
|
| 39 | 39 | $output->writeln(sprintf( |
| 40 | 40 | "phpunitgen %s by Paul Thébaud.\n\n", |
| 41 | 41 | $this->getVersion() |
@@ -30,7 +30,7 @@ |
||
| 30 | 30 | */ |
| 31 | 31 | public function invokeOneFile(string $configPath, string $sourceFile, string $targetFile): ConsoleConfigInterface |
| 32 | 32 | { |
| 33 | - if (! file_exists($sourceFile)) { |
|
| 33 | + if (!file_exists($sourceFile)) { |
|
| 34 | 34 | throw new InvalidConfigException(sprintf('The source file "%s" does not exists.', $sourceFile)); |
| 35 | 35 | } |
| 36 | 36 | |
@@ -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('Unable to parse PHP config'); |
| 26 | 26 | } |
| 27 | 27 | return $configArray; |
@@ -28,7 +28,7 @@ |
||
| 28 | 28 | protected function decode(string $configPath): array |
| 29 | 29 | { |
| 30 | 30 | $configArray = json_decode(file_get_contents($configPath), true); |
| 31 | - if (! Validator::arrayType()->validate($configArray)) { |
|
| 31 | + if (!Validator::arrayType()->validate($configArray)) { |
|
| 32 | 32 | throw new InvalidConfigException('Unable to parse JSON config'); |
| 33 | 33 | } |
| 34 | 34 | return $configArray; |
@@ -54,12 +54,12 @@ |
||
| 54 | 54 | $sourceFile = $input->getArgument('source-file-path'); |
| 55 | 55 | $targetFile = $input->getArgument('target-file-path'); |
| 56 | 56 | |
| 57 | - if (! file_exists($configPath)) { |
|
| 57 | + if (!file_exists($configPath)) { |
|
| 58 | 58 | throw new InvalidConfigException(sprintf('Config file "%s" does not exists.', $configPath)); |
| 59 | 59 | } |
| 60 | 60 | |
| 61 | 61 | $extension = pathinfo($configPath, PATHINFO_EXTENSION); |
| 62 | - if (! Validator::key($extension)->validate(static::CONSOLE_CONFIG_FACTORIES)) { |
|
| 62 | + if (!Validator::key($extension)->validate(static::CONSOLE_CONFIG_FACTORIES)) { |
|
| 63 | 63 | throw new InvalidConfigException( |
| 64 | 64 | sprintf('Config file "%s" must have .yml, .json or .php extension.', $configPath) |
| 65 | 65 | ); |
@@ -69,7 +69,7 @@ |
||
| 69 | 69 | $this->output->section(sprintf('Directory "%s" parsing begins.', $sourcePath)); |
| 70 | 70 | |
| 71 | 71 | // Check if source directory exists |
| 72 | - if (! $this->fileSystem->has($sourcePath) || ! $this->fileSystem->getMimetype($sourcePath) === 'directory') { |
|
| 72 | + if (!$this->fileSystem->has($sourcePath) || !$this->fileSystem->getMimetype($sourcePath) === 'directory') { |
|
| 73 | 73 | throw new ExecutorException(sprintf('The source directory "%s" does not exist.', $sourcePath)); |
| 74 | 74 | } |
| 75 | 75 | |
@@ -47,7 +47,7 @@ |
||
| 47 | 47 | */ |
| 48 | 48 | public function validate(string $path): bool |
| 49 | 49 | { |
| 50 | - if (! $this->validatePath($path)) { |
|
| 50 | + if (!$this->validatePath($path)) { |
|
| 51 | 51 | return false; |
| 52 | 52 | } |
| 53 | 53 | |
@@ -75,7 +75,7 @@ discard block |
||
| 75 | 75 | */ |
| 76 | 76 | public function invoke(string $sourcePath, string $targetPath): void |
| 77 | 77 | { |
| 78 | - if (! $this->fileValidator->validate($sourcePath)) { |
|
| 78 | + if (!$this->fileValidator->validate($sourcePath)) { |
|
| 79 | 79 | return; |
| 80 | 80 | } |
| 81 | 81 | |
@@ -107,7 +107,7 @@ discard block |
||
| 107 | 107 | { |
| 108 | 108 | $targetPathExists = $this->fileSystem->has($targetPath); |
| 109 | 109 | |
| 110 | - if ($targetPathExists && ! $this->config->hasOverwrite()) { |
|
| 110 | + if ($targetPathExists && !$this->config->hasOverwrite()) { |
|
| 111 | 111 | throw new ExecutorException(sprintf('The target file "%s" already exists.', $targetPath)); |
| 112 | 112 | } |
| 113 | 113 | |
@@ -50,15 +50,15 @@ discard block |
||
| 50 | 50 | protected function validate($config): void |
| 51 | 51 | { |
| 52 | 52 | // Check that $config is an array |
| 53 | - if (! Validator::arrayType()->validate($config)) { |
|
| 53 | + if (!Validator::arrayType()->validate($config)) { |
|
| 54 | 54 | throw new InvalidConfigException('The config must be an array.'); |
| 55 | 55 | } |
| 56 | 56 | |
| 57 | 57 | // Check boolean parameters |
| 58 | - if (! Validator::key('interface', Validator::boolType())->validate($config)) { |
|
| 58 | + if (!Validator::key('interface', Validator::boolType())->validate($config)) { |
|
| 59 | 59 | throw new InvalidConfigException('"interface" parameter must be set as a boolean.'); |
| 60 | 60 | } |
| 61 | - if (! Validator::key('auto', Validator::boolType())->validate($config)) { |
|
| 61 | + if (!Validator::key('auto', Validator::boolType())->validate($config)) { |
|
| 62 | 62 | throw new InvalidConfigException('"auto" parameter must be set as a boolean.'); |
| 63 | 63 | } |
| 64 | 64 | |
@@ -75,7 +75,7 @@ discard block |
||
| 75 | 75 | private function validatePhpdoc($config): void |
| 76 | 76 | { |
| 77 | 77 | // Check that dirs key exists |
| 78 | - if (! Validator::key('phpdoc', Validator::arrayType())->validate($config)) { |
|
| 78 | + if (!Validator::key('phpdoc', Validator::arrayType())->validate($config)) { |
|
| 79 | 79 | throw new InvalidConfigException('"phpdoc" parameter is not an array.'); |
| 80 | 80 | } |
| 81 | 81 | } |