@@ -42,55 +42,67 @@ discard block |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 | |
@@ -32,36 +32,45 @@ |
||
| 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 |
@@ -110,7 +110,7 @@ discard block |
||
| 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 |
||
| 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 | } |