Passed
Push — main ( a1ad3c...963e70 )
by Breno
01:36
created
src/RuleSet.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -22,7 +22,7 @@  discard block
 block discarded – undo
22 22
     /**
23 23
      * @throws ValidationException if the field is provided and is blank
24 24
      */
25
-    final public function __construct(?string $field = null, Rule|RuleSet ...$rules)
25
+    final public function __construct(?string $field = null, Rule | RuleSet ...$rules)
26 26
     {
27 27
         $this->rules = new SplObjectStorage;
28 28
         $this->setField($field);
@@ -34,17 +34,17 @@  discard block
 block discarded – undo
34 34
         return new self;
35 35
     }
36 36
 
37
-    public static function forField(string $field, Rule|RuleSet ...$rules): self
37
+    public static function forField(string $field, Rule | RuleSet ...$rules): self
38 38
     {
39 39
         return new self($field, ...$rules);
40 40
     }
41 41
 
42
-    public static function withRules(Rule|RuleSet ...$rules): self
42
+    public static function withRules(Rule | RuleSet ...$rules): self
43 43
     {
44 44
         return new self(null, ...$rules);
45 45
     }
46 46
 
47
-    private function attachRules(Rule|RuleSet ...$rules): void
47
+    private function attachRules(Rule | RuleSet ...$rules): void
48 48
     {
49 49
         foreach ($rules as $validationOrSet) {
50 50
             if ($validationOrSet instanceof Rule) {
@@ -59,14 +59,14 @@  discard block
 block discarded – undo
59 59
         }
60 60
     }
61 61
 
62
-    public function add(Rule|RuleSet ...$rules): self
62
+    public function add(Rule | RuleSet ...$rules): self
63 63
     {
64 64
         $instance = clone $this;
65 65
         $instance->attachRules(...$rules);
66 66
         return $instance;
67 67
     }
68 68
 
69
-    public function validate(mixed $input, array $context = []): ValidationResult|ValidationResultByField
69
+    public function validate(mixed $input, array $context = []): ValidationResult | ValidationResultByField
70 70
     {
71 71
         $violations = $empty = $this->newEmptyValidationResult();
72 72
         if (null === $input && $this->allowsNull()) {
Please login to merge, or discard this patch.
src/Validator.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -32,7 +32,7 @@  discard block
 block discarded – undo
32 32
      * @param Rule|RuleSet ...$rules
33 33
      * @return $this
34 34
      */
35
-    public function field(string $field, Rule|RuleSet ...$rules): self
35
+    public function field(string $field, Rule | RuleSet ...$rules): self
36 36
     {
37 37
         $ruleSet = $this->ruleSets[$field] ?? RuleSet::forField($field);
38 38
         $this->ruleSets[$field] = $ruleSet->add(...$rules);
@@ -117,7 +117,7 @@  discard block
 block discarded – undo
117 117
      * @return static
118 118
      * @throws ReflectionException if the class does not exist
119 119
      */
120
-    public static function fromProperties(string|object $objectOrClass, ?int $filter = null): self
120
+    public static function fromProperties(string | object $objectOrClass, ?int $filter = null): self
121 121
     {
122 122
         $instance = new self;
123 123
         $instance->ruleSets = RuleSetFactory::fromProperties($objectOrClass, $filter);
Please login to merge, or discard this patch.