@@ -106,47 +106,34 @@ class ApplicationContext implements Arrayable, Jsonable
106106 protected string $ user_action = ACTION_CONTINUE ;
107107
108108 /**
109- * Create a new collection.
110- *
111109 * @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
115113 * @param string|null $return_url
116114 * @param string|null $cancel_url
117115 */
118116 public function __construct (
119117 ?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 ,
123121 ?string $ return_url = null ,
124122 ?string $ cancel_url = null
125123 ) {
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 ;
132130 }
133131
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- */
145132 public static function create (
146133 ?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 ,
150137 ?string $ return_url = null ,
151138 ?string $ cancel_url = null
152139 ): ApplicationContext {
@@ -183,55 +170,36 @@ function ($item) {
183170 );
184171 }
185172
186- /**
187- * gets brand_name.
188- */
189173 public function getBrandName (): ?string
190174 {
191175 return $ this ->brand_name ;
192176 }
193177
194- /**
195- * sets the brand_name.
196- */
197- public function setBrandName ($ brand_name ): self
178+ public function setBrandName (string $ brand_name ): self
198179 {
199180 $ this ->brand_name = $ brand_name ;
200181
201182 return $ this ;
202183 }
203184
204- /**
205- * gets brand_name.
206- */
207185 public function getLocale (): string
208186 {
209187 return $ this ->locale ;
210188 }
211189
212- /**
213- * sets the locale.
214- */
215- public function setLocale ($ locale ): self
190+ public function setLocale (string $ locale ): self
216191 {
217192 $ this ->locale = $ locale ;
218193
219194 return $ this ;
220195 }
221196
222- /**
223- * gets shipping_preference.
224- */
225197 public function getShippingPreference (): string
226198 {
227199 return $ this ->shipping_preference ;
228200 }
229201
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
235203 {
236204 $ validOptions = [GET_FROM_FILE , NO_SHIPPING , SET_PROVIDED_ADDRESS ];
237205 if (!in_array ($ shipping_preference , $ validOptions )) {
@@ -243,19 +211,12 @@ public function setShippingPreference($shipping_preference): self
243211 return $ this ;
244212 }
245213
246- /**
247- * gets landing_page.
248- * @noinspection PhpUnused
249- */
250214 public function getLandingPage (): string
251215 {
252216 return $ this ->landing_page ;
253217 }
254218
255- /**
256- * sets the landing_page.
257- */
258- public function setLandingPage ($ landing_page ): self
219+ public function setLandingPage (string $ landing_page ): self
259220 {
260221 $ validOptions = [LOGIN , BILLING , NO_PREFERENCE ];
261222 if (!in_array ($ landing_page , $ validOptions )) {
@@ -267,19 +228,12 @@ public function setLandingPage($landing_page): self
267228 return $ this ;
268229 }
269230
270- /**
271- * gets user_action.
272- */
273231 public function getUserAction (): string
274232 {
275233 return $ this ->user_action ;
276234 }
277235
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
283237 {
284238 $ validOptions = [ACTION_CONTINUE , ACTION_PAY_NOW ];
285239 if (!in_array ($ user_action , $ validOptions )) {
@@ -290,37 +244,24 @@ public function setUserAction($user_action): self
290244 return $ this ;
291245 }
292246
293- /**
294- * gets return_url.
295- * @noinspection PhpUnused
296- */
297247 public function getReturnUrl (): ?string
298248 {
299249 return $ this ->return_url ;
300250 }
301251
302- /**
303- * sets the return_url.
304- */
305- public function setReturnUrl ($ return_url ): self
252+ public function setReturnUrl (string $ return_url ): self
306253 {
307254 $ this ->return_url = $ return_url ;
308255
309256 return $ this ;
310257 }
311258
312- /**
313- * gets cancel_url.
314- */
315259 public function getCancelUrl (): ?string
316260 {
317261 return $ this ->cancel_url ;
318262 }
319263
320- /**
321- * sets the cancel_url.
322- */
323- public function setCancelUrl ($ cancel_url ): self
264+ public function setCancelUrl (string $ cancel_url ): self
324265 {
325266 $ this ->cancel_url = $ cancel_url ;
326267
0 commit comments