| Conditions | 5 |
| Paths | 7 |
| Total Lines | 26 |
| Code Lines | 20 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 1 |
| 1 | <?php |
||
| 56 | function __toString() |
||
| 57 | { |
||
| 58 | $string = ''; |
||
| 59 | $first = true; |
||
| 60 | foreach ($this->sums as $currency_id => $sum) { |
||
| 61 | if ($first) { |
||
| 62 | $first = false; |
||
| 63 | } else { |
||
| 64 | $string.= '<br />'; |
||
| 65 | } |
||
| 66 | $string.= '<span style="white-space:nowrap;">'; |
||
| 67 | $string.= number_format($sum, 2, '.', ' '); |
||
| 68 | if (\App::$cur->money) { |
||
| 69 | $currency = \Money\Currency::get($currency_id); |
||
| 70 | if ($currency) { |
||
| 71 | $string.= ' ' . $currency->acronym(); |
||
| 72 | } else { |
||
| 73 | $string.= ' руб.'; |
||
| 74 | } |
||
| 75 | } else { |
||
| 76 | $string.= ' руб.'; |
||
| 77 | } |
||
| 78 | $string.= '</span>'; |
||
| 79 | } |
||
| 80 | return $string; |
||
| 81 | } |
||
| 82 | |||
| 84 |
Adding explicit visibility (
private,protected, orpublic) is generally recommend to communicate to other developers how, and from where this method is intended to be used.