1 | <?php |
||
12 | class SubscriptionService extends AbstractService |
||
13 | { |
||
14 | /** |
||
15 | * Get one subscription by using the Monsum subscription ID. |
||
16 | * |
||
17 | * @param integer $subscriptionId The Monsum subscription ID. |
||
18 | * @return Subscription|null |
||
19 | */ |
||
20 | 6 | public function getSubscriptionById($subscriptionId) |
|
29 | |||
30 | /** |
||
31 | * Get the subscriptions. |
||
32 | * |
||
33 | * @param integer $customerId The customer ID. |
||
34 | * @param string $externalCustomerId The external customer ID. |
||
35 | * @param string $subscriptionExternalId The external subscription ID. |
||
36 | * @param integer $subscriptionId The subscription ID. |
||
37 | * @return Get\ApiResponse |
||
38 | */ |
||
39 | 12 | public function getSubscriptions( |
|
55 | |||
56 | /** |
||
57 | * Create a subscription. |
||
58 | * |
||
59 | * @param Create\RequestData $requestData The request data. |
||
60 | * @return Create\ApiResponse |
||
61 | */ |
||
62 | 9 | public function createSubscription(Create\RequestData $requestData) |
|
68 | |||
69 | /** |
||
70 | * Update a subscription. |
||
71 | * |
||
72 | * @param integer $subscriptionId The subscription ID. |
||
73 | * @param \DateTime $nextEvent The next event date and time. |
||
74 | * @param string $subscriptionExternalId The external subscription ID. |
||
75 | * @param string $status The subscription status. |
||
76 | * @param array $xAttributes The subscription x attributes. |
||
77 | * @param Feature[] $features The features. |
||
78 | * @return Update\ApiResponse |
||
79 | */ |
||
80 | 3 | public function updateSubscription( |
|
101 | |||
102 | /** |
||
103 | * Change article of a subscription. |
||
104 | * |
||
105 | * @param ChangeArticle\RequestData $requestData The request data. |
||
106 | * @return ChangeArticle\ApiResponse |
||
107 | */ |
||
108 | 3 | public function changeSubscriptionArticle(ChangeArticle\RequestData $requestData) |
|
114 | |||
115 | /** |
||
116 | * Set the addon for a subscription. |
||
117 | * |
||
118 | * @param SetAddon\RequestData $requestData The request data. |
||
119 | * @return SetAddon\ApiResponse |
||
120 | */ |
||
121 | 3 | public function setSubscriptionAddon(SetAddon\RequestData $requestData) |
|
127 | |||
128 | /** |
||
129 | * Set the usage data of a subscription. |
||
130 | * |
||
131 | * @param SetUsageData\RequestData $requestData The request data. |
||
132 | * @return SetUsageData\ApiResponse |
||
133 | */ |
||
134 | 3 | public function setSubscriptionUsageData(SetUsageData\RequestData $requestData) |
|
140 | |||
141 | /** |
||
142 | * Get the usage data of a subscription. |
||
143 | * |
||
144 | * @param integer $subscriptionId The subscription ID. |
||
145 | * @param \DateTime $subscriptionStart The subscription start. |
||
146 | * @param \DateTime $subscriptionEnd The subscription end. |
||
147 | * @return GetUsageData\ApiResponse |
||
148 | */ |
||
149 | 3 | public function getSubscriptionUsageData( |
|
164 | |||
165 | /** |
||
166 | * Get the usage data of a subscription. |
||
167 | * |
||
168 | * @param string $usageDataId The usage data ID. |
||
169 | * @return DeleteUsageData\ApiResponse |
||
170 | */ |
||
171 | 3 | public function deleteSubscriptionUsageData($usageDataId) |
|
178 | |||
179 | /** |
||
180 | * Get the upcoming amount. |
||
181 | * |
||
182 | * @param GetUpcomingAmount\RequestData $requestData The request data filter. |
||
183 | * @return GetUpcomingAmount\ApiResponse |
||
184 | */ |
||
185 | 3 | public function getUpcomingAmount(GetUpcomingAmount\RequestData $requestData = null) |
|
195 | |||
196 | /** |
||
197 | * Postpone a subscription shipping. |
||
198 | * |
||
199 | * @param integer $subscriptionId |
||
200 | * @param integer $month The month to postpone. |
||
201 | * @return Postpone\ApiResponse |
||
202 | */ |
||
203 | 3 | public function postponeSubscription($subscriptionId, $month) |
|
210 | |||
211 | /** |
||
212 | * Renew a subscription. |
||
213 | * |
||
214 | * @param integer $subscriptionId The subscription ID to renew. |
||
215 | * @return Renew\ApiResponse |
||
216 | */ |
||
217 | 3 | public function renewSubscription($subscriptionId) |
|
224 | |||
225 | /** |
||
226 | * Create a secure link for a subscription. |
||
227 | * |
||
228 | * @param integer $subscriptionId The subscription ID for which to create the secure link. |
||
229 | * @return CreateSecureLink\ApiResponse |
||
230 | */ |
||
231 | 3 | public function createSecureLink($subscriptionId) |
|
238 | |||
239 | /** |
||
240 | * Cancel a subscription. |
||
241 | * |
||
242 | * @param integer $subscriptionId The subscription ID. |
||
243 | * @param \DateTime $cancellationDate The cancellation date and time. |
||
244 | * @param string $cancellationNote The cancellation note. |
||
245 | * @return Cancel\ApiResponse |
||
246 | */ |
||
247 | 3 | public function cancelSubscription($subscriptionId, \DateTime $cancellationDate = null, $cancellationNote = null) |
|
257 | |||
258 | /** |
||
259 | * Reactivate a subscription. |
||
260 | * |
||
261 | * @param integer $subscriptionId The subscription ID to reactivate. |
||
262 | * @return Reactivate\ApiResponse |
||
263 | */ |
||
264 | 3 | public function reactivateSubscription($subscriptionId) |
|
271 | } |
||
272 |
It seems like you allow that null is being passed for a parameter, however the function which is called does not seem to accept null.
We recommend to add an additional type check (or disallow null for the parameter):