Conditions | 2 |
Paths | 2 |
Total Lines | 9 |
Code Lines | 6 |
Lines | 0 |
Ratio | 0 % |
Changes | 2 | ||
Bugs | 1 | Features | 0 |
1 | <?php |
||
10 | public function runBeforeComma() |
||
11 | { |
||
12 | $number = null; |
||
13 | for ($i=0; $i < count($this->before_comma_array); $i++){ |
||
|
|||
14 | $num = $this->before_comma_array[$i]; |
||
15 | $number = $number.$num; |
||
16 | }; |
||
17 | $f = new \NumberFormatter("ar", \NumberFormatter::SPELLOUT); |
||
18 | return $f->format($number); |
||
19 | } |
||
69 |
If the size of the collection does not change during the iteration, it is generally a good practice to compute it beforehand, and not on each iteration: