Conditions | 3 |
Paths | 3 |
Total Lines | 13 |
Code Lines | 8 |
Lines | 0 |
Ratio | 0 % |
Tests | 7 |
CRAP Score | 3.0175 |
Changes | 0 |
1 | <?php |
||
27 | 1 | public function calculateCharges(OrderInterface $order) |
|
28 | { |
||
29 | 1 | $plans = $this->repository->findByOrder($order); |
|
30 | 1 | $charges = []; |
|
31 | 1 | foreach ($order->getActions() as $actionKey => $action) { |
|
32 | 1 | if (empty($plans[$actionKey])) { |
|
33 | throw new FailedFindPlan(); |
||
34 | } |
||
35 | 1 | $charges[$actionKey] = $plans[$actionKey]->calculateCharges($action); |
|
36 | } |
||
37 | |||
38 | 1 | return $charges; |
|
39 | } |
||
40 | } |
||
41 |