Passed
Push — main ( 013e60...00f274 )
by Breno
01:56
created
src/ValidationSet.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -48,7 +48,7 @@  discard block
 block discarded – undo
48 48
         return $this;
49 49
     }
50 50
 
51
-    public function validate(mixed $input, array $context = []): ValidationResult|ValidationResultByField
51
+    public function validate(mixed $input, array $context = []): ValidationResult | ValidationResultByField
52 52
     {
53 53
         $violations = $this->newEmptyValidationResult();
54 54
         foreach ($this->rules as $constraint) {
@@ -89,7 +89,7 @@  discard block
 block discarded – undo
89 89
      * @return array
90 90
      * @throws ReflectionException if the class does not exist
91 91
      */
92
-    public static function fromProperties(string|object $objectOrClass, ?int $filter = null): array
92
+    public static function fromProperties(string | object $objectOrClass, ?int $filter = null): array
93 93
     {
94 94
         $ruleSets = [];
95 95
         foreach ((new ReflectionClass($objectOrClass))->getProperties($filter) as $property) {
@@ -105,7 +105,7 @@  discard block
 block discarded – undo
105 105
      * @return static
106 106
      * @throws ReflectionException if the class or property does not exist.
107 107
      */
108
-    public static function fromProperty(string|object $objectOrClass, string $property): self
108
+    public static function fromProperty(string | object $objectOrClass, string $property): self
109 109
     {
110 110
         return self::fromReflectionProperty(new ReflectionProperty($objectOrClass, $property));
111 111
     }
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[] = ValidationSet::forField($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/Rules/AbstractValidation.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -29,7 +29,7 @@
 block discarded – undo
29 29
     public function validate(mixed $input, array $context = []): Result
30 30
     {
31 31
         $result = $this->newEmptyValidationResult();
32
-        return $this->evaluate($input, $context) ? $result: $result->error($this->message);
32
+        return $this->evaluate($input, $context) ? $result : $result->error($this->message);
33 33
     }
34 34
 
35 35
     public function isValid($input, array $context = []): bool
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.