@@ -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 | |
@@ -126,7 +126,7 @@ discard block |
||
126 | 126 | |
127 | 127 | list($fieldFilter, $fieldFilterArgs) = ValidatorHelpers::getArgsFromString($fieldFilter); |
128 | 128 | |
129 | - $currentFieldData = (array)$currentFieldData; |
|
129 | + $currentFieldData = (array) $currentFieldData; |
|
130 | 130 | foreach ($fieldFilterArgs as $arg) { |
131 | 131 | $currentFieldData[] = $arg; |
132 | 132 | } |
@@ -147,7 +147,7 @@ discard block |
||
147 | 147 | $currentFieldData = \call_user_func_array([UTF8::class, $fieldFilter], $currentFieldData); |
148 | 148 | } else { |
149 | 149 | throw new UnknownFilter( |
150 | - 'No filter available for "' . $fieldFilter . '"' |
|
150 | + 'No filter available for "'.$fieldFilter.'"' |
|
151 | 151 | ); |
152 | 152 | } |
153 | 153 | |
@@ -213,8 +213,8 @@ discard block |
||
213 | 213 | $fieldHelperChar = ''; |
214 | 214 | $fieldArrayTmp = preg_replace_callback( |
215 | 215 | '/\[([^\]]+)\]/', |
216 | - function ($match) use ($fieldHelperChar) { |
|
217 | - return $match[1] . $fieldHelperChar; |
|
216 | + function($match) use ($fieldHelperChar) { |
|
217 | + return $match[1].$fieldHelperChar; |
|
218 | 218 | }, |
219 | 219 | $fieldArray |
220 | 220 | ); |
@@ -395,7 +395,7 @@ discard block |
||
395 | 395 | if ($inputType) { |
396 | 396 | $selectedRule = $this->autoSelectRuleByInputType($inputType); |
397 | 397 | if ($selectedRule) { |
398 | - $inputRule .= '|' . $selectedRule; |
|
398 | + $inputRule .= '|'.$selectedRule; |
|
399 | 399 | } |
400 | 400 | } |
401 | 401 | |
@@ -404,7 +404,7 @@ discard block |
||
404 | 404 | // |
405 | 405 | |
406 | 406 | if ($inputPattern) { |
407 | - $inputRule .= '|regex(/' . $inputPattern . '/)'; |
|
407 | + $inputRule .= '|regex(/'.$inputPattern.'/)'; |
|
408 | 408 | } |
409 | 409 | |
410 | 410 | // |
@@ -412,19 +412,19 @@ discard block |
||
412 | 412 | // |
413 | 413 | |
414 | 414 | if ($inputMinLength) { |
415 | - $inputRule .= '|minLength(' . serialize($inputMinLength) . ')'; |
|
415 | + $inputRule .= '|minLength('.serialize($inputMinLength).')'; |
|
416 | 416 | } |
417 | 417 | |
418 | 418 | if ($inputMaxLength) { |
419 | - $inputRule .= '|maxLength(' . serialize($inputMaxLength) . ')'; |
|
419 | + $inputRule .= '|maxLength('.serialize($inputMaxLength).')'; |
|
420 | 420 | } |
421 | 421 | |
422 | 422 | if ($inputMin) { |
423 | - $inputRule .= '|min(' . serialize($inputMin) . ')'; |
|
423 | + $inputRule .= '|min('.serialize($inputMin).')'; |
|
424 | 424 | } |
425 | 425 | |
426 | 426 | if ($inputMax) { |
427 | - $inputRule .= '|max(' . serialize($inputMax) . ')'; |
|
427 | + $inputRule .= '|max('.serialize($inputMax).')'; |
|
428 | 428 | } |
429 | 429 | |
430 | 430 | } |
@@ -437,7 +437,7 @@ discard block |
||
437 | 437 | foreach ($formField->getElementsByTagName('option') as $option) { |
438 | 438 | $selectableValues[] = $option->getNode()->nodeValue; |
439 | 439 | } |
440 | - $inputRule .= '|in(' . serialize($selectableValues) . ')'; |
|
440 | + $inputRule .= '|in('.serialize($selectableValues).')'; |
|
441 | 441 | |
442 | 442 | } elseif ( |
443 | 443 | ( |
@@ -451,7 +451,7 @@ discard block |
||
451 | 451 | $selectableValues = []; |
452 | 452 | |
453 | 453 | try { |
454 | - $formFieldNames = $form->find('[name=' . $formField->name . ']'); |
|
454 | + $formFieldNames = $form->find('[name='.$formField->name.']'); |
|
455 | 455 | } catch (SyntaxErrorException $syntaxErrorException) { |
456 | 456 | $formFieldNames = null; |
457 | 457 | // TODO@me -> can the symfony CssSelectorConverter use array-name-attributes? |
@@ -463,7 +463,7 @@ discard block |
||
463 | 463 | } |
464 | 464 | } |
465 | 465 | |
466 | - $inputRule .= '|in(' . serialize($selectableValues) . ')'; |
|
466 | + $inputRule .= '|in('.serialize($selectableValues).')'; |
|
467 | 467 | |
468 | 468 | } |
469 | 469 | } |
@@ -595,7 +595,7 @@ discard block |
||
595 | 595 | |
596 | 596 | } catch (ComponentException $componentException) { |
597 | 597 | throw new UnknownValidationRule( |
598 | - 'No rule defined for: ' . $field . ' (rule: ' . $fieldRule . ' | class: ' . $validationClass . ')', |
|
598 | + 'No rule defined for: '.$field.' (rule: '.$fieldRule.' | class: '.$validationClass.')', |
|
599 | 599 | 500, |
600 | 600 | $componentException |
601 | 601 | ); |
@@ -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): self |
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? |
@@ -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 | |
@@ -22,7 +22,7 @@ discard block |
||
22 | 22 | { |
23 | 23 | $argsMatches = []; |
24 | 24 | \preg_match('/\((?<args>.*?)\)$/', $string, $argsMatches); |
25 | - $string = (string)\preg_replace('/\((.*?)\)$/', '', $string); |
|
25 | + $string = (string) \preg_replace('/\((.*?)\)$/', '', $string); |
|
26 | 26 | |
27 | 27 | $args = []; |
28 | 28 | if (isset($argsMatches['args'])) { |
@@ -39,7 +39,7 @@ discard block |
||
39 | 39 | $arg = trim($argTmp); |
40 | 40 | |
41 | 41 | if ($arg === 'true' || $arg === 'false') { |
42 | - $arg = (bool)$arg; |
|
42 | + $arg = (bool) $arg; |
|
43 | 43 | } elseif ($args === 'null') { |
44 | 44 | $arg = null; |
45 | 45 | } |