| @@ 25-36 (lines=12) @@ | ||
| 22 | * @param ActionInterface $action |
|
| 23 | * @return Charge[] |
|
| 24 | */ |
|
| 25 | public function calculateCharges(TariffInterface $tariff, ActionInterface $action) |
|
| 26 | { |
|
| 27 | $charges = []; |
|
| 28 | foreach ($tariff->getPrices() as $price) { |
|
| 29 | $charge = $price->calculateCharge($action); |
|
| 30 | if ($charge !== null) { |
|
| 31 | $charges[] = $charge; |
|
| 32 | } |
|
| 33 | } |
|
| 34 | ||
| 35 | return $charges; |
|
| 36 | } |
|
| 37 | } |
|
| 38 | ||
| @@ 72-83 (lines=12) @@ | ||
| 69 | * @param ActionInterface $action |
|
| 70 | * @return Charge[] |
|
| 71 | */ |
|
| 72 | public function calculateCharges(ActionInterface $action) |
|
| 73 | { |
|
| 74 | $charges = []; |
|
| 75 | foreach ($this->prices as $price) { |
|
| 76 | $charge = $price->calculateCharge($action); |
|
| 77 | if ($charge !== null) { |
|
| 78 | $charges[] = $charge; |
|
| 79 | } |
|
| 80 | } |
|
| 81 | ||
| 82 | return $charges; |
|
| 83 | } |
|
| 84 | } |
|
| 85 | ||