| Total Complexity | 4 |
| Total Lines | 34 |
| Duplicated Lines | 0 % |
| Coverage | 0% |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 11 | class Merger implements MergerInterface |
||
| 12 | { |
||
| 13 | /** |
||
| 14 | * @var MonthlyBillQuantityFixer |
||
| 15 | */ |
||
| 16 | private $monthlyBillQuantityFixer; |
||
| 17 | /** |
||
| 18 | * @var MergerInterface |
||
| 19 | */ |
||
| 20 | private $defaultMerger; |
||
| 21 | |||
| 22 | public function __construct(MergerInterface $defaultMerger, MonthlyBillQuantityFixer $monthlyBillQuantityFixer) |
||
| 23 | { |
||
| 24 | $this->defaultMerger = $defaultMerger; |
||
| 25 | $this->monthlyBillQuantityFixer = $monthlyBillQuantityFixer; |
||
| 26 | } |
||
| 27 | |||
| 28 | /** |
||
| 29 | * {@inheritdoc} |
||
| 30 | */ |
||
| 31 | public function mergeBills(array $bills): array |
||
| 32 | { |
||
| 33 | $bills = $this->defaultMerger->mergeBills($bills); |
||
| 34 | |||
| 35 | foreach ($bills as $bill) { |
||
| 36 | $this->monthlyBillQuantityFixer->__invoke($bill); |
||
| 37 | } |
||
| 38 | |||
| 39 | return $bills; |
||
| 40 | } |
||
| 41 | |||
| 42 | public function mergeBill(BillInterface $first, BillInterface $other): BillInterface |
||
| 45 | } |
||
| 46 | } |
||
| 47 |