Total Complexity | 4 |
Total Lines | 39 |
Duplicated Lines | 0 % |
Coverage | 100% |
Changes | 6 | ||
Bugs | 1 | Features | 1 |
1 | <?php |
||
30 | class SinglePrice extends AbstractPrice implements PriceWithQuantityInterface, PriceWithMoneyInterface |
||
31 | { |
||
32 | use HasMoney; |
||
33 | use HasQuantity; |
||
34 | |||
35 | public function __construct( |
||
36 | $id, |
||
37 | TypeInterface $type, |
||
38 | TargetInterface $target, |
||
39 | PlanInterface $plan = null, |
||
40 | QuantityInterface $prepaid, |
||
41 | Money $price |
||
42 | 39 | ) { |
|
43 | parent::__construct($id, $type, $target, $plan); |
||
44 | $this->prepaid = $prepaid; |
||
45 | $this->price = $price; |
||
46 | } |
||
47 | |||
48 | /** |
||
49 | * {@inheritdoc} |
||
50 | 39 | */ |
|
51 | 39 | public function calculateUsage(QuantityInterface $quantity): ?QuantityInterface |
|
60 | 3 | } |
|
61 | |||
62 | 3 | /** |
|
63 | * {@inheritdoc} |
||
64 | * Same price for any usage. |
||
65 | */ |
||
66 | public function calculatePrice(QuantityInterface $usage): ?Money |
||
71 |