We could not synchronize checks via GitHub's checks API since Scrutinizer's GitHub App is not installed for this repository.
@@ -299,14 +299,14 @@ discard block |
||
299 | 299 | $code = $this->processTemplatePlaceHoldersReplacements('ValidatorCode', $rules, self::DEFERRED_PLACEHOLDERS); |
300 | 300 | $code = \ltrim($this->prefixCodeWithSpaces($code, 2)); |
301 | 301 | |
302 | - return $code . "\n\n<spaces><spaces>"; |
|
302 | + return $code."\n\n<spaces><spaces>"; |
|
303 | 303 | } |
304 | 304 | |
305 | 305 | protected function generateClassValidation(array $config): string |
306 | 306 | { |
307 | 307 | $config = $config['class'] ?? $config['validation'] ?? null; |
308 | 308 | |
309 | - if(!$config) return 'null'; |
|
309 | + if (!$config) return 'null'; |
|
310 | 310 | |
311 | 311 | $code = $this->processTemplatePlaceHoldersReplacements('ValidationConfig', $config, self::DEFERRED_PLACEHOLDERS); |
312 | 312 | $code = \ltrim($this->prefixCodeWithSpaces($code, 2)); |
@@ -351,11 +351,11 @@ discard block |
||
351 | 351 | { |
352 | 352 | $constraints = $values['constraints'] ?? $values['validation']['constraints'] ?? null; |
353 | 353 | |
354 | - if(!is_array($constraints)) { |
|
354 | + if (!is_array($constraints)) { |
|
355 | 355 | return 'null'; |
356 | 356 | } |
357 | 357 | |
358 | - $this->addUseStatement(Assert::class . ' as Assert'); |
|
358 | + $this->addUseStatement(Assert::class.' as Assert'); |
|
359 | 359 | |
360 | 360 | $code = ''; |
361 | 361 | foreach ($constraints as $key => $constraint) { |
@@ -393,9 +393,9 @@ discard block |
||
393 | 393 | |
394 | 394 | // Security constraint |
395 | 395 | if ('UserPassword' === $name) { |
396 | - $FQCN = SecurityAssert::class . "\\$name"; |
|
396 | + $FQCN = SecurityAssert::class."\\$name"; |
|
397 | 397 | $prefix = 'SecurityAssert\\'; |
398 | - $this->addUseStatement(SecurityAssert::class . ' as SecurityAssert'); |
|
398 | + $this->addUseStatement(SecurityAssert::class.' as SecurityAssert'); |
|
399 | 399 | } |
400 | 400 | // Custom constraint |
401 | 401 | else if (false !== strpos($name, '\\')) { |
@@ -408,10 +408,10 @@ discard block |
||
408 | 408 | // Standart constraint |
409 | 409 | else { |
410 | 410 | $prefix = 'Assert\\'; |
411 | - $FQCN = Assert::class . "\\$name"; |
|
411 | + $FQCN = Assert::class."\\$name"; |
|
412 | 412 | } |
413 | 413 | |
414 | - if(!class_exists($FQCN)) { |
|
414 | + if (!class_exists($FQCN)) { |
|
415 | 415 | throw new RuntimeException("Constraint class '$FQCN' doesn't exist."); |
416 | 416 | } |
417 | 417 | |
@@ -555,7 +555,7 @@ discard block |
||
555 | 555 | ; |
556 | 556 | |
557 | 557 | if ($value !== end($array)) { |
558 | - $code .= ', '; |
|
558 | + $code .= ', '; |
|
559 | 559 | } |
560 | 560 | } |
561 | 561 | |
@@ -612,7 +612,7 @@ discard block |
||
612 | 612 | $properties = []; |
613 | 613 | |
614 | 614 | foreach ($value['args'] ?? [] as $name => $arg) { |
615 | - if(empty($arg['validation'])) { |
|
615 | + if (empty($arg['validation'])) { |
|
616 | 616 | $properties[$name] = null; |
617 | 617 | continue; |
618 | 618 | } |
@@ -306,7 +306,9 @@ discard block |
||
306 | 306 | { |
307 | 307 | $config = $config['class'] ?? $config['validation'] ?? null; |
308 | 308 | |
309 | - if(!$config) return 'null'; |
|
309 | + if(!$config) { |
|
310 | + return 'null'; |
|
311 | + } |
|
310 | 312 | |
311 | 313 | $code = $this->processTemplatePlaceHoldersReplacements('ValidationConfig', $config, self::DEFERRED_PLACEHOLDERS); |
312 | 314 | $code = \ltrim($this->prefixCodeWithSpaces($code, 2)); |
@@ -573,7 +575,9 @@ discard block |
||
573 | 575 | protected static function isNumericArray(array $array): bool |
574 | 576 | { |
575 | 577 | foreach ($array as $k => $a) { |
576 | - if (!is_int($k)) return false; |
|
578 | + if (!is_int($k)) { |
|
579 | + return false; |
|
580 | + } |
|
577 | 581 | } |
578 | 582 | return true; |
579 | 583 | } |
@@ -16,7 +16,7 @@ |
||
16 | 16 | { |
17 | 17 | $error = $event->getError()->getPrevious(); |
18 | 18 | |
19 | - if($error instanceof ArgumentsValidationException) |
|
19 | + if ($error instanceof ArgumentsValidationException) |
|
20 | 20 | { |
21 | 21 | $state = []; |
22 | 22 | $code = []; |
@@ -126,7 +126,7 @@ |
||
126 | 126 | $current = $this->__parent; |
127 | 127 | |
128 | 128 | while (null !== $current) { |
129 | - if($current->getName() === $name) { |
|
129 | + if ($current->getName() === $name) { |
|
130 | 130 | return $current; |
131 | 131 | } else { |
132 | 132 | $current = $current->getParent(); |
@@ -87,7 +87,7 @@ |
||
87 | 87 | $this->resolverArgs = $this->mapResolverArgs($resolverArgs); |
88 | 88 | $this->info = $this->resolverArgs['info']; |
89 | 89 | $this->constraintMapping = $mapping; |
90 | - $this->validator = $validator; |
|
90 | + $this->validator = $validator; |
|
91 | 91 | $this->validatorFactory = $factory; |
92 | 92 | $this->metadataFactory = new MetadataFactory(); |
93 | 93 | } |
@@ -170,7 +170,9 @@ discard block |
||
170 | 170 | } |
171 | 171 | |
172 | 172 | foreach ($params ?? [] as $key => $value) { |
173 | - if (null === $value) continue; |
|
173 | + if (null === $value) { |
|
174 | + continue; |
|
175 | + } |
|
174 | 176 | |
175 | 177 | switch ($key) { |
176 | 178 | case 'link': |
@@ -186,9 +188,13 @@ discard block |
||
186 | 188 | foreach ($propertyMetadata as $memberMetadata) { |
187 | 189 | // Allow only constraints specified by the "link" matcher |
188 | 190 | if (self::TYPE_GETTER === $type) { |
189 | - if (!$memberMetadata instanceof GetterMetadata) continue; |
|
191 | + if (!$memberMetadata instanceof GetterMetadata) { |
|
192 | + continue; |
|
193 | + } |
|
190 | 194 | } else if (self::TYPE_PROPERTY === $type) { |
191 | - if (!$memberMetadata instanceof PropertyMetadata) continue; |
|
195 | + if (!$memberMetadata instanceof PropertyMetadata) { |
|
196 | + continue; |
|
197 | + } |
|
192 | 198 | } |
193 | 199 | |
194 | 200 | $metadata->addPropertyConstraints($property, $memberMetadata->getConstraints()); |
@@ -254,7 +260,9 @@ discard block |
||
254 | 260 | private function applyClassConstraints(ObjectMetadata $metadata, ?array $constraints) |
255 | 261 | { |
256 | 262 | foreach ($constraints ?? [] as $key => $value) { |
257 | - if (null === $value) continue; |
|
263 | + if (null === $value) { |
|
264 | + continue; |
|
265 | + } |
|
258 | 266 | |
259 | 267 | switch ($key) { |
260 | 268 | case 'link': |