@@ -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 | |
@@ -135,7 +135,7 @@ discard block |
||
| 135 | 135 | |
| 136 | 136 | list($fieldFilter, $fieldFilterArgs) = ValidatorHelpers::getArgsFromString($fieldFilter); |
| 137 | 137 | |
| 138 | - $currentFieldData = (array)$currentFieldData; |
|
| 138 | + $currentFieldData = (array) $currentFieldData; |
|
| 139 | 139 | foreach ($fieldFilterArgs as $arg) { |
| 140 | 140 | $currentFieldData[] = $arg; |
| 141 | 141 | } |
@@ -156,7 +156,7 @@ discard block |
||
| 156 | 156 | $currentFieldData = \call_user_func_array([UTF8::class, $fieldFilter], $currentFieldData); |
| 157 | 157 | } else { |
| 158 | 158 | throw new UnknownFilter( |
| 159 | - 'No filter available for "' . $fieldFilter . '"' |
|
| 159 | + 'No filter available for "'.$fieldFilter.'"' |
|
| 160 | 160 | ); |
| 161 | 161 | } |
| 162 | 162 | |
@@ -197,7 +197,7 @@ discard block |
||
| 197 | 197 | $namespaceSeparator = '\\'; |
| 198 | 198 | $rulePrefix = \rtrim($phpNamespace, $namespaceSeparator); |
| 199 | 199 | |
| 200 | - return $rulePrefix . $namespaceSeparator; |
|
| 200 | + return $rulePrefix.$namespaceSeparator; |
|
| 201 | 201 | } |
| 202 | 202 | |
| 203 | 203 | /** |
@@ -235,8 +235,8 @@ discard block |
||
| 235 | 235 | $fieldHelperChar = ''; |
| 236 | 236 | $fieldArrayTmp = preg_replace_callback( |
| 237 | 237 | '/\[([^\]]+)\]/', |
| 238 | - function ($match) use ($fieldHelperChar) { |
|
| 239 | - return $match[1] . $fieldHelperChar; |
|
| 238 | + function($match) use ($fieldHelperChar) { |
|
| 239 | + return $match[1].$fieldHelperChar; |
|
| 240 | 240 | }, |
| 241 | 241 | $fieldArray |
| 242 | 242 | ); |
@@ -330,7 +330,7 @@ discard block |
||
| 330 | 330 | |
| 331 | 331 | } elseif ($this->selector) { |
| 332 | 332 | |
| 333 | - $htmlElementHelperId = 'html-element-validator-tmp-' . $this->selector; |
|
| 333 | + $htmlElementHelperId = 'html-element-validator-tmp-'.$this->selector; |
|
| 334 | 334 | |
| 335 | 335 | } else { |
| 336 | 336 | |
@@ -339,9 +339,9 @@ discard block |
||
| 339 | 339 | '.', |
| 340 | 340 | $htmlElement->getAttribute('class') |
| 341 | 341 | ); |
| 342 | - $fakeCssSelector = $htmlElement->getNode()->getNodePath() . '/' . $cssClassesTmp; |
|
| 342 | + $fakeCssSelector = $htmlElement->getNode()->getNodePath().'/'.$cssClassesTmp; |
|
| 343 | 343 | |
| 344 | - $htmlElementHelperId = 'html-element-validator-tmp-' . $fakeCssSelector; |
|
| 344 | + $htmlElementHelperId = 'html-element-validator-tmp-'.$fakeCssSelector; |
|
| 345 | 345 | } |
| 346 | 346 | |
| 347 | 347 | $htmlElementTagSelector = 'input, textarea, select'; |
@@ -422,7 +422,7 @@ discard block |
||
| 422 | 422 | if ($inputType) { |
| 423 | 423 | $selectedRule = $this->autoSelectRuleByInputType($inputType); |
| 424 | 424 | if ($selectedRule) { |
| 425 | - $inputRule .= '|' . $selectedRule; |
|
| 425 | + $inputRule .= '|'.$selectedRule; |
|
| 426 | 426 | } |
| 427 | 427 | } |
| 428 | 428 | |
@@ -431,7 +431,7 @@ discard block |
||
| 431 | 431 | // |
| 432 | 432 | |
| 433 | 433 | if ($inputPattern) { |
| 434 | - $inputRule .= '|regex(/' . $inputPattern . '/)'; |
|
| 434 | + $inputRule .= '|regex(/'.$inputPattern.'/)'; |
|
| 435 | 435 | } |
| 436 | 436 | |
| 437 | 437 | // |
@@ -439,19 +439,19 @@ discard block |
||
| 439 | 439 | // |
| 440 | 440 | |
| 441 | 441 | if ($inputMinLength) { |
| 442 | - $inputRule .= '|minLength(' . serialize($inputMinLength) . ')'; |
|
| 442 | + $inputRule .= '|minLength('.serialize($inputMinLength).')'; |
|
| 443 | 443 | } |
| 444 | 444 | |
| 445 | 445 | if ($inputMaxLength) { |
| 446 | - $inputRule .= '|maxLength(' . serialize($inputMaxLength) . ')'; |
|
| 446 | + $inputRule .= '|maxLength('.serialize($inputMaxLength).')'; |
|
| 447 | 447 | } |
| 448 | 448 | |
| 449 | 449 | if ($inputMin) { |
| 450 | - $inputRule .= '|min(' . serialize($inputMin) . ')'; |
|
| 450 | + $inputRule .= '|min('.serialize($inputMin).')'; |
|
| 451 | 451 | } |
| 452 | 452 | |
| 453 | 453 | if ($inputMax) { |
| 454 | - $inputRule .= '|max(' . serialize($inputMax) . ')'; |
|
| 454 | + $inputRule .= '|max('.serialize($inputMax).')'; |
|
| 455 | 455 | } |
| 456 | 456 | |
| 457 | 457 | } |
@@ -464,7 +464,7 @@ discard block |
||
| 464 | 464 | foreach ($htmlElementField->getElementsByTagName('option') as $option) { |
| 465 | 465 | $selectableValues[] = $option->getNode()->nodeValue; |
| 466 | 466 | } |
| 467 | - $inputRule .= '|in(' . serialize($selectableValues) . ')'; |
|
| 467 | + $inputRule .= '|in('.serialize($selectableValues).')'; |
|
| 468 | 468 | |
| 469 | 469 | } elseif ( |
| 470 | 470 | ( |
@@ -478,7 +478,7 @@ discard block |
||
| 478 | 478 | $selectableValues = []; |
| 479 | 479 | |
| 480 | 480 | try { |
| 481 | - $htmlElementFieldNames = $htmlElement->find('[name=' . $htmlElementField->name . ']'); |
|
| 481 | + $htmlElementFieldNames = $htmlElement->find('[name='.$htmlElementField->name.']'); |
|
| 482 | 482 | } catch (SyntaxErrorException $syntaxErrorException) { |
| 483 | 483 | $htmlElementFieldNames = null; |
| 484 | 484 | // TODO@me -> can the symfony CssSelectorConverter use array-name-attributes? |
@@ -490,7 +490,7 @@ discard block |
||
| 490 | 490 | } |
| 491 | 491 | } |
| 492 | 492 | |
| 493 | - $inputRule .= '|in(' . serialize($selectableValues) . ')'; |
|
| 493 | + $inputRule .= '|in('.serialize($selectableValues).')'; |
|
| 494 | 494 | |
| 495 | 495 | } |
| 496 | 496 | } |
@@ -660,7 +660,7 @@ discard block |
||
| 660 | 660 | |
| 661 | 661 | } catch (ComponentException $componentException) { |
| 662 | 662 | throw new UnknownValidationRule( |
| 663 | - 'No rule defined for: ' . $field . ' (rule: ' . $fieldRule . ' | class: ' . $validationClass . ')', |
|
| 663 | + 'No rule defined for: '.$field.' (rule: '.$fieldRule.' | class: '.$validationClass.')', |
|
| 664 | 664 | 500, |
| 665 | 665 | $componentException |
| 666 | 666 | ); |