Test Failed
Pull Request — 1.x (#84)
by
unknown
05:27 queued 01:54
created
src/Traits/IbanTrait.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -12,17 +12,17 @@  discard block
 block discarded – undo
12 12
     private function setCountries(?array $countries)
13 13
     {
14 14
         if (empty($countries)) {
15
-            $this->countries = [];
15
+            $this->countries = [ ];
16 16
 
17 17
             return;
18 18
         }
19 19
 
20
-        if (is_array($countries[0])) {
21
-            $countries = $countries[0];
20
+        if (is_array($countries[ 0 ])) {
21
+            $countries = $countries[ 0 ];
22 22
         }
23 23
 
24 24
         foreach ($countries as $country) {
25
-            $this->countries[] = $country;
25
+            $this->countries[ ] = $country;
26 26
         }
27 27
     }
28 28
 
@@ -33,7 +33,7 @@  discard block
 block discarded – undo
33 33
      */
34 34
     private function isIbanValid(string $iban)
35 35
     {
36
-        if (! $this->checkIbanFormat($iban)) {
36
+        if ( ! $this->checkIbanFormat($iban)) {
37 37
             return false;
38 38
         }
39 39
 
@@ -127,7 +127,7 @@  discard block
 block discarded – undo
127 127
     private function isCountryValid(string $country, string $ibanCountryCode)
128 128
     {
129 129
         return ! empty($country)
130
-            && isset($this->ibanLengthByCountry[$country])
130
+            && isset($this->ibanLengthByCountry[ $country ])
131 131
             && $ibanCountryCode === $country;
132 132
     }
133 133
 
@@ -138,6 +138,6 @@  discard block
 block discarded – undo
138 138
      */
139 139
     private function isIbanLengthValid(string $iban, string $ibanCountryCode)
140 140
     {
141
-        return strlen($iban) === $this->ibanLengthByCountry[$ibanCountryCode];
141
+        return strlen($iban) === $this->ibanLengthByCountry[ $ibanCountryCode ];
142 142
     }
143 143
 }
Please login to merge, or discard this patch.
src/Utils/CountryPhoneCallback.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -196,7 +196,7 @@  discard block
 block discarded – undo
196 196
      */
197 197
     public function callPhoneValidator(): array
198 198
     {
199
-        $results = [];
199
+        $results = [ ];
200 200
         $codes = explode(',', $this->code);
201 201
         $codes = array_map('strtoupper', $codes);
202 202
 
@@ -204,7 +204,7 @@  discard block
 block discarded – undo
204 204
             $methodName = 'validate'.$code;
205 205
 
206 206
             if (method_exists($this, $methodName)) {
207
-                $results[$code] = $this->{$methodName}();
207
+                $results[ $code ] = $this->{$methodName}();
208 208
             } else {
209 209
                 throw new \BadMethodCallException("Validator method '{$methodName}' does not exist.");
210 210
             }
Please login to merge, or discard this patch.
src/Rules/ValidUrl.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -17,7 +17,7 @@
 block discarded – undo
17 17
      */
18 18
     public function validate(string $attribute, mixed $value, Closure $fail): void
19 19
     {
20
-        if (! preg_match('/https?:\/\/(www\.)?[-a-zA-Z0-9@:%._\+~#=]{1,256}\.[a-zA-Z0-9()]{1,6}\b([-a-zA-Z0-9()!@:%_\+.~#?&\/\/=]*)/', $value)) {
20
+        if ( ! preg_match('/https?:\/\/(www\.)?[-a-zA-Z0-9@:%._\+~#=]{1,256}\.[a-zA-Z0-9()]{1,6}\b([-a-zA-Z0-9()!@:%_\+.~#?&\/\/=]*)/', $value)) {
21 21
 
22 22
             $fail('validate.url')->translate();
23 23
         }
Please login to merge, or discard this patch.
src/Rules/ValidIban.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -166,7 +166,7 @@  discard block
 block discarded – undo
166 166
      */
167 167
     private array $countries;
168 168
 
169
-    public function __construct(array|string $countries = [])
169
+    public function __construct(array | string $countries = [ ])
170 170
     {
171 171
         $this->setCountries(func_get_args());
172 172
     }
@@ -181,7 +181,7 @@  discard block
 block discarded – undo
181 181
      */
182 182
     public function validate(string $attribute, mixed $value, Closure $fail): void
183 183
     {
184
-        if (! $this->isIbanValid($value)) {
184
+        if ( ! $this->isIbanValid($value)) {
185 185
 
186 186
             $fail('validate.iban')->translate();
187 187
         }
Please login to merge, or discard this patch.
src/Rules/ValidImei.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -17,7 +17,7 @@  discard block
 block discarded – undo
17 17
      */
18 18
     public function validate(string $attribute, mixed $value, Closure $fail): void
19 19
     {
20
-        if (! $this->isImeiValid($value)) {
20
+        if ( ! $this->isImeiValid($value)) {
21 21
 
22 22
             $fail('validate.imei')->translate();
23 23
         }
@@ -39,7 +39,7 @@  discard block
 block discarded – undo
39 39
 
40 40
         $digits = str_split($imei); // Get digits
41 41
         $imei_last = array_pop($digits); // Remove last digit, and store it
42
-        $log = [];
42
+        $log = [ ];
43 43
 
44 44
         foreach ($digits as $key => $n) {
45 45
             if ($key & 1) {
@@ -47,7 +47,7 @@  discard block
 block discarded – undo
47 47
                 $n = array_sum($double); // Sum double digits
48 48
             }
49 49
 
50
-            $log[] = $n; // Append log
50
+            $log[ ] = $n; // Append log
51 51
         }
52 52
         $sum = array_sum($log) * 9; // Sum log & multiply by 9
53 53
 
Please login to merge, or discard this patch.
src/Rules/ValidCarNumber.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -17,7 +17,7 @@
 block discarded – undo
17 17
      */
18 18
     public function validate(string $attribute, mixed $value, Closure $fail): void
19 19
     {
20
-        if (! preg_match('/^[A-Z]{2}[0-9]{2}[A-Z]{2}[0-9]{4}$/', $value)) {
20
+        if ( ! preg_match('/^[A-Z]{2}[0-9]{2}[A-Z]{2}[0-9]{4}$/', $value)) {
21 21
 
22 22
             $fail('validate.car-number')->translate();
23 23
         }
Please login to merge, or discard this patch.
src/Rules/ValidSlashEndOfString.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -17,7 +17,7 @@
 block discarded – undo
17 17
      */
18 18
     public function validate(string $attribute, mixed $value, Closure $fail): void
19 19
     {
20
-        if (! preg_match('/\/+$/', $value)) {
20
+        if ( ! preg_match('/\/+$/', $value)) {
21 21
 
22 22
             $fail('validate.slash-end-of-string')->translate();
23 23
         }
Please login to merge, or discard this patch.
src/Rules/ValidKebabCase.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -17,7 +17,7 @@
 block discarded – undo
17 17
      */
18 18
     public function validate(string $attribute, mixed $value, Closure $fail): void
19 19
     {
20
-        if (! preg_match('/^(?:\p{Ll}+\-)*\p{Ll}+$/u', $value)) {
20
+        if ( ! preg_match('/^(?:\p{Ll}+\-)*\p{Ll}+$/u', $value)) {
21 21
 
22 22
             $fail('validate.kebab-case')->translate();
23 23
         }
Please login to merge, or discard this patch.
src/Rules/ValidUlid.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -17,7 +17,7 @@
 block discarded – undo
17 17
      */
18 18
     public function validate(string $attribute, mixed $value, Closure $fail): void
19 19
     {
20
-        if (! preg_match('/[0-7][0-9A-HJKMNP-TV-Z]{25}/', $value)) {
20
+        if ( ! preg_match('/[0-7][0-9A-HJKMNP-TV-Z]{25}/', $value)) {
21 21
 
22 22
             $fail('validate.ulid')->translate();
23 23
         }
Please login to merge, or discard this patch.