Passed
Pull Request — 1.x (#44)
by Milwad
03:20
created
src/Rules/ValidImei.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -23,7 +23,7 @@  discard block
 block discarded – undo
23 23
 
24 24
         $digits = str_split($imei); // Get digits
25 25
         $imei_last = array_pop($digits); // Remove last digit, and store it
26
-        $log = [];
26
+        $log = [ ];
27 27
 
28 28
         foreach ($digits as $key => $n) {
29 29
             if ($key & 1) {
@@ -31,7 +31,7 @@  discard block
 block discarded – undo
31 31
                 $n = array_sum($double); // Sum double digits
32 32
             }
33 33
 
34
-            $log[] = $n; // Append log
34
+            $log[ ] = $n; // Append log
35 35
         }
36 36
         $sum = array_sum($log) * 9; // Sum log & multiply by 9
37 37
 
Please login to merge, or discard this patch.
src/Rules/ValidJalaliDate.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -16,7 +16,7 @@
 block discarded – undo
16 16
      */
17 17
     public function passes($attribute, $value)
18 18
     {
19
-        if (! is_string($value)) {
19
+        if ( ! is_string($value)) {
20 20
             return false;
21 21
         }
22 22
 
Please login to merge, or discard this patch.
src/Rules/ValidCartNumberIran.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -18,7 +18,7 @@
 block discarded – undo
18 18
         $cardToArr = str_split($value);
19 19
         $cardTotal = 0;
20 20
         for ($i = 0; $i < 16; $i++) {
21
-            $c = (int) $cardToArr[$i];
21
+            $c = (int) $cardToArr[ $i ];
22 22
             if ($i % 2 === 0) {
23 23
                 $cardTotal += (($c * 2 > 9) ? ($c * 2) - 9 : ($c * 2));
24 24
             } else {
Please login to merge, or discard this patch.
src/Rules/ValidNationalCard.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -15,7 +15,7 @@
 block discarded – undo
15 15
      */
16 16
     public function passes($attribute, $value)
17 17
     {
18
-        if (! preg_match('/^\d{10}$/', $value)) {
18
+        if ( ! preg_match('/^\d{10}$/', $value)) {
19 19
             return false;
20 20
         }
21 21
 
Please login to merge, or discard this patch.
src/LaravelValidateServiceProvider.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -82,8 +82,8 @@
 block discarded – undo
82 82
      */
83 83
     private function loadValidations()
84 84
     {
85
-        foreach (config('laravel-validate.rules', []) as $rule) {
86
-            Validator::extend('validate-'.$rule['name'], function ($attribute, $value, $parameters, $validator) use ($rule) {
85
+        foreach (config('laravel-validate.rules', [ ]) as $rule) {
86
+            Validator::extend('validate-'.$rule[ 'name' ], function($attribute, $value, $parameters, $validator) use ($rule) {
87 87
                 $rule = new $rule(...$parameters);
88 88
 
89 89
                 return $rule->passes($attribute, $value);
Please login to merge, or discard this patch.
src/Rules/ValidIban.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -161,9 +161,9 @@  discard block
 block discarded – undo
161 161
      *
162 162
      * @var string|null
163 163
      */
164
-    private string|null $country;
164
+    private string | null $country;
165 165
 
166
-    public function __construct(string|null $country = null) // TODO: Add $country into the progress
166
+    public function __construct(string | null $country = null) // TODO: Add $country into the progress
167 167
     {
168 168
         $this->country = $country;
169 169
     }
@@ -177,14 +177,14 @@  discard block
 block discarded – undo
177 177
      */
178 178
     public function passes($attribute, $value)
179 179
     {
180
-        if (!$this->isIbanValid($value)) {
180
+        if ( ! $this->isIbanValid($value)) {
181 181
             return false;
182 182
         }
183 183
 
184 184
         /*
185 185
          * Connect Iban title with value (code) ex: 8330001234567NO .
186 186
          */
187
-        $parsedIban = substr($value, 4) . substr($value, 0, 4);
187
+        $parsedIban = substr($value, 4).substr($value, 0, 4);
188 188
 
189 189
         /*
190 190
          * Replace iban value with character map.
@@ -217,6 +217,6 @@  discard block
 block discarded – undo
217 217
         return ! empty($iban)
218 218
             || function_exists('bcmod') // Check `bcmod` is exists
219 219
             || ctype_alpha(substr($iban, 0, 2)) //
220
-            || strlen($iban) !== $this->ibanLengthByCountry[$countryCode];
220
+            || strlen($iban) !== $this->ibanLengthByCountry[ $countryCode ];
221 221
     }
222 222
 }
Please login to merge, or discard this patch.