| Conditions | 3 |
| Paths | 3 |
| Total Lines | 8 |
| Code Lines | 5 |
| Lines | 8 |
| Ratio | 100 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 1 |
| 1 | <?php |
||
| 23 | View Code Duplication | function plus(Sums $sums) |
|
|
|
|||
| 24 | { |
||
| 25 | $newSums = $this->sums; |
||
| 26 | foreach ($sums->sums as $currency_id => $sum) { |
||
| 27 | $newSums[$currency_id] = isset($newSums[$currency_id]) ? $newSums[$currency_id] + $sum : $sum; |
||
| 28 | } |
||
| 29 | return new Sums($newSums); |
||
| 30 | } |
||
| 31 | |||
| 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.