Passed
Push — master ( f3f318...0ca85e )
by Mohammed
09:08 queued 07:19
created
src/helpers/Calculators.php 2 patches
Spacing   +36 added lines, -36 removed lines patch added patch discarded remove patch
@@ -13,7 +13,7 @@  discard block
 block discarded – undo
13 13
 
14 14
     public function classB($arr, $len = 2)
15 15
     {
16
-        if ($this->before_comma_len >= 2) {
16
+        if ($this->before_comma_len>=2) {
17 17
             $ten_number_index = $this->before_comma_len - 2;
18 18
             $single_number_index = $this->before_comma_len - 1;
19 19
             $detecd_array = [
@@ -21,11 +21,11 @@  discard block
 block discarded – undo
21 21
                 $this->before_comma_array[$single_number_index],
22 22
             ];
23 23
             if ($arr == $detecd_array) {
24
-                if ($arr[0] == 0 and $arr[1] >= 1 and $arr[1] <= 10) {
24
+                if ($arr[0] == 0 and $arr[1]>=1 and $arr[1]<=10) {
25 25
                     $this->is_main1_currency = true;
26
-                } elseif ($arr[0] >= 1 and $arr[1] >= 1 and $arr[1] <= 9) {
26
+                } elseif ($arr[0]>=1 and $arr[1]>=1 and $arr[1]<=9) {
27 27
                     $this->is_main1_currency = false;
28
-                } elseif ($arr[0] >= 2) {
28
+                } elseif ($arr[0]>=2) {
29 29
                     $this->is_main1_currency = false;
30 30
                 }
31 31
             }
@@ -51,7 +51,7 @@  discard block
 block discarded – undo
51 51
             return $this->tens[$arr[0]];
52 52
         }
53 53
 
54
-        if ($arr[0] > 1) {
54
+        if ($arr[0]>1) {
55 55
             return $this->ones[$arr[1]].$this->config['connection_tool'].$this->tens[$arr[0]];
56 56
         }
57 57
 
@@ -91,9 +91,9 @@  discard block
 block discarded – undo
91 91
     {
92 92
         $classC = [$arr[1], $arr[2], $arr[3]];
93 93
 
94
-        if ($arr[0] <= 2) {
94
+        if ($arr[0]<=2) {
95 95
             $thousands = $this->thousands[$arr[0]];
96
-        } else {
96
+        }else {
97 97
             $thousands = $this->ones[$arr[0]].' '.$this->thousands['39'];
98 98
         }
99 99
 
@@ -111,13 +111,13 @@  discard block
 block discarded – undo
111 111
         if ($arr[0] != 0) {
112 112
             $conn = ' ';
113 113
 
114
-            if ($arr[1] >= 2 and $arr[0] > 1) {
114
+            if ($arr[1]>=2 and $arr[0]>1) {
115 115
                 $conn = $this->config['connection_tool'];
116 116
             }
117 117
 
118 118
             if (in_array($arr[1], [2, 1])) {
119 119
                 $thousands = $this->others[$arr[1]].$conn.$this->tens[$arr[0]];
120
-            } else {
120
+            }else {
121 121
                 $thousands = $this->ones[$arr[1]].$conn.$this->tens[$arr[0]];
122 122
             }
123 123
 
@@ -125,21 +125,21 @@  discard block
 block discarded – undo
125 125
                 if ($arr[0] == 1) {
126 126
                     $thousands = $this->ones[10];
127 127
                     $thousands .= ' '.$this->thousands[39];
128
-                } else {
128
+                }else {
129 129
                     $thousands = $this->tens[$arr[0]];
130 130
                     $thousands .= ' '.$this->thousands[1];
131 131
                 }
132
-            } else {
132
+            }else {
133 133
                 if ($arr[2] == 0 and $arr[3] == 0 and $arr[4] == 0) {
134 134
                     $thousands .= ' '.$this->thousands[1];
135
-                } else {
135
+                }else {
136 136
                     $thousands .= ' '.$this->thousands[1199];
137 137
                 }
138 138
             }
139
-        } else {
139
+        }else {
140 140
             if (in_array($arr[1], [2, 1])) {
141 141
                 $thousands = $this->others[$arr[1]].' ';
142
-            } else {
142
+            }else {
143 143
                 $thousands = $this->ones[$arr[1]].' ';
144 144
             }
145 145
 
@@ -162,7 +162,7 @@  discard block
 block discarded – undo
162 162
         if ($arr[0] != 0) {
163 163
             if ($arr[1] == 0 && $arr[2] == 0) {
164 164
                 $thousands = $this->hundreds[$arr[0]].' '.$this->thousands[1];
165
-            } else {
165
+            }else {
166 166
                 if ($arr[1] == 0) {
167 167
                     $thousands = $this->hundreds[$arr[0]].$this->config['connection_tool'].
168 168
                         $this->ones[$arr[2]].' '.$this->thousands[1];
@@ -170,24 +170,24 @@  discard block
 block discarded – undo
170 170
                     if ($arr[3] == 0 and $arr[4] == 0 and $arr[5] == 0) {
171 171
                         $thousands = $this->hundreds[$arr[0]].$this->config['connection_tool'].
172 172
                             $this->tens[$arr[1]].' '.$this->thousands[1];
173
-                    } else {
173
+                    }else {
174 174
                         $thousands = $this->hundreds[$arr[0]].$this->config['connection_tool'].
175 175
                             $this->tens[$arr[1]].' '.$this->thousands[1199];
176 176
                     }
177
-                } else {
177
+                }else {
178 178
 //                    $thousands_lang = $this->thousands[1199];
179
-                    if ($arr[1] == 0 and $arr[2] >= 1 and $arr[1] <= 10) {
179
+                    if ($arr[1] == 0 and $arr[2]>=1 and $arr[1]<=10) {
180 180
                         $thousands_lang = $this->thousands[1];
181
-                    } elseif ($arr[1] >= 1 and $arr[2] >= 1 and $arr[1] <= 9) {
181
+                    } elseif ($arr[1]>=1 and $arr[2]>=1 and $arr[1]<=9) {
182 182
                         $thousands_lang = $this->thousands[1199];
183
-                    } elseif ($arr[1] >= 2) {
183
+                    } elseif ($arr[1]>=2) {
184 184
                         $thousands_lang = $this->thousands[1199];
185 185
                     }
186 186
 
187 187
                     $thousands = $this->classC([$arr[0], $arr[1], $arr[2]], 3).' '.$thousands_lang;
188 188
                 }
189 189
             }
190
-        } else {
190
+        }else {
191 191
             return $this->classE([$arr[1], $arr[2], $arr[3], $arr[4], $arr[5]]);
192 192
         }
193 193
 
@@ -198,20 +198,20 @@  discard block
 block discarded – undo
198 198
         return $thousands;
199 199
     }
200 200
 
201
-    public function classG($arr,$len = 7)
201
+    public function classG($arr, $len = 7)
202 202
     {
203 203
         //dd($arr,$len);
204 204
         //$classC = [$arr[2],$arr[4],$arr[5]];
205
-        $classC = [$arr[1],$arr[2],$arr[3]];
205
+        $classC = [$arr[1], $arr[2], $arr[3]];
206 206
         //$classE = [$arr[1],$arr[2],$arr[3],$arr[4],$arr[5],$arr[6]];
207 207
 
208
-        if($arr[0]<=2)
209
-            $million = $this->millions[$arr[0]] ;
208
+        if ($arr[0]<=2)
209
+            $million = $this->millions[$arr[0]];
210 210
         else
211
-            $million = $this->ones[$arr[0]] . ' ' . $this->millions['39'];
211
+            $million = $this->ones[$arr[0]].' '.$this->millions['39'];
212 212
 
213
-        if($this->classC($classC)!='')
214
-            return $million . $this->config['connection_tool'] . $this->classC($classC);
213
+        if ($this->classC($classC) != '')
214
+            return $million.$this->config['connection_tool'].$this->classC($classC);
215 215
         return $million;
216 216
     }
217 217
 
@@ -237,13 +237,13 @@  discard block
 block discarded – undo
237 237
         if ($arr[0] != 0) {
238 238
             $conn = ' ';
239 239
 
240
-            if ($arr[1] >= 2 and $arr[0] > 1) {
240
+            if ($arr[1]>=2 and $arr[0]>1) {
241 241
                 $conn = $this->config['connection_tool'];
242 242
             }
243 243
 
244 244
             if (in_array($arr[1], [2, 1])) {
245 245
                 $million = $this->others[$arr[1]].$conn.$this->tens[$arr[0]];
246
-            } else {
246
+            }else {
247 247
                 $million = $this->ones[$arr[1]].$conn.$this->tens[$arr[0]];
248 248
             }
249 249
 
@@ -251,21 +251,21 @@  discard block
 block discarded – undo
251 251
                 if ($arr[0] == 1) {
252 252
                     $million = $this->ones[10];
253 253
                     $million .= ' '.$this->millions[39];
254
-                } else {
254
+                }else {
255 255
                     $million = $this->tens[$arr[0]];
256 256
                     $million .= ' '.$this->millions[1];
257 257
                 }
258
-            } else {
258
+            }else {
259 259
                 if ($arr[2] == 0 and $arr[3] == 0 and $arr[4] == 0) {
260 260
                     $million .= ' '.$this->millions[1];
261
-                } else {
261
+                }else {
262 262
                     $million .= ' '.$this->millions[1199];
263 263
                 }
264 264
             }
265
-        } else {
265
+        }else {
266 266
             if (in_array($arr[1], [2, 1])) {
267 267
                 $million = $this->others[$arr[1]].' ';
268
-            } else {
268
+            }else {
269 269
                 $million = $this->ones[$arr[1]].' ';
270 270
             }
271 271
 
@@ -298,7 +298,7 @@  discard block
 block discarded – undo
298 298
 
299 299
         if (in_array($arr[1], [2])) {
300 300
             $million = $this->others[$arr[1]].$this->config['connection_tool'].$this->tens[$arr[0]];
301
-        } else {
301
+        }else {
302 302
             $million = $this->ones[$arr[1]].$this->config['connection_tool'].$this->tens[$arr[0]];
303 303
         }
304 304
 
Please login to merge, or discard this patch.
Braces   +8 added lines, -6 removed lines patch added patch discarded remove patch
@@ -205,13 +205,15 @@
 block discarded – undo
205 205
         $classC = [$arr[1],$arr[2],$arr[3]];
206 206
         //$classE = [$arr[1],$arr[2],$arr[3],$arr[4],$arr[5],$arr[6]];
207 207
 
208
-        if($arr[0]<=2)
209
-            $million = $this->millions[$arr[0]] ;
210
-        else
211
-            $million = $this->ones[$arr[0]] . ' ' . $this->millions['39'];
208
+        if($arr[0]<=2) {
209
+                    $million = $this->millions[$arr[0]] ;
210
+        } else {
211
+                    $million = $this->ones[$arr[0]] . ' ' . $this->millions['39'];
212
+        }
212 213
 
213
-        if($this->classC($classC)!='')
214
-            return $million . $this->config['connection_tool'] . $this->classC($classC);
214
+        if($this->classC($classC)!='') {
215
+                    return $million . $this->config['connection_tool'] . $this->classC($classC);
216
+        }
215 217
         return $million;
216 218
     }
217 219
 
Please login to merge, or discard this patch.