Passed
Branch main (72e6e1)
by Breno
01:48
created
src/ValidationException.php 1 patch
Spacing   +4 added lines, -5 removed lines patch added patch discarded remove patch
@@ -8,10 +8,10 @@  discard block
 block discarded – undo
8 8
 
9 9
 class ValidationException extends Exception
10 10
 {
11
-    private ValidationResultSet|ValidationResult $violations;
11
+    private ValidationResultSet | ValidationResult $violations;
12 12
 
13 13
     public function __construct(
14
-        ValidationResultSet|ValidationResult $violations,
14
+        ValidationResultSet | ValidationResult $violations,
15 15
         ?string $message = null,
16 16
         $code = 422,
17 17
         Throwable $previous = null
@@ -27,8 +27,7 @@  discard block
 block discarded – undo
27 27
     {
28 28
         return
29 29
             $this->violations instanceof ValidationResultSet ?
30
-                $this->violations->validationResults() :
31
-                [$this->violations];
30
+                $this->violations->validationResults() : [$this->violations];
32 31
     }
33 32
 
34 33
     private function formatMessage(): string
@@ -41,6 +40,6 @@  discard block
 block discarded – undo
41 40
             }
42 41
         }
43 42
 
44
-        return "Validation errors:" . PHP_EOL . implode(PHP_EOL, $messages);
43
+        return "Validation errors:".PHP_EOL.implode(PHP_EOL, $messages);
45 44
     }
46 45
 }
Please login to merge, or discard this patch.
src/Rules/DateTime/GreaterThan.php 1 patch
Spacing   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -26,8 +26,7 @@
 block discarded – undo
26 26
         try {
27 27
             $datetime =
28 28
                 $input instanceof DateTimeInterface ?
29
-                    $input :
30
-                    new DateTimeImmutable($input);
29
+                    $input : new DateTimeImmutable($input);
31 30
 
32 31
             return $datetime > $this->datetime();
33 32
         } catch (Throwable) {
Please login to merge, or discard this patch.
src/Rules/DateTime/LessThan.php 1 patch
Spacing   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -26,8 +26,7 @@
 block discarded – undo
26 26
         try {
27 27
             $datetime =
28 28
                 $input instanceof DateTimeInterface ?
29
-                    $input :
30
-                    new DateTimeImmutable($input);
29
+                    $input : new DateTimeImmutable($input);
31 30
 
32 31
             return $datetime < $this->datetime();
33 32
         } catch (Throwable) {
Please login to merge, or discard this patch.
src/MaybeBelongsToField.php 1 patch
Spacing   +2 added lines, -3 removed lines patch added patch discarded remove patch
@@ -29,11 +29,10 @@
 block discarded – undo
29 29
         return $this->field !== null;
30 30
     }
31 31
 
32
-    private function newEmptyValidationResult(): ValidationResult|ValidationResultByField
32
+    private function newEmptyValidationResult(): ValidationResult | ValidationResultByField
33 33
     {
34 34
         return
35 35
             $this->belongsToField() ?
36
-                new ValidationResultByField($this->getField()) :
37
-                ValidationResult::everythingIsOk();
36
+                new ValidationResultByField($this->getField()) : ValidationResult::everythingIsOk();
38 37
     }
39 38
 }
Please login to merge, or discard this patch.
src/Rules/DateTime/GreaterThanAnother.php 1 patch
Spacing   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -21,8 +21,7 @@
 block discarded – undo
21 21
         try {
22 22
             $datetime =
23 23
                 $input instanceof DateTimeInterface ?
24
-                    $input :
25
-                    new DateTimeImmutable($input);
24
+                    $input : new DateTimeImmutable($input);
26 25
 
27 26
             return array_key_exists($this->other, $context)
28 27
                 && $datetime > (new DateTimeImmutable($context[$this->other]));
Please login to merge, or discard this patch.
src/Rules/DateTime/LessThanAnother.php 1 patch
Spacing   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -21,8 +21,7 @@
 block discarded – undo
21 21
         try {
22 22
             $datetime =
23 23
                 $input instanceof DateTimeInterface ?
24
-                    $input :
25
-                    new DateTimeImmutable($input);
24
+                    $input : new DateTimeImmutable($input);
26 25
 
27 26
             return array_key_exists($this->other, $context)
28 27
                 && $datetime < (new DateTimeImmutable($context[$this->other]));
Please login to merge, or discard this patch.
src/Rules/Number/NumberBetween.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -12,8 +12,8 @@
 block discarded – undo
12 12
     const MESSAGE = 'The value should be between `%s` and `%s` (%sincluding the boundaries)';
13 13
 
14 14
     public function __construct(
15
-        private int|float $min,
16
-        private int|float $max,
15
+        private int | float $min,
16
+        private int | float $max,
17 17
         private $boundaries = true,
18 18
         ?string $message = null
19 19
     ) {
Please login to merge, or discard this patch.
src/DataStructure/MapBehaviorTrait.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -14,7 +14,7 @@
 block discarded – undo
14 14
         }
15 15
     }
16 16
 
17
-    public function set(string|int $index, mixed $value): self
17
+    public function set(string | int $index, mixed $value): self
18 18
     {
19 19
         $this->insert($value, $index);
20 20
         return $this;
Please login to merge, or discard this patch.
src/DataStructure/CollectionTrait.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -18,7 +18,7 @@  discard block
 block discarded – undo
18 18
         }
19 19
     }
20 20
 
21
-    public function get(string|int $index, $default = null): mixed
21
+    public function get(string | int $index, $default = null): mixed
22 22
     {
23 23
         return $this->elements[$index] ?? $default;
24 24
     }
@@ -44,7 +44,7 @@  discard block
 block discarded – undo
44 44
         return true;
45 45
     }
46 46
 
47
-    public function indexOf(mixed $element): bool|int|string
47
+    public function indexOf(mixed $element): bool | int | string
48 48
     {
49 49
         return array_search($element, $this->elements, true);
50 50
     }
@@ -97,7 +97,7 @@  discard block
 block discarded – undo
97 97
         return $this;
98 98
     }
99 99
 
100
-    public function forEach(callable $callback, bool $stopable = false): static
100
+    public function forEach (callable $callback, bool $stopable = false): static
101 101
     {
102 102
         foreach ($this->elements as $index => $element) {
103 103
             $result = call_user_func_array($callback, [$element, $index]);
Please login to merge, or discard this patch.