Passed
Push — main ( eca0a2...180091 )
by Breno
01:39
created
src/GuardForValidation.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -7,7 +7,7 @@
 block discarded – undo
7 7
 {
8 8
     public function validateOrFail($input, array $context = [], string $message = 'Validation errors'): void
9 9
     {
10
-        if (! $this instanceof Validation) {
10
+        if (!$this instanceof Validation) {
11 11
             return;
12 12
         }
13 13
 
Please login to merge, or discard this patch.
src/Rules/AbstractValidation.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -23,7 +23,7 @@
 block discarded – undo
23 23
     public function validate($input, array $context = []): Result
24 24
     {
25 25
         $result = $this->newEmptyValidationResult();
26
-        return $this->isValid($input, $context) ? $result: $result->error($this->message);
26
+        return $this->isValid($input, $context) ? $result : $result->error($this->message);
27 27
     }
28 28
 
29 29
     abstract protected function isValid($input, array $context = []): bool;
Please login to merge, or discard this patch.
src/MaybeBelongsToField.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -23,7 +23,7 @@
 block discarded – undo
23 23
         return $this->field !== null;
24 24
     }
25 25
 
26
-    private function newEmptyValidationResult(): ValidationResult|ValidationResultByField
26
+    private function newEmptyValidationResult(): ValidationResult | ValidationResultByField
27 27
     {
28 28
         return $this->belongsToField() ? new ValidationResultByField($this->getField()) : new ValidationResult;
29 29
     }
Please login to merge, or discard this patch.
src/ValidationException.php 1 patch
Spacing   +3 added lines, -4 removed lines patch added patch discarded remove patch
@@ -11,7 +11,7 @@  discard block
 block discarded – undo
11 11
     private Result $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/Validator.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -26,7 +26,7 @@  discard block
 block discarded – undo
26 26
         return $this->ruleSets[] = (new ValidationSet)->setField($field);
27 27
     }
28 28
 
29
-    public function field(string $field, Validation|ValidationSet ...$rules): self
29
+    public function field(string $field, Validation | ValidationSet ...$rules): self
30 30
     {
31 31
         $ruleset = $this->ruleSet($field);
32 32
         foreach ($rules as $rule) {
@@ -80,7 +80,7 @@  discard block
 block discarded – undo
80 80
      * @return static
81 81
      * @throws ReflectionException if the class does not exist
82 82
      */
83
-    public static function fromProperties(string|object $objectOrClass, ?int $filter = null): self
83
+    public static function fromProperties(string | object $objectOrClass, ?int $filter = null): self
84 84
     {
85 85
         $instance = new self;
86 86
         $instance->ruleSets = ValidationSet::fromProperties($objectOrClass, $filter);
Please login to merge, or discard this patch.
src/ValidationSet.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -31,7 +31,7 @@  discard block
 block discarded – undo
31 31
         return $this;
32 32
     }
33 33
 
34
-    public function validate($input, array $context = []): ValidationResult|ValidationResultByField
34
+    public function validate($input, array $context = []): ValidationResult | ValidationResultByField
35 35
     {
36 36
         $violations = $this->newEmptyValidationResult();
37 37
         foreach ($this->rules as $constraint) {
@@ -72,7 +72,7 @@  discard block
 block discarded – undo
72 72
      * @return array
73 73
      * @throws ReflectionException if the class does not exist
74 74
      */
75
-    public static function fromProperties(string|object $objectOrClass, ?int $filter = null): array
75
+    public static function fromProperties(string | object $objectOrClass, ?int $filter = null): array
76 76
     {
77 77
         $ruleSets = [];
78 78
         foreach ((new ReflectionClass($objectOrClass))->getProperties($filter) as $property) {
@@ -88,7 +88,7 @@  discard block
 block discarded – undo
88 88
      * @return static
89 89
      * @throws ReflectionException if the class or property does not exist.
90 90
      */
91
-    public static function fromProperty(string|object $objectOrClass, string $property): self
91
+    public static function fromProperty(string | object $objectOrClass, string $property): self
92 92
     {
93 93
         return self::fromReflectionProperty(new ReflectionProperty($objectOrClass, $property));
94 94
     }
Please login to merge, or discard this patch.