@@ -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() |
@@ -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; |
@@ -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 | ); |
@@ -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 | } |
@@ -41,12 +41,12 @@ |
||
41 | 41 | $configPath = $input->getArgument('config-path'); |
42 | 42 | } |
43 | 43 | |
44 | - if (! file_exists($configPath)) { |
|
44 | + if (!file_exists($configPath)) { |
|
45 | 45 | throw new InvalidConfigException(sprintf('Config file "%s" does not exists.', $configPath)); |
46 | 46 | } |
47 | 47 | |
48 | 48 | $extension = pathinfo($configPath, PATHINFO_EXTENSION); |
49 | - if (! Validator::key($extension)->validate(static::CONSOLE_CONFIG_FACTORIES)) { |
|
49 | + if (!Validator::key($extension)->validate(static::CONSOLE_CONFIG_FACTORIES)) { |
|
50 | 50 | throw new InvalidConfigException( |
51 | 51 | sprintf('Config file "%s" must have .yml, .json or .php extension.', $configPath) |
52 | 52 | ); |
@@ -23,5 +23,5 @@ |
||
23 | 23 | * |
24 | 24 | * @throws Exception If the configuration does not allow ignoring errors. |
25 | 25 | */ |
26 | - public function catch(Exception $exception, string $path): void; |
|
26 | + public function catch (Exception $exception, string $path): void; |
|
27 | 27 | } |
@@ -66,7 +66,7 @@ discard block |
||
66 | 66 | public function getFullNameFor(string $name): string |
67 | 67 | { |
68 | 68 | $namespace = $this->getNamespaceString(); |
69 | - return $namespace === null? $name : $namespace . '\\' . $name; |
|
69 | + return $namespace === null ? $name : $namespace . '\\' . $name; |
|
70 | 70 | } |
71 | 71 | |
72 | 72 | /** |
@@ -126,7 +126,7 @@ discard block |
||
126 | 126 | */ |
127 | 127 | public function getUse(string $name): string |
128 | 128 | { |
129 | - if (! $this->hasUse($name)) { |
|
129 | + if (!$this->hasUse($name)) { |
|
130 | 130 | throw new ParseException(sprintf( |
131 | 131 | 'Trying to get a full class name for "%s", but it does not exists', |
132 | 132 | $name |
@@ -41,9 +41,8 @@ discard block |
||
41 | 41 | */ |
42 | 42 | public function getNamespaceString(): ?string |
43 | 43 | { |
44 | - return Validator::notEmpty()->validate($this->namespace)? |
|
45 | - implode('\\', $this->namespace) : |
|
46 | - null; |
|
44 | + return Validator::notEmpty()->validate($this->namespace) ? |
|
45 | + implode('\\', $this->namespace) : null; |
|
47 | 46 | } |
48 | 47 | |
49 | 48 | /** |
@@ -51,8 +50,7 @@ discard block |
||
51 | 50 | */ |
52 | 51 | public function getNamespaceLast(): ?string |
53 | 52 | { |
54 | - return Validator::notEmpty()->validate($this->namespace)? |
|
55 | - $this->namespace[(count($this->namespace) - 1)] : |
|
56 | - null; |
|
53 | + return Validator::notEmpty()->validate($this->namespace) ? |
|
54 | + $this->namespace[(count($this->namespace) - 1)] : null; |
|
57 | 55 | } |
58 | 56 | } |
@@ -21,17 +21,17 @@ |
||
21 | 21 | /** |
22 | 22 | * @var int PUBLIC A public visibility. |
23 | 23 | */ |
24 | - public const PUBLIC = 1; |
|
24 | + public const PUBLIC = 1; |
|
25 | 25 | |
26 | 26 | /** |
27 | 27 | * @var int PUBLIC A protected visibility. |
28 | 28 | */ |
29 | - public const PROTECTED = 2; |
|
29 | + public const PROTECTED = 2; |
|
30 | 30 | |
31 | 31 | /** |
32 | 32 | * @var int PUBLIC A private visibility. |
33 | 33 | */ |
34 | - public const PRIVATE = 3; |
|
34 | + public const PRIVATE = 3; |
|
35 | 35 | |
36 | 36 | /** |
37 | 37 | * @param int|null $visibility The new visibility to set. |