@@ 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 |
@@ 80-91 (lines=12) @@ | ||
77 | * @param ActionInterface $action |
|
78 | * @return Charge[] |
|
79 | */ |
|
80 | public function calculateCharges(ActionInterface $action) |
|
81 | { |
|
82 | $charges = []; |
|
83 | foreach ($this->prices as $price) { |
|
84 | $charge = $price->calculateCharge($action); |
|
85 | if ($charge !== null) { |
|
86 | $charges[] = $charge; |
|
87 | } |
|
88 | } |
|
89 | ||
90 | return $charges; |
|
91 | } |
|
92 | ||
93 | public function jsonSerialize() |
|
94 | { |