Passed
Push — master ( 7be948...8f2317 )
by Mohammed
03:50 queued 01:45
created
src/helpers/Handler.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -37,7 +37,7 @@
 block discarded – undo
37 37
             if (count($arr)>=3)
38 38
             {
39 39
                 $this->after_comma_array = [$arr[0], $arr[1]];
40
-            } else
40
+            }else
41 41
             {
42 42
                 $this->after_comma_array = $arr;
43 43
             }
Please login to merge, or discard this patch.
src/helpers/Calculators.php 2 patches
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -274,7 +274,7 @@  discard block
 block discarded – undo
274 274
 
275 275
             if (in_array($arr[1], [2, 1])) {
276 276
                             $million = $this->others[$arr[1]].$conn.$this->tens[$arr[0]];
277
-            } else {
277
+            }else {
278 278
                             $million = $this->ones[$arr[1]].$conn.$this->tens[$arr[0]];
279 279
             }
280 280
 
@@ -284,28 +284,28 @@  discard block
 block discarded – undo
284 284
                 {
285 285
                     $million = $this->ones[10];
286 286
                     $million .= ' '.$this->millions[39];
287
-                } else
287
+                }else
288 288
                 {
289 289
                     $million = $this->tens[$arr[0]];
290 290
                     $million .= ' '.$this->millions[1];
291 291
                 }
292 292
 
293
-            } else {
293
+            }else {
294 294
                 if ($arr[2] == 0 and $arr[3] == 0 and $arr[4] == 0)
295 295
                 {
296 296
                     $million .= ' '.$this->millions[1];
297
-                } else
297
+                }else
298 298
                 {
299 299
                     $million .= ' '.$this->millions[1199];
300 300
                 }
301 301
 
302 302
             }
303 303
 
304
-        } else
304
+        }else
305 305
         {
306 306
             if (in_array($arr[1], [2, 1])) {
307 307
                             $million = $this->others[$arr[1]].' ';
308
-            } else {
308
+            }else {
309 309
                             $million = $this->ones[$arr[1]].' ';
310 310
             }
311 311
 
@@ -341,7 +341,7 @@  discard block
 block discarded – undo
341 341
 
342 342
         if (in_array($arr[1], [2])) {
343 343
                     $million = $this->others[$arr[1]].$this->config['connection_tool'].$this->tens[$arr[0]];
344
-        } else {
344
+        }else {
345 345
                     $million = $this->ones[$arr[1]].$this->config['connection_tool'].$this->tens[$arr[0]];
346 346
         }
347 347
 
Please login to merge, or discard this patch.
Braces   +59 added lines, -44 removed lines patch added patch discarded remove patch
@@ -42,55 +42,67 @@  discard block
 block discarded – undo
42 42
 
43 43
 
44 44
 
45
-        if ($arr[0] == 0 and $arr[1] == 0)
46
-            return '';
45
+        if ($arr[0] == 0 and $arr[1] == 0) {
46
+                    return '';
47
+        }
47 48
 
48 49
 
49 50
 
50
-        if ($arr[0] == 0)
51
-            return $this->ones[$arr[1]];
51
+        if ($arr[0] == 0) {
52
+                    return $this->ones[$arr[1]];
53
+        }
52 54
 
53 55
 
54 56
 
55
-        if ($arr[0] == 1 and $arr[1] == 1)
56
-            return $this->ones[11];
57
+        if ($arr[0] == 1 and $arr[1] == 1) {
58
+                    return $this->ones[11];
59
+        }
57 60
 
58 61
 
59
-        if ($arr[0] == 1 and $arr[1] == 0)
60
-            return $this->ones[10];
62
+        if ($arr[0] == 1 and $arr[1] == 0) {
63
+                    return $this->ones[10];
64
+        }
61 65
 
62 66
 
63 67
 
64
-        if ($arr[1] == 0)
65
-            return $this->tens[$arr[0]];
68
+        if ($arr[1] == 0) {
69
+                    return $this->tens[$arr[0]];
70
+        }
66 71
 
67 72
 
68 73
 
69
-        if ($arr[0]>1)
70
-            return $this->ones[$arr[1]].$this->config['connection_tool'].$this->tens[$arr[0]];
74
+        if ($arr[0]>1) {
75
+                    return $this->ones[$arr[1]].$this->config['connection_tool'].$this->tens[$arr[0]];
76
+        }
71 77
 
72
-        if (in_array($arr[1], [1, 2]))
73
-                return $this->others[$arr[1]].' '.$this->tens[$arr[0]];
78
+        if (in_array($arr[1], [1, 2])) {
79
+                        return $this->others[$arr[1]].' '.$this->tens[$arr[0]];
80
+        }
74 81
 
75 82
         return $this->ones[$arr[1]].' '.$this->tens[$arr[0]];
76 83
     }
77 84
 
78 85
     public function classC($arr, $len = 3)
79 86
     {
80
-        if ($arr[0] == 0 and $arr[1] == 0 and $arr[2] == 0)
81
-            return '';
87
+        if ($arr[0] == 0 and $arr[1] == 0 and $arr[2] == 0) {
88
+                    return '';
89
+        }
82 90
 
83
-        if ($arr[0] == 0 and $arr[1] == 0)
84
-            return $this->ones[$arr[2]];
91
+        if ($arr[0] == 0 and $arr[1] == 0) {
92
+                    return $this->ones[$arr[2]];
93
+        }
85 94
 
86
-        if ($arr[0] == 0)
87
-            return $this->classB([$arr[1], $arr[2]]);
95
+        if ($arr[0] == 0) {
96
+                    return $this->classB([$arr[1], $arr[2]]);
97
+        }
88 98
 
89
-        if ($arr[2] == 0 and $arr[1] == 0)
90
-            return $this->hundreds[$arr[0]];
99
+        if ($arr[2] == 0 and $arr[1] == 0) {
100
+                    return $this->hundreds[$arr[0]];
101
+        }
91 102
 
92
-        if ($arr[1] != 0)
93
-            return $this->hundreds[$arr[0]].$this->config['connection_tool'].$this->classB([$arr[1], $arr[2]]);
103
+        if ($arr[1] != 0) {
104
+                    return $this->hundreds[$arr[0]].$this->config['connection_tool'].$this->classB([$arr[1], $arr[2]]);
105
+        }
94 106
 
95 107
         return $this->hundreds[$arr[0]].$this->config['connection_tool'].$this->classA([$arr[2]]);
96 108
     }
@@ -99,14 +111,16 @@  discard block
 block discarded – undo
99 111
     {
100 112
         $classC = [$arr[1], $arr[2], $arr[3]];
101 113
 
102
-        if ($arr[0]<=2)
103
-            $thousands = $this->thousands[$arr[0]];
104
-        else
105
-            $thousands = $this->ones[$arr[0]].' '.$this->thousands['39'];
114
+        if ($arr[0]<=2) {
115
+                    $thousands = $this->thousands[$arr[0]];
116
+        } else {
117
+                    $thousands = $this->ones[$arr[0]].' '.$this->thousands['39'];
118
+        }
106 119
 
107 120
 
108
-        if ($arr[1] == 0 and $arr[2] == 0 and $arr[3] == 0)
109
-                return $thousands;
121
+        if ($arr[1] == 0 and $arr[2] == 0 and $arr[3] == 0) {
122
+                        return $thousands;
123
+        }
110 124
 
111 125
         return $thousands.$this->config['connection_tool'].$this->classC($classC);
112 126
     }
@@ -126,7 +140,7 @@  discard block
 block discarded – undo
126 140
 
127 141
             if (in_array($arr[1], [2, 1])) {
128 142
                             $thousands = $this->others[$arr[1]].$conn.$this->tens[$arr[0]];
129
-            }else {
143
+            } else {
130 144
                             $thousands = $this->ones[$arr[1]].$conn.$this->tens[$arr[0]];
131 145
             }
132 146
 
@@ -136,28 +150,28 @@  discard block
 block discarded – undo
136 150
                 {
137 151
                     $thousands = $this->ones[10];
138 152
                     $thousands .= ' '.$this->thousands[39];
139
-                }else
153
+                } else
140 154
                 {
141 155
                     $thousands = $this->tens[$arr[0]];
142 156
                     $thousands .= ' '.$this->thousands[1];
143 157
                 }
144 158
 
145
-            }else {
159
+            } else {
146 160
                 if ($arr[2] == 0 and $arr[3] == 0 and $arr[4] == 0)
147 161
                 {
148 162
                     $thousands .= ' '.$this->thousands[1];
149
-                }else
163
+                } else
150 164
                 {
151 165
                     $thousands .= ' '.$this->thousands[1199];
152 166
                 }
153 167
 
154 168
             }
155 169
 
156
-        }else
170
+        } else
157 171
         {
158 172
             if (in_array($arr[1], [2, 1])) {
159 173
                             $thousands = $this->others[$arr[1]].' ';
160
-            }else {
174
+            } else {
161 175
                             $thousands = $this->ones[$arr[1]].' ';
162 176
             }
163 177
 
@@ -184,12 +198,12 @@  discard block
 block discarded – undo
184 198
             if ($arr[1] == 0 && $arr[2] == 0)
185 199
             {
186 200
                 $thousands = $this->hundreds[$arr[0]].' '.$this->thousands[1];
187
-            }else {
201
+            } else {
188 202
                 if ($arr[1] == 0)
189 203
                 {
190 204
                     $thousands = $this->hundreds[$arr[0]].$this->config['connection_tool'].
191 205
                         $this->ones[$arr[2]].' '.$this->thousands[1];
192
-                }elseif ($arr[2] == 0)
206
+                } elseif ($arr[2] == 0)
193 207
                 {
194 208
                     if ($arr[3] == 0 and $arr[4] == 0 and $arr[5] == 0)
195 209
                     {
@@ -197,12 +211,12 @@  discard block
 block discarded – undo
197 211
                         $thousands = $this->hundreds[$arr[0]].$this->config['connection_tool'].
198 212
                             $this->tens[$arr[1]].' '.$this->thousands[1];
199 213
 
200
-                    }else
214
+                    } else
201 215
                     {
202 216
                         $thousands = $this->hundreds[$arr[0]].$this->config['connection_tool'].
203 217
                             $this->tens[$arr[1]].' '.$this->thousands[1199];
204 218
                     }
205
-                }else
219
+                } else
206 220
                 {
207 221
 //                    $thousands_lang = $this->thousands[1199];
208 222
                     if ($arr[1] == 0 and $arr[2]>=1 and $arr[1]<=10) {
@@ -219,13 +233,14 @@  discard block
 block discarded – undo
219 233
                 }
220 234
             }
221 235
 
222
-        }else
236
+        } else
223 237
         {
224 238
             return $this->classE([$arr[1], $arr[2], $arr[3], $arr[4], $arr[5]]);
225 239
         }
226 240
 
227
-        if ($this->classC($classC) != '')
228
-                return $thousands.$this->config['connection_tool'].$this->classC($classC);
241
+        if ($this->classC($classC) != '') {
242
+                        return $thousands.$this->config['connection_tool'].$this->classC($classC);
243
+        }
229 244
         return $thousands;
230 245
 
231 246
     }
@@ -238,7 +253,7 @@  discard block
 block discarded – undo
238 253
 
239 254
         if ($arr[0]<=2) {
240 255
                     $million = $this->millions[$arr[0]];
241
-        }else {
256
+        } else {
242 257
                     $million = $this->ones[$arr[0]].' '.$this->millions['39'];
243 258
         }
244 259
 
Please login to merge, or discard this patch.
src/helpers/Validation.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -12,7 +12,7 @@
 block discarded – undo
12 12
     	
13 13
         if (is_numeric($this->parsed_number)) {
14 14
                     return $this;
15
-        } else {
15
+        }else {
16 16
                     die('is not right number ');
17 17
         }
18 18
     }
Please login to merge, or discard this patch.
src/helpers/App.php 1 patch
Braces   +27 added lines, -18 removed lines patch added patch discarded remove patch
@@ -32,36 +32,45 @@
 block discarded – undo
32 32
 
33 33
     public function detectClass($len)
34 34
     {
35
-        if ($len == 1)
36
-                return "A";
35
+        if ($len == 1) {
36
+                        return "A";
37
+        }
37 38
 
38 39
 
39
-        if ($len == 2)
40
-            return "B";
40
+        if ($len == 2) {
41
+                    return "B";
42
+        }
41 43
 
42 44
 
43
-        if ($len == 3)
44
-            return "C";
45
+        if ($len == 3) {
46
+                    return "C";
47
+        }
45 48
 
46 49
 
47
-        if ($len == 4)
48
-            return "D";
50
+        if ($len == 4) {
51
+                    return "D";
52
+        }
49 53
 
50 54
 
51
-        if ($len == 5)
52
-            return "E";
55
+        if ($len == 5) {
56
+                    return "E";
57
+        }
53 58
 
54
-        if ($len == 6)
55
-            return "F";
59
+        if ($len == 6) {
60
+                    return "F";
61
+        }
56 62
 
57
-        if ($len == 7)
58
-            return "G";
63
+        if ($len == 7) {
64
+                    return "G";
65
+        }
59 66
 
60
-        if ($len == 8)
61
-            return "H";
67
+        if ($len == 8) {
68
+                    return "H";
69
+        }
62 70
 
63
-        if ($len == 9)
64
-            return "I";
71
+        if ($len == 9) {
72
+                    return "I";
73
+        }
65 74
 
66 75
     }
67 76
 }
68 77
\ No newline at end of file
Please login to merge, or discard this patch.
src/Tafqeet.php 1 patch
Braces   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -110,7 +110,7 @@  discard block
 block discarded – undo
110 110
             if ($this->is_main1_currency) {
111 111
                 $result .= $this->result_before_comma.' '.$this->config['currencies'][$currency]['main1'];
112 112
 
113
-            }else {
113
+            } else {
114 114
                 $result .= $this->result_before_comma.' '.$this->config['currencies'][$currency]['main2'];
115 115
 
116 116
             }
@@ -120,7 +120,7 @@  discard block
 block discarded – undo
120 120
                 ])) {
121 121
                     $result .= $this->config['connection_tool'].$this->result_after_comma.' '.
122 122
                         $this->config['currencies'][$currency]['multi'];
123
-                }else {
123
+                } else {
124 124
                     $result .= $this->config['connection_tool'].$this->result_after_comma.' '.
125 125
                         $this->config['currencies'][$currency]['single'];
126 126
                 }
Please login to merge, or discard this patch.