Passed
Push — main ( 08ada0...2628b8 )
by Breno
01:54
created
src/ValidationSet.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -23,7 +23,7 @@  discard block
 block discarded – undo
23 23
 
24 24
     private SplObjectStorage $rules;
25 25
 
26
-    final public function __construct(?string $field = null, Validation|ValidationSet ...$rules)
26
+    final public function __construct(?string $field = null, Validation | ValidationSet ...$rules)
27 27
     {
28 28
         $this->rules = new SplObjectStorage();
29 29
         $this->setField($field);
@@ -35,17 +35,17 @@  discard block
 block discarded – undo
35 35
         return new self;
36 36
     }
37 37
 
38
-    public static function forField(string $field, Validation|ValidationSet ...$rules): self
38
+    public static function forField(string $field, Validation | ValidationSet ...$rules): self
39 39
     {
40 40
         return new self($field, ...$rules);
41 41
     }
42 42
 
43
-    public static function withRules(Validation|ValidationSet $validation, Validation|ValidationSet ...$rules): self
43
+    public static function withRules(Validation | ValidationSet $validation, Validation | ValidationSet ...$rules): self
44 44
     {
45 45
         return new self(null, $validation, ...$rules);
46 46
     }
47 47
 
48
-    public function add(Validation|ValidationSet ...$rules): self
48
+    public function add(Validation | ValidationSet ...$rules): self
49 49
     {
50 50
         foreach ($rules as $rule) {
51 51
             if ($rule instanceof Validation) {
@@ -60,7 +60,7 @@  discard block
 block discarded – undo
60 60
         return $this;
61 61
     }
62 62
 
63
-    public function validate(mixed $input, array $context = []): ValidationResult|ValidationResultByField
63
+    public function validate(mixed $input, array $context = []): ValidationResult | ValidationResultByField
64 64
     {
65 65
         $violations = $this->newEmptyValidationResult();
66 66
         if (null === $input && $this->allowsNull()) {
@@ -149,7 +149,7 @@  discard block
 block discarded – undo
149 149
      * @return ValidationSet[]
150 150
      * @throws ReflectionException if the class does not exist
151 151
      */
152
-    public static function fromProperties(string|object $objectOrClass, ?int $filter = null): array
152
+    public static function fromProperties(string | object $objectOrClass, ?int $filter = null): array
153 153
     {
154 154
         $ruleSets = [];
155 155
         foreach ((new ReflectionClass($objectOrClass))->getProperties($filter) as $property) {
@@ -165,7 +165,7 @@  discard block
 block discarded – undo
165 165
      * @return ValidationSet[]
166 166
      * @throws ReflectionException
167 167
      */
168
-    public static function fromMethods(string|object $objectOrClass, ?int $filter = null): array
168
+    public static function fromMethods(string | object $objectOrClass, ?int $filter = null): array
169 169
     {
170 170
         $ruleSets = [];
171 171
         foreach ((new ReflectionClass($objectOrClass))->getMethods($filter) as $method) {
@@ -181,12 +181,12 @@  discard block
 block discarded – undo
181 181
      * @return static
182 182
      * @throws ReflectionException if the class or property does not exist.
183 183
      */
184
-    public static function fromProperty(string|object $objectOrClass, string $property): self
184
+    public static function fromProperty(string | object $objectOrClass, string $property): self
185 185
     {
186 186
         return self::fromReflectionProperty(new ReflectionProperty($objectOrClass, $property));
187 187
     }
188 188
 
189
-    public static function fromMethod(string|object $objectOrClass, string $method): self
189
+    public static function fromMethod(string | object $objectOrClass, string $method): self
190 190
     {
191 191
         return self::fromReflectionMethod(new ReflectionMethod($objectOrClass, $method));
192 192
     }
Please login to merge, or discard this patch.