@@ -75,7 +75,7 @@ discard block |
||
75 | 75 | */ |
76 | 76 | public function invoke(string $sourcePath, string $targetPath, string $name = 'GeneratedTest'): bool |
77 | 77 | { |
78 | - if (! $this->fileValidator->validate($sourcePath)) { |
|
78 | + if (!$this->fileValidator->validate($sourcePath)) { |
|
79 | 79 | return false; |
80 | 80 | } |
81 | 81 | |
@@ -114,7 +114,7 @@ discard block |
||
114 | 114 | { |
115 | 115 | $targetPathExists = $this->fileSystem->has($targetPath); |
116 | 116 | |
117 | - if ($targetPathExists && ! $this->config->hasOverwrite()) { |
|
117 | + if ($targetPathExists && !$this->config->hasOverwrite()) { |
|
118 | 118 | throw new FileExistsException(sprintf('The target file "%s" already exists.', $targetPath)); |
119 | 119 | } |
120 | 120 |
@@ -88,7 +88,7 @@ |
||
88 | 88 | $this->output->section(sprintf('Directory "%s" parsing begins.', $sourcePath)); |
89 | 89 | |
90 | 90 | // Check if source directory exists |
91 | - if (! $this->fileSystem->has($sourcePath) || ! $this->fileSystem->getMimetype($sourcePath) === 'directory') { |
|
91 | + if (!$this->fileSystem->has($sourcePath) || !$this->fileSystem->getMimetype($sourcePath) === 'directory') { |
|
92 | 92 | throw new FileNotFoundException(sprintf('The source directory "%s" does not exist.', $sourcePath)); |
93 | 93 | } |
94 | 94 |
@@ -33,7 +33,7 @@ |
||
33 | 33 | */ |
34 | 34 | public function parse(Node $node, NodeInterface $parent): NodeInterface |
35 | 35 | { |
36 | - if (! method_exists($this, 'invoke')) { |
|
36 | + if (!method_exists($this, 'invoke')) { |
|
37 | 37 | throw new ParseException(sprintf( |
38 | 38 | 'Class "%s" must implements method "invoke" described in AbstractNodeParser', |
39 | 39 | get_class($this) |
@@ -66,7 +66,7 @@ discard block |
||
66 | 66 | */ |
67 | 67 | public function get($id): object |
68 | 68 | { |
69 | - if (! Validator::stringType()->validate($id)) { |
|
69 | + if (!Validator::stringType()->validate($id)) { |
|
70 | 70 | throw new ContainerException('Identifier is not a string.'); |
71 | 71 | } |
72 | 72 | return $this->resolveInstance($id); |
@@ -132,13 +132,13 @@ discard block |
||
132 | 132 | */ |
133 | 133 | private function autoResolve(string $class): object |
134 | 134 | { |
135 | - if (! class_exists($class)) { |
|
135 | + if (!class_exists($class)) { |
|
136 | 136 | throw new ContainerException(sprintf('Class "%s" does not exists.', $class)); |
137 | 137 | } |
138 | 138 | |
139 | 139 | $reflection = new \ReflectionClass($class); |
140 | 140 | |
141 | - if (! $reflection->isInstantiable()) { |
|
141 | + if (!$reflection->isInstantiable()) { |
|
142 | 142 | throw new ContainerException(sprintf('Class "%s" is not instantiable.', $class)); |
143 | 143 | } |
144 | 144 | return $this->buildInstance($reflection); |
@@ -158,7 +158,7 @@ discard block |
||
158 | 158 | if (($constructor = $reflection->getConstructor()) === null) { |
159 | 159 | return $reflection->newInstance(); |
160 | 160 | } |
161 | - if (! $constructor->isPublic()) { |
|
161 | + if (!$constructor->isPublic()) { |
|
162 | 162 | throw new ContainerException( |
163 | 163 | sprintf('Class "%s" has no public constructor.', $reflection->getName()) |
164 | 164 | ); |
@@ -46,11 +46,11 @@ discard block |
||
46 | 46 | */ |
47 | 47 | public function validate(string $path): bool |
48 | 48 | { |
49 | - if (! $this->validatePath($path)) { |
|
49 | + if (!$this->validatePath($path)) { |
|
50 | 50 | return false; |
51 | 51 | } |
52 | - if (! $this->validateIncludeRegex($path) |
|
53 | - || ! $this->validateExcludeRegex($path) |
|
52 | + if (!$this->validateIncludeRegex($path) |
|
53 | + || !$this->validateExcludeRegex($path) |
|
54 | 54 | ) { |
55 | 55 | return false; |
56 | 56 | } |
@@ -69,7 +69,7 @@ discard block |
||
69 | 69 | */ |
70 | 70 | private function validatePath(string $path): bool |
71 | 71 | { |
72 | - if (! $this->fileSystem->has($path)) { |
|
72 | + if (!$this->fileSystem->has($path)) { |
|
73 | 73 | throw new FileNotFoundException(sprintf('The source file "%s" does not exist.', $path)); |
74 | 74 | } |
75 | 75 | if ($this->fileSystem->get($path)->getType() === 'dir') { |
@@ -45,7 +45,7 @@ |
||
45 | 45 | /** |
46 | 46 | * {@inheritdoc} |
47 | 47 | */ |
48 | - public function catch(Exception $exception, string $path): void |
|
48 | + public function catch (Exception $exception, string $path): void |
|
49 | 49 | { |
50 | 50 | if ($this->config->hasIgnore() |
51 | 51 | && $exception instanceof IgnorableException |
@@ -57,7 +57,7 @@ |
||
57 | 57 | public function countNotAbstractFunctions(): int |
58 | 58 | { |
59 | 59 | return $this->functions->filter(function (FunctionModelInterface $function) { |
60 | - return ! $function->isAbstract(); |
|
60 | + return !$function->isAbstract(); |
|
61 | 61 | })->count(); |
62 | 62 | } |
63 | 63 | } |
@@ -269,7 +269,7 @@ discard block |
||
269 | 269 | // It is a string opening. |
270 | 270 | $this->openedStringToken = $type; |
271 | 271 | } else { |
272 | - if (! $this->currentlyEscaping && $type === $this->openedStringToken) { |
|
272 | + if (!$this->currentlyEscaping && $type === $this->openedStringToken) { |
|
273 | 273 | // We are in a string, the token is not escaped and is the same as the string opening token. |
274 | 274 | // Close the string. |
275 | 275 | $this->openedStringToken = null; |
@@ -286,7 +286,7 @@ discard block |
||
286 | 286 | private function afterConsume(int $type): void |
287 | 287 | { |
288 | 288 | // Put in escaping mode if it were not escaping and there is a backslash token. |
289 | - if (! $this->currentlyEscaping && $type === Lexer::T_BACKSLASH) { |
|
289 | + if (!$this->currentlyEscaping && $type === Lexer::T_BACKSLASH) { |
|
290 | 290 | $this->currentlyEscaping = true; |
291 | 291 | } else { |
292 | 292 | $this->currentlyEscaping = false; |
@@ -26,7 +26,7 @@ |
||
26 | 26 | */ |
27 | 27 | public static function decode($string): array |
28 | 28 | { |
29 | - if (! is_string($string)) { |
|
29 | + if (!is_string($string)) { |
|
30 | 30 | throw new JsonException('Json decode parameter must be a string'); |
31 | 31 | } |
32 | 32 |