@@ -91,7 +91,7 @@ discard block |
||
| 91 | 91 | */ |
| 92 | 92 | private function resolve($id): object |
| 93 | 93 | { |
| 94 | - if (! is_string($id)) { |
|
| 94 | + if (!is_string($id)) { |
|
| 95 | 95 | throw new ContainerException("Identifier is not a string."); |
| 96 | 96 | } |
| 97 | 97 | if (Validator::key($id)->validate($this->instances)) { |
@@ -117,13 +117,13 @@ discard block |
||
| 117 | 117 | */ |
| 118 | 118 | private function autoResolve(string $class): object |
| 119 | 119 | { |
| 120 | - if (! class_exists($class)) { |
|
| 120 | + if (!class_exists($class)) { |
|
| 121 | 121 | throw new ContainerException(sprintf("Class %s does not exists.", $class)); |
| 122 | 122 | } |
| 123 | 123 | |
| 124 | 124 | $reflection = new \ReflectionClass($class); |
| 125 | 125 | |
| 126 | - if (! $reflection->isInstantiable()) { |
|
| 126 | + if (!$reflection->isInstantiable()) { |
|
| 127 | 127 | throw new ContainerException(sprintf("Class %s is not instantiable.", $class)); |
| 128 | 128 | } |
| 129 | 129 | if (($constructor = $reflection->getConstructor()) === null) { |
@@ -50,12 +50,12 @@ |
||
| 50 | 50 | { |
| 51 | 51 | $configPath = $input->getArgument('config-path'); |
| 52 | 52 | |
| 53 | - if (! file_exists($configPath)) { |
|
| 53 | + if (!file_exists($configPath)) { |
|
| 54 | 54 | throw new InvalidConfigException(sprintf('Config file "%s" does not exists.', $configPath)); |
| 55 | 55 | } |
| 56 | 56 | |
| 57 | 57 | $extension = pathinfo($configPath, PATHINFO_EXTENSION); |
| 58 | - if (! Validator::key($extension)->validate(static::CONSOLE_CONFIG_FACTORIES)) { |
|
| 58 | + if (!Validator::key($extension)->validate(static::CONSOLE_CONFIG_FACTORIES)) { |
|
| 59 | 59 | throw new InvalidConfigException( |
| 60 | 60 | sprintf('Config file "%s" must have .yml, .json or .php extension.', $configPath) |
| 61 | 61 | ); |
@@ -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() |
@@ -105,7 +105,7 @@ |
||
| 105 | 105 | $sourceDirectory, |
| 106 | 106 | $exception->getMessage() |
| 107 | 107 | )); |
| 108 | - if (! $config->hasIgnore()) { |
|
| 108 | + if (!$config->hasIgnore()) { |
|
| 109 | 109 | return false; |
| 110 | 110 | } |
| 111 | 111 | } |
@@ -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 | } |
@@ -69,7 +69,7 @@ discard block |
||
| 69 | 69 | */ |
| 70 | 70 | public function parse(string $sourceDirectory, string $targetDirectory): DirectoryModelInterface |
| 71 | 71 | { |
| 72 | - if (! $this->fileSystem->has($sourceDirectory) || ! $this->fileSystem->getMimetype($sourceDirectory) === 'directory') { |
|
| 72 | + if (!$this->fileSystem->has($sourceDirectory) || !$this->fileSystem->getMimetype($sourceDirectory) === 'directory') { |
|
| 73 | 73 | throw new ParsingException(sprintf('The source directory "%s" does not exist.', $sourceDirectory)); |
| 74 | 74 | } |
| 75 | 75 | |
@@ -107,7 +107,7 @@ discard block |
||
| 107 | 107 | $this->output->writeln(sprintf('<comment>Parsing file "%s" completed.</comment>', $file['path'])); |
| 108 | 108 | } |
| 109 | 109 | } catch (ParsingException $exception) { |
| 110 | - if (! $this->config->hasIgnore()) { |
|
| 110 | + if (!$this->config->hasIgnore()) { |
|
| 111 | 111 | throw new ParsingException($exception->getMessage()); |
| 112 | 112 | } |
| 113 | 113 | $this->output->writeln(sprintf('<error>%s</error>', $exception->getMessage())); |
@@ -16,12 +16,12 @@ discard block |
||
| 16 | 16 | /** |
| 17 | 17 | * @var null UNKNOWN If the visibility is unknown. |
| 18 | 18 | */ |
| 19 | - const UNKNOWN = null; |
|
| 19 | + const UNKNOWN = null; |
|
| 20 | 20 | |
| 21 | 21 | /** |
| 22 | 22 | * @var int PUBLIC A public visibility. |
| 23 | 23 | */ |
| 24 | - const PUBLIC = 1; |
|
| 24 | + const PUBLIC = 1; |
|
| 25 | 25 | |
| 26 | 26 | /** |
| 27 | 27 | * @var int PUBLIC A protected visibility. |
@@ -31,7 +31,7 @@ discard block |
||
| 31 | 31 | /** |
| 32 | 32 | * @var int PUBLIC A private visibility. |
| 33 | 33 | */ |
| 34 | - const PRIVATE = 3; |
|
| 34 | + const PRIVATE = 3; |
|
| 35 | 35 | |
| 36 | 36 | /** |
| 37 | 37 | * @param int|null $visibility The new visibility to set. |
@@ -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; |