@@ -54,7 +54,7 @@ discard block |
||
54 | 54 | */ |
55 | 55 | public function get($id): object |
56 | 56 | { |
57 | - if (! is_string($id)) { |
|
57 | + if (!is_string($id)) { |
|
58 | 58 | throw new ContainerException('Given identifier to container is not a string.'); |
59 | 59 | } |
60 | 60 | if (isset($this->instances[$id])) { |
@@ -71,7 +71,7 @@ discard block |
||
71 | 71 | */ |
72 | 72 | public function has($id): bool |
73 | 73 | { |
74 | - if (! is_string($id)) { |
|
74 | + if (!is_string($id)) { |
|
75 | 75 | return false; |
76 | 76 | } |
77 | 77 | if (isset($this->instances[$id])) { |
@@ -33,11 +33,11 @@ |
||
33 | 33 | |
34 | 34 | $container->setInstance(Parser::class, (new ParserFactory())->create(ParserFactory::PREFER_PHP7)); |
35 | 35 | |
36 | - $container->setResolver(PhpFileParserInterface::class, function (ContainerInterface $container) { |
|
36 | + $container->setResolver(PhpFileParserInterface::class, function(ContainerInterface $container) { |
|
37 | 37 | return new PhpFileParser($container->get(Parser::class)); |
38 | 38 | }); |
39 | 39 | |
40 | - $container->setResolver(DirectoryParserInterface::class, function (ContainerInterface $container) { |
|
40 | + $container->setResolver(DirectoryParserInterface::class, function(ContainerInterface $container) { |
|
41 | 41 | return new DirectoryParser( |
42 | 42 | $container->get(ConfigInterface::class), |
43 | 43 | $container->get(FilesystemInterface::class), |
@@ -59,7 +59,7 @@ |
||
59 | 59 | */ |
60 | 60 | public function parse(string $sourceDirectory, string $targetDirectory): DirectoryModelInterface |
61 | 61 | { |
62 | - if (! $this->fileSystem->has($sourceDirectory) || ! $this->fileSystem->getMimetype($sourceDirectory) === 'directory') { |
|
62 | + if (!$this->fileSystem->has($sourceDirectory) || !$this->fileSystem->getMimetype($sourceDirectory) === 'directory') { |
|
63 | 63 | throw new ParsingException(sprintf('The source directory "%s" does not exist.', $sourceDirectory)); |
64 | 64 | } |
65 | 65 |
@@ -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. |
@@ -101,7 +101,7 @@ discard block |
||
101 | 101 | $sourceDirectory, |
102 | 102 | $exception->getMessage() |
103 | 103 | )); |
104 | - if (! $config->hasIgnore()) { |
|
104 | + if (!$config->hasIgnore()) { |
|
105 | 105 | exit; |
106 | 106 | } |
107 | 107 | } |
@@ -121,7 +121,7 @@ discard block |
||
121 | 121 | */ |
122 | 122 | public function getConfiguration(string $path): ConsoleConfigInterface |
123 | 123 | { |
124 | - if (! $this->fileSystem->has($path)) { |
|
124 | + if (!$this->fileSystem->has($path)) { |
|
125 | 125 | throw new InvalidConfigException(sprintf('Config file "%s" does not exists.', $path)); |
126 | 126 | } |
127 | 127 |
@@ -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() |
@@ -22,7 +22,7 @@ |
||
22 | 22 | { |
23 | 23 | $config = json_decode($config, true); |
24 | 24 | |
25 | - if (! is_array($config)) { |
|
25 | + if (!is_array($config)) { |
|
26 | 26 | throw new InvalidConfigException('Unable to parse JSON config'); |
27 | 27 | } |
28 | 28 |
@@ -23,32 +23,32 @@ |
||
23 | 23 | parent::validate($config); |
24 | 24 | |
25 | 25 | // Check boolean parameters |
26 | - if (! isset($config['overwrite']) || ! is_bool($config['overwrite'])) { |
|
26 | + if (!isset($config['overwrite']) || !is_bool($config['overwrite'])) { |
|
27 | 27 | throw new InvalidConfigException('"overwrite" parameter must be set as a boolean.'); |
28 | 28 | } |
29 | 29 | |
30 | - if (! isset($config['auto']) || ! is_bool($config['auto'])) { |
|
30 | + if (!isset($config['auto']) || !is_bool($config['auto'])) { |
|
31 | 31 | throw new InvalidConfigException('"auto" parameter must be set as a boolean.'); |
32 | 32 | } |
33 | - if (! isset($config['ignore']) || ! is_bool($config['ignore'])) { |
|
33 | + if (!isset($config['ignore']) || !is_bool($config['ignore'])) { |
|
34 | 34 | throw new InvalidConfigException('"ignore" parameter must be set as a boolean.'); |
35 | 35 | } |
36 | 36 | |
37 | 37 | // Check string parameters |
38 | - if (! isset($config['include']) || ! is_string($config['include'])) { |
|
38 | + if (!isset($config['include']) || !is_string($config['include'])) { |
|
39 | 39 | throw new InvalidConfigException('"include" parameter must be set as a string.'); |
40 | 40 | } |
41 | - if (! isset($config['exclude']) || ! is_string($config['exclude'])) { |
|
41 | + if (!isset($config['exclude']) || !is_string($config['exclude'])) { |
|
42 | 42 | throw new InvalidConfigException('"exclude" parameter must be set as a string.'); |
43 | 43 | } |
44 | 44 | |
45 | 45 | // Check that dirs exists |
46 | - if (! isset($config['dirs']) || ! is_array($config['dirs']) || count($config['dirs']) < 1) { |
|
46 | + if (!isset($config['dirs']) || !is_array($config['dirs']) || count($config['dirs']) < 1) { |
|
47 | 47 | throw new InvalidConfigException('"dirs" parameter is not an array or does not contains elements.'); |
48 | 48 | } |
49 | 49 | // Validate dirs |
50 | 50 | foreach ($config['dirs'] as $srcDir => $testsDir) { |
51 | - if (! is_string($srcDir) || ! is_string($testsDir)) { |
|
51 | + if (!is_string($srcDir) || !is_string($testsDir)) { |
|
52 | 52 | throw new InvalidConfigException('Some directories in "dirs" parameter are not strings.'); |
53 | 53 | } |
54 | 54 | } |
@@ -42,12 +42,12 @@ |
||
42 | 42 | protected function validate($config): void |
43 | 43 | { |
44 | 44 | // Check that $config is an array |
45 | - if (! is_array($config)) { |
|
45 | + if (!is_array($config)) { |
|
46 | 46 | throw new InvalidConfigException('The config must be an array.'); |
47 | 47 | } |
48 | 48 | |
49 | 49 | // Check boolean parameters |
50 | - if (! isset($config['interface']) || ! is_bool($config['interface'])) { |
|
50 | + if (!isset($config['interface']) || !is_bool($config['interface'])) { |
|
51 | 51 | throw new InvalidConfigException('"interface" parameter must be set as a boolean.'); |
52 | 52 | } |
53 | 53 | } |