@@ -26,7 +26,6 @@ |
||
26 | 26 | |
27 | 27 | /** |
28 | 28 | * Finds suitable plans for given order: customer + actions. |
29 | - * @param ActionInterface $action |
|
30 | 29 | * @return PlanInterface[] array: actionKey => plan |
31 | 30 | */ |
32 | 31 | public function findByOrder(OrderInterface $order); |
@@ -42,7 +42,7 @@ |
||
42 | 42 | } |
43 | 43 | |
44 | 44 | /** |
45 | - * @return string |
|
45 | + * @return boolean |
|
46 | 46 | */ |
47 | 47 | public function equals(TypeInterface $other) |
48 | 48 | { |
@@ -18,7 +18,6 @@ |
||
18 | 18 | use hiqdev\php\billing\type\Type; |
19 | 19 | use hiqdev\php\units\Quantity; |
20 | 20 | use hiqdev\php\units\Unit; |
21 | -use Money\Currency; |
|
22 | 21 | use Money\Money; |
23 | 22 | |
24 | 23 | /** |
@@ -51,6 +51,9 @@ |
||
51 | 51 | return $this->{$method}($dto); |
52 | 52 | } |
53 | 53 | |
54 | + /** |
|
55 | + * @param string $type |
|
56 | + */ |
|
54 | 57 | public function findClassForType($type) |
55 | 58 | { |
56 | 59 | if (isset($this->types[$type])) { |
@@ -43,6 +43,9 @@ |
||
43 | 43 | */ |
44 | 44 | protected $sums; |
45 | 45 | |
46 | + /** |
|
47 | + * @param string|null $id |
|
48 | + */ |
|
46 | 49 | public function __construct( |
47 | 50 | $id, |
48 | 51 | TypeInterface $type, |
@@ -116,11 +116,17 @@ discard block |
||
116 | 116 | return $date->modify('first day of this month midnight'); |
117 | 117 | } |
118 | 118 | |
119 | + /** |
|
120 | + * @return Money |
|
121 | + */ |
|
119 | 122 | public function generalizeSum(ChargeInterface $charge) |
120 | 123 | { |
121 | 124 | return $charge->getSum(); |
122 | 125 | } |
123 | 126 | |
127 | + /** |
|
128 | + * @return QuantityInterface |
|
129 | + */ |
|
124 | 130 | public function generalizeQuantity(ChargeInterface $charge) |
125 | 131 | { |
126 | 132 | return $charge->getUsage(); |
@@ -131,6 +137,9 @@ discard block |
||
131 | 137 | return $charge->getAction()->getCustomer(); |
132 | 138 | } |
133 | 139 | |
140 | + /** |
|
141 | + * @return null|\hiqdev\php\billing\target\TargetInterface |
|
142 | + */ |
|
134 | 143 | public function generalizeTarget(ChargeInterface $charge) |
135 | 144 | { |
136 | 145 | $priceTarget = $charge->getPrice()->getTarget(); |
@@ -141,6 +150,9 @@ discard block |
||
141 | 150 | /// return $priceTarget->getId() ? $priceTarget : new Target($charge->getSale()->getPlan()->getId(), 'plan'); |
142 | 151 | } |
143 | 152 | |
153 | + /** |
|
154 | + * @return null|\hiqdev\php\billing\plan\PlanInterface |
|
155 | + */ |
|
144 | 156 | public function generalizePlan(ChargeInterface $charge) |
145 | 157 | { |
146 | 158 | return $charge->getPrice()->getPlan(); |