1 | <?php |
||
12 | class SubscriptionService extends AbstractService |
||
13 | { |
||
14 | /** |
||
15 | * Get one subscription by using the Fastbill subscription ID. |
||
16 | * |
||
17 | * @param integer $subscriptionId The Fastbill subscription ID. |
||
18 | * @return Subscription|null |
||
19 | */ |
||
20 | public function getSubscriptionById($subscriptionId) |
||
29 | 6 | ||
30 | 6 | /** |
|
31 | 6 | * Get the subscriptions. |
|
32 | 6 | * |
|
33 | 6 | * @param integer $customerId The customer ID. |
|
34 | * @param string $externalCustomerId The external customer ID. |
||
35 | 6 | * @param string $subscriptionExternalId The external subscription ID. |
|
36 | * @param integer $subscriptionId The subscription ID. |
||
37 | 6 | * @return Get\ApiResponse |
|
38 | */ |
||
39 | public function getSubscriptions( |
||
55 | |||
56 | /** |
||
57 | * Create a subscription. |
||
58 | * |
||
59 | * @param Create\RequestData $requestData The request data. |
||
60 | * @return Create\ApiResponse |
||
61 | */ |
||
62 | public function createSubscription(Create\RequestData $requestData) |
||
68 | |||
69 | /** |
||
70 | * Update a subscription. |
||
71 | * |
||
72 | * @param integer $subscriptionId The subscription ID. |
||
73 | 3 | * @param \DateTime $nextEvent The next event date and time. |
|
74 | * @param string $subscriptionExternalId The external subscription ID. |
||
75 | 3 | * @param string $status The subscription status. |
|
76 | 3 | * @param array $xAttributes The subscription x attributes. |
|
77 | 3 | * @param Feature[] $features The features. |
|
78 | 3 | * @return Update\ApiResponse |
|
79 | 3 | */ |
|
80 | 3 | public function updateSubscription( |
|
101 | |||
102 | /** |
||
103 | * Change article of a subscription. |
||
104 | * |
||
105 | * @param ChangeArticle\RequestData $requestData The request data. |
||
106 | 3 | * @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 | 3 | * @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 | 3 | ||
141 | /** |
||
142 | 3 | * Get the usage data of a subscription. |
|
143 | 3 | * |
|
144 | 3 | * @param integer $subscriptionId The subscription ID. |
|
145 | * @param \DateTime $subscriptionStart The subscription start. |
||
146 | 3 | * @param \DateTime $subscriptionEnd The subscription end. |
|
147 | * @return GetUsageData\ApiResponse |
||
148 | 3 | */ |
|
149 | 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 | 3 | /** |
|
180 | * Get the upcoming amount. |
||
181 | * |
||
182 | * @param GetUpcomingAmount\RequestData $requestData The request data filter. |
||
183 | * @return GetUpcomingAmount\ApiResponse |
||
184 | */ |
||
185 | 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 | public function createSecureLink($subscriptionId) |
||
238 | |||
239 | 3 | /** |
|
240 | * Cancel a subscription. |
||
241 | 3 | * |
|
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 | 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 | 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):