Conditions | 3 |
Paths | 3 |
Total Lines | 11 |
Code Lines | 6 |
Lines | 0 |
Ratio | 0 % |
Tests | 5 |
CRAP Score | 3.0416 |
Changes | 0 |
1 | <?php |
||
71 | 2 | public function calculatePrice(QuantityInterface $quantity) |
|
72 | { |
||
73 | 2 | $usage = (string) $this->calculateUsage($quantity)->getQuantity(); |
|
74 | 2 | foreach ($this->prices as $value => $price) { |
|
75 | 2 | if ((string) $value === (string) $usage) { |
|
76 | 2 | return new Money($price, $this->currency); |
|
77 | } |
||
78 | } |
||
79 | |||
80 | throw new FailedCalculatePriceException('not enumed quantity: ' . $usage); |
||
81 | } |
||
82 | |||
91 |