@@ -1,6 +1,6 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | -declare(strict_types=1); |
|
| 3 | +declare(strict_types = 1); |
|
| 4 | 4 | |
| 5 | 5 | namespace voku\HtmlFormValidator; |
| 6 | 6 | |
@@ -85,7 +85,7 @@ discard block |
||
| 85 | 85 | public function setError(string $field, $errorMsg): ValidatorResult |
| 86 | 86 | { |
| 87 | 87 | try { |
| 88 | - $inputTag = $this->formDocument->find('[name=' . $field . ']', 0); |
|
| 88 | + $inputTag = $this->formDocument->find('[name='.$field.']', 0); |
|
| 89 | 89 | } catch (SyntaxErrorException $syntaxErrorException) { |
| 90 | 90 | $inputTag = null; |
| 91 | 91 | // TODO@me -> can the symfony CssSelectorConverter use array-name-attributes? |
@@ -87,7 +87,7 @@ |
||
| 87 | 87 | $classArg = trim($classArgsTmp); |
| 88 | 88 | |
| 89 | 89 | if ($classArg === 'true' || $classArg === 'false') { |
| 90 | - $classArg = (bool)$classArg; |
|
| 90 | + $classArg = (bool) $classArg; |
|
| 91 | 91 | } else if ($classArgs === 'null') { |
| 92 | 92 | $classArg = null; |
| 93 | 93 | } |
@@ -1,6 +1,6 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | -declare(strict_types=1); |
|
| 3 | +declare(strict_types = 1); |
|
| 4 | 4 | |
| 5 | 5 | namespace voku\HtmlFormValidator; |
| 6 | 6 | |
@@ -124,7 +124,7 @@ discard block |
||
| 124 | 124 | $currentFieldData = \call_user_func([UTF8::class, $fieldFilter], $currentFieldData); |
| 125 | 125 | } else { |
| 126 | 126 | throw new UnknownFilter( |
| 127 | - 'No filter available for "' . $fieldFilter . '"' |
|
| 127 | + 'No filter available for "'.$fieldFilter.'"' |
|
| 128 | 128 | ); |
| 129 | 129 | } |
| 130 | 130 | |
@@ -188,8 +188,8 @@ discard block |
||
| 188 | 188 | $fieldHelperChar = ''; |
| 189 | 189 | $fieldArrayTmp = preg_replace_callback( |
| 190 | 190 | '/\[([^\]]+)\]/', |
| 191 | - function ($match) use ($fieldHelperChar) { |
|
| 192 | - return $match[1] . $fieldHelperChar; |
|
| 191 | + function($match) use ($fieldHelperChar) { |
|
| 192 | + return $match[1].$fieldHelperChar; |
|
| 193 | 193 | }, |
| 194 | 194 | $fieldArray |
| 195 | 195 | ); |
@@ -370,7 +370,7 @@ discard block |
||
| 370 | 370 | if ($inputType) { |
| 371 | 371 | $selectedRule = $this->autoSelectRuleByInputType($inputType); |
| 372 | 372 | if ($selectedRule) { |
| 373 | - $inputRule .= '|' . $selectedRule; |
|
| 373 | + $inputRule .= '|'.$selectedRule; |
|
| 374 | 374 | } |
| 375 | 375 | } |
| 376 | 376 | |
@@ -379,7 +379,7 @@ discard block |
||
| 379 | 379 | // |
| 380 | 380 | |
| 381 | 381 | if ($inputPattern) { |
| 382 | - $inputRule .= '|regex(/' . $inputPattern . '/)'; |
|
| 382 | + $inputRule .= '|regex(/'.$inputPattern.'/)'; |
|
| 383 | 383 | } |
| 384 | 384 | |
| 385 | 385 | // |
@@ -387,19 +387,19 @@ discard block |
||
| 387 | 387 | // |
| 388 | 388 | |
| 389 | 389 | if ($inputMinLength) { |
| 390 | - $inputRule .= '|minLength(' . serialize($inputMinLength) . ')'; |
|
| 390 | + $inputRule .= '|minLength('.serialize($inputMinLength).')'; |
|
| 391 | 391 | } |
| 392 | 392 | |
| 393 | 393 | if ($inputMaxLength) { |
| 394 | - $inputRule .= '|maxLength(' . serialize($inputMaxLength) . ')'; |
|
| 394 | + $inputRule .= '|maxLength('.serialize($inputMaxLength).')'; |
|
| 395 | 395 | } |
| 396 | 396 | |
| 397 | 397 | if ($inputMin) { |
| 398 | - $inputRule .= '|min(' . serialize($inputMin) . ')'; |
|
| 398 | + $inputRule .= '|min('.serialize($inputMin).')'; |
|
| 399 | 399 | } |
| 400 | 400 | |
| 401 | 401 | if ($inputMax) { |
| 402 | - $inputRule .= '|max(' . serialize($inputMax) . ')'; |
|
| 402 | + $inputRule .= '|max('.serialize($inputMax).')'; |
|
| 403 | 403 | } |
| 404 | 404 | |
| 405 | 405 | } |
@@ -412,7 +412,7 @@ discard block |
||
| 412 | 412 | foreach ($formField->getElementsByTagName('option') as $option) { |
| 413 | 413 | $selectableValues[] = $option->getNode()->nodeValue; |
| 414 | 414 | } |
| 415 | - $inputRule .= '|in(' . serialize($selectableValues) . ')'; |
|
| 415 | + $inputRule .= '|in('.serialize($selectableValues).')'; |
|
| 416 | 416 | |
| 417 | 417 | } else if ( |
| 418 | 418 | ( |
@@ -426,7 +426,7 @@ discard block |
||
| 426 | 426 | $selectableValues = []; |
| 427 | 427 | |
| 428 | 428 | try { |
| 429 | - $formFieldNames = $form->find('[name=' . $formField->name . ']'); |
|
| 429 | + $formFieldNames = $form->find('[name='.$formField->name.']'); |
|
| 430 | 430 | } catch (SyntaxErrorException $syntaxErrorException) { |
| 431 | 431 | $formFieldNames = null; |
| 432 | 432 | // TODO@me -> can the symfony CssSelectorConverter use array-name-attributes? |
@@ -438,7 +438,7 @@ discard block |
||
| 438 | 438 | } |
| 439 | 439 | } |
| 440 | 440 | |
| 441 | - $inputRule .= '|in(' . serialize($selectableValues) . ')'; |
|
| 441 | + $inputRule .= '|in('.serialize($selectableValues).')'; |
|
| 442 | 442 | |
| 443 | 443 | } |
| 444 | 444 | } |
@@ -570,7 +570,7 @@ discard block |
||
| 570 | 570 | |
| 571 | 571 | } catch (ComponentException $componentException) { |
| 572 | 572 | throw new UnknownValidationRule( |
| 573 | - 'No rule defined for: ' . $field . ' (rule: ' . $fieldRule . ' | class: ' . $validationClass . ')', |
|
| 573 | + 'No rule defined for: '.$field.' (rule: '.$fieldRule.' | class: '.$validationClass.')', |
|
| 574 | 574 | 500, |
| 575 | 575 | $componentException |
| 576 | 576 | ); |