@@ -106,47 +106,34 @@ class ApplicationContext implements Arrayable, Jsonable
106
106
protected string $ user_action = ACTION_CONTINUE ;
107
107
108
108
/**
109
- * Create a new collection.
110
- *
111
109
* @param string|null $brand_name
112
- * @param string|null $locale
113
- * @param string|null $landing_page
114
- * @param string|null $shipping_preference
110
+ * @param string $locale
111
+ * @param string $landing_page
112
+ * @param string $shipping_preference
115
113
* @param string|null $return_url
116
114
* @param string|null $cancel_url
117
115
*/
118
116
public function __construct (
119
117
?string $ brand_name = null ,
120
- ? string $ locale = 'en-US ' ,
121
- ? string $ landing_page = NO_PREFERENCE ,
122
- ? string $ shipping_preference = NO_SHIPPING ,
118
+ string $ locale = 'en-US ' ,
119
+ string $ landing_page = NO_PREFERENCE ,
120
+ string $ shipping_preference = NO_SHIPPING ,
123
121
?string $ return_url = null ,
124
122
?string $ cancel_url = null
125
123
) {
126
- $ this ->setBrandName ( $ brand_name) ;
127
- $ this ->setLocale ( $ locale) ;
128
- $ this ->setLandingPage ( $ landing_page) ;
129
- $ this ->setShippingPreference ( $ shipping_preference) ;
130
- $ this ->setReturnUrl ( $ return_url) ;
131
- $ this ->setCancelUrl ( $ cancel_url) ;
124
+ $ this ->brand_name = $ brand_name ;
125
+ $ this ->locale = $ locale ;
126
+ $ this ->landing_page = $ landing_page ;
127
+ $ this ->shipping_preference = $ shipping_preference ;
128
+ $ this ->return_url = $ return_url ;
129
+ $ this ->cancel_url = $ cancel_url ;
132
130
}
133
131
134
- /**
135
- * Create a new collection.
136
- *
137
- * @param string|null $brand_name
138
- * @param string|null $locale
139
- * @param string|null $landing_page
140
- * @param string|null $shipping_preference
141
- * @param string|null $return_url
142
- * @param string|null $cancel_url
143
- * @return ApplicationContext
144
- */
145
132
public static function create (
146
133
?string $ brand_name = null ,
147
- ? string $ locale = 'en-US ' ,
148
- ? string $ landing_page = NO_PREFERENCE ,
149
- ? string $ shipping_preference = NO_SHIPPING ,
134
+ string $ locale = 'en-US ' ,
135
+ string $ landing_page = NO_PREFERENCE ,
136
+ string $ shipping_preference = NO_SHIPPING ,
150
137
?string $ return_url = null ,
151
138
?string $ cancel_url = null
152
139
): ApplicationContext {
@@ -183,55 +170,36 @@ function ($item) {
183
170
);
184
171
}
185
172
186
- /**
187
- * gets brand_name.
188
- */
189
173
public function getBrandName (): ?string
190
174
{
191
175
return $ this ->brand_name ;
192
176
}
193
177
194
- /**
195
- * sets the brand_name.
196
- */
197
- public function setBrandName ($ brand_name ): self
178
+ public function setBrandName (string $ brand_name ): self
198
179
{
199
180
$ this ->brand_name = $ brand_name ;
200
181
201
182
return $ this ;
202
183
}
203
184
204
- /**
205
- * gets brand_name.
206
- */
207
185
public function getLocale (): string
208
186
{
209
187
return $ this ->locale ;
210
188
}
211
189
212
- /**
213
- * sets the locale.
214
- */
215
- public function setLocale ($ locale ): self
190
+ public function setLocale (string $ locale ): self
216
191
{
217
192
$ this ->locale = $ locale ;
218
193
219
194
return $ this ;
220
195
}
221
196
222
- /**
223
- * gets shipping_preference.
224
- */
225
197
public function getShippingPreference (): string
226
198
{
227
199
return $ this ->shipping_preference ;
228
200
}
229
201
230
- /**
231
- * sets the shipping_preference.
232
- * @noinspection PhpUnused
233
- */
234
- public function setShippingPreference ($ shipping_preference ): self
202
+ public function setShippingPreference (string $ shipping_preference ): self
235
203
{
236
204
$ validOptions = [GET_FROM_FILE , NO_SHIPPING , SET_PROVIDED_ADDRESS ];
237
205
if (!in_array ($ shipping_preference , $ validOptions )) {
@@ -243,19 +211,12 @@ public function setShippingPreference($shipping_preference): self
243
211
return $ this ;
244
212
}
245
213
246
- /**
247
- * gets landing_page.
248
- * @noinspection PhpUnused
249
- */
250
214
public function getLandingPage (): string
251
215
{
252
216
return $ this ->landing_page ;
253
217
}
254
218
255
- /**
256
- * sets the landing_page.
257
- */
258
- public function setLandingPage ($ landing_page ): self
219
+ public function setLandingPage (string $ landing_page ): self
259
220
{
260
221
$ validOptions = [LOGIN , BILLING , NO_PREFERENCE ];
261
222
if (!in_array ($ landing_page , $ validOptions )) {
@@ -267,19 +228,12 @@ public function setLandingPage($landing_page): self
267
228
return $ this ;
268
229
}
269
230
270
- /**
271
- * gets user_action.
272
- */
273
231
public function getUserAction (): string
274
232
{
275
233
return $ this ->user_action ;
276
234
}
277
235
278
- /**
279
- * sets the user_action.
280
- * @noinspection PhpUnused
281
- */
282
- public function setUserAction ($ user_action ): self
236
+ public function setUserAction (string $ user_action ): self
283
237
{
284
238
$ validOptions = [ACTION_CONTINUE , ACTION_PAY_NOW ];
285
239
if (!in_array ($ user_action , $ validOptions )) {
@@ -290,37 +244,24 @@ public function setUserAction($user_action): self
290
244
return $ this ;
291
245
}
292
246
293
- /**
294
- * gets return_url.
295
- * @noinspection PhpUnused
296
- */
297
247
public function getReturnUrl (): ?string
298
248
{
299
249
return $ this ->return_url ;
300
250
}
301
251
302
- /**
303
- * sets the return_url.
304
- */
305
- public function setReturnUrl ($ return_url ): self
252
+ public function setReturnUrl (string $ return_url ): self
306
253
{
307
254
$ this ->return_url = $ return_url ;
308
255
309
256
return $ this ;
310
257
}
311
258
312
- /**
313
- * gets cancel_url.
314
- */
315
259
public function getCancelUrl (): ?string
316
260
{
317
261
return $ this ->cancel_url ;
318
262
}
319
263
320
- /**
321
- * sets the cancel_url.
322
- */
323
- public function setCancelUrl ($ cancel_url ): self
264
+ public function setCancelUrl (string $ cancel_url ): self
324
265
{
325
266
$ this ->cancel_url = $ cancel_url ;
326
267
0 commit comments