@@ -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() |
@@ -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 | } |
@@ -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; |
@@ -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 | ); |