Completed
Push — master ( b4546c...97e2e0 )
by Lars
01:39
created
src/voku/HtmlFormValidator/Validator.php 1 patch
Spacing   +16 added lines, -16 removed lines patch added patch discarded remove patch
@@ -1,6 +1,6 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
       );
@@ -408,7 +408,7 @@  discard block
 block discarded – undo
408 408
       if ($inputType) {
409 409
         $selectedRule = $this->autoSelectRuleByInputType($inputType);
410 410
         if ($selectedRule) {
411
-          $inputRule .= '|' . $selectedRule;
411
+          $inputRule .= '|'.$selectedRule;
412 412
         }
413 413
       }
414 414
 
@@ -417,7 +417,7 @@  discard block
 block discarded – undo
417 417
       //
418 418
 
419 419
       if ($inputPattern) {
420
-        $inputRule .= '|regex(/' . $inputPattern . '/)';
420
+        $inputRule .= '|regex(/'.$inputPattern.'/)';
421 421
       }
422 422
 
423 423
       //
@@ -425,19 +425,19 @@  discard block
 block discarded – undo
425 425
       //
426 426
 
427 427
       if ($inputMinLength) {
428
-        $inputRule .= '|minLength(' . serialize($inputMinLength) . ')';
428
+        $inputRule .= '|minLength('.serialize($inputMinLength).')';
429 429
       }
430 430
 
431 431
       if ($inputMaxLength) {
432
-        $inputRule .= '|maxLength(' . serialize($inputMaxLength) . ')';
432
+        $inputRule .= '|maxLength('.serialize($inputMaxLength).')';
433 433
       }
434 434
 
435 435
       if ($inputMin) {
436
-        $inputRule .= '|min(' . serialize($inputMin) . ')';
436
+        $inputRule .= '|min('.serialize($inputMin).')';
437 437
       }
438 438
 
439 439
       if ($inputMax) {
440
-        $inputRule .= '|max(' . serialize($inputMax) . ')';
440
+        $inputRule .= '|max('.serialize($inputMax).')';
441 441
       }
442 442
 
443 443
     }
@@ -450,7 +450,7 @@  discard block
 block discarded – undo
450 450
         foreach ($formField->getElementsByTagName('option') as $option) {
451 451
           $selectableValues[] = $option->getNode()->nodeValue;
452 452
         }
453
-        $inputRule .= '|in(' . serialize($selectableValues) . ')';
453
+        $inputRule .= '|in('.serialize($selectableValues).')';
454 454
 
455 455
       } elseif (
456 456
           (
@@ -464,7 +464,7 @@  discard block
 block discarded – undo
464 464
         $selectableValues = [];
465 465
 
466 466
         try {
467
-          $formFieldNames = $form->find('[name=' . $formField->name . ']');
467
+          $formFieldNames = $form->find('[name='.$formField->name.']');
468 468
         } catch (SyntaxErrorException $syntaxErrorException) {
469 469
           $formFieldNames = null;
470 470
           // TODO@me -> can the symfony CssSelectorConverter use array-name-attributes?
@@ -476,7 +476,7 @@  discard block
 block discarded – undo
476 476
           }
477 477
         }
478 478
 
479
-        $inputRule .= '|in(' . serialize($selectableValues) . ')';
479
+        $inputRule .= '|in('.serialize($selectableValues).')';
480 480
 
481 481
       }
482 482
     }
@@ -646,7 +646,7 @@  discard block
 block discarded – undo
646 646
 
647 647
             } catch (ComponentException $componentException) {
648 648
               throw new UnknownValidationRule(
649
-                  'No rule defined for: ' . $field . ' (rule: ' . $fieldRule . ' | class: ' . $validationClass . ')',
649
+                  'No rule defined for: '.$field.' (rule: '.$fieldRule.' | class: '.$validationClass.')',
650 650
                   500,
651 651
                   $componentException
652 652
               );
Please login to merge, or discard this patch.