Passed
Push — main ( 24bc4d...58ff1e )
by Breno
02:00 queued 27s
created
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/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/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.
src/RuleSetFactory.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -16,7 +16,7 @@  discard block
 block discarded – undo
16 16
      * @return RuleSet[]
17 17
      * @throws ReflectionException if the class does not exist
18 18
      */
19
-    public static function fromProperties(string|object $objectOrClass, ?int $filter = null): array
19
+    public static function fromProperties(string | object $objectOrClass, ?int $filter = null): array
20 20
     {
21 21
         $ruleSets = [];
22 22
         foreach ((new ReflectionClass($objectOrClass))->getProperties($filter) as $property) {
@@ -32,7 +32,7 @@  discard block
 block discarded – undo
32 32
      * @return RuleSet[]
33 33
      * @throws ReflectionException
34 34
      */
35
-    public static function fromMethods(string|object $objectOrClass, ?int $filter = null): array
35
+    public static function fromMethods(string | object $objectOrClass, ?int $filter = null): array
36 36
     {
37 37
         $ruleSets = [];
38 38
         foreach ((new ReflectionClass($objectOrClass))->getMethods($filter) as $method) {
@@ -48,7 +48,7 @@  discard block
 block discarded – undo
48 48
      * @return RuleSet
49 49
      * @throws ReflectionException if the class or property does not exist.
50 50
      */
51
-    public static function fromProperty(string|object $objectOrClass, string $property): RuleSet
51
+    public static function fromProperty(string | object $objectOrClass, string $property): RuleSet
52 52
     {
53 53
         return self::fromReflectionProperty(new ReflectionProperty($objectOrClass, $property));
54 54
     }
@@ -59,7 +59,7 @@  discard block
 block discarded – undo
59 59
      * @return RuleSet
60 60
      * @throws ReflectionException
61 61
      */
62
-    public static function fromMethod(string|object $objectOrClass, string $method): RuleSet
62
+    public static function fromMethod(string | object $objectOrClass, string $method): RuleSet
63 63
     {
64 64
         return self::fromReflectionMethod(new ReflectionMethod($objectOrClass, $method));
65 65
     }
Please login to merge, or discard this patch.
src/Rules/Brazilian/DigitoVerificador.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -32,7 +32,7 @@  discard block
 block discarded – undo
32 32
         $number = substr($stringInput, 0, -1);
33 33
         $digit = (int) substr($stringInput, -1);
34 34
         return
35
-            $digit === match ($this->algorithm) {
35
+            $digit === match($this->algorithm) {
36 36
                 self::MOD11 => self::mod11($number),
37 37
                 self::MOD10 => self::mod10($number),
38 38
                 default => throw new InvalidArgumentException('Algoritmo de cálculo de dígito inválido')
@@ -49,7 +49,7 @@  discard block
 block discarded – undo
49 49
             $sum += $number * $factor[$i++ % $size];
50 50
         }
51 51
 
52
-        $mod11 = ($sum * 10 ) % 11;
52
+        $mod11 = ($sum * 10) % 11;
53 53
         return $modReturn[$mod11] ?? 11 - $mod11;
54 54
     }
55 55
 
@@ -75,8 +75,8 @@  discard block
 block discarded – undo
75 75
 
76 76
         $modReturn = [0 => 0, 1 => 0];
77 77
         $digit1 = DigitoVerificador::mod11($number, $modReturn);
78
-        $digit2 = DigitoVerificador::mod11($number . $digit1, $modReturn);
78
+        $digit2 = DigitoVerificador::mod11($number.$digit1, $modReturn);
79 79
 
80
-        return $digits === ($digit1 . $digit2);
80
+        return $digits === ($digit1.$digit2);
81 81
     }
82 82
 }
Please login to merge, or discard this patch.
src/RuleChainTrait.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -18,11 +18,11 @@
 block discarded – undo
18 18
  */
19 19
 trait RuleChainTrait
20 20
 {
21
-    abstract public function add(Rule|RuleSet ...$rules): static;
21
+    abstract public function add(Rule | RuleSet ...$rules): static;
22 22
 
23 23
     public function __call($name, $arguments): static
24 24
     {
25
-        $namespace = __NAMESPACE__ . '\\Rules';
25
+        $namespace = __NAMESPACE__.'\\Rules';
26 26
         $class = sprintf("%s\%s", $namespace, ucfirst($name));
27 27
         if (!class_exists($class)) {
28 28
             throw new RuntimeException(sprintf('Rule not found: (%s).', $name));
Please login to merge, or discard this patch.