@@ -125,15 +125,15 @@ public function __construct(
125125 /**
126126 * gets brand_name.
127127 */
128- public function getBrandName ()
128+ public function getBrandName (): ? string
129129 {
130130 return $ this ->brand_name ;
131131 }
132132
133133 /**
134134 * sets the brand_name.
135135 */
136- public function setBrandName ($ brand_name )
136+ public function setBrandName ($ brand_name ): self
137137 {
138138 $ this ->brand_name = $ brand_name ;
139139
@@ -143,15 +143,15 @@ public function setBrandName($brand_name)
143143 /**
144144 * gets brand_name.
145145 */
146- public function getLocale ()
146+ public function getLocale (): string
147147 {
148148 return $ this ->locale ;
149149 }
150150
151151 /**
152152 * sets the locale.
153153 */
154- public function setLocale ($ locale )
154+ public function setLocale ($ locale ): self
155155 {
156156 $ this ->locale = $ locale ;
157157
@@ -161,15 +161,15 @@ public function setLocale($locale)
161161 /**
162162 * gets landing_page.
163163 */
164- public function getLandingPage ()
164+ public function getLandingPage (): string
165165 {
166166 return $ this ->landing_page ;
167167 }
168168
169169 /**
170170 * sets the landing_page.
171171 */
172- public function setLandingPage ($ landing_page )
172+ public function setLandingPage ($ landing_page ): self
173173 {
174174 $ validOptions = [LOGIN , BILLING , NO_PREFERENCE ];
175175 if (!in_array ($ landing_page , $ validOptions )) {
@@ -184,15 +184,15 @@ public function setLandingPage($landing_page)
184184 /**
185185 * gets shipping_preference.
186186 */
187- public function getShippingPreference ()
187+ public function getShippingPreference (): string
188188 {
189189 return $ this ->shipping_preference ;
190190 }
191191
192192 /**
193193 * sets the shipping_preference.
194194 */
195- public function setShippingPreference ($ shipping_preference )
195+ public function setShippingPreference ($ shipping_preference ): self
196196 {
197197 $ validOptions = [GET_FROM_FILE , NO_SHIPPING , SET_PROVIDED_ADDRESS ];
198198 if (!in_array ($ shipping_preference , $ validOptions )) {
@@ -207,15 +207,15 @@ public function setShippingPreference($shipping_preference)
207207 /**
208208 * gets return_url.
209209 */
210- public function getReturnUrl ()
210+ public function getReturnUrl (): ? string
211211 {
212212 return $ this ->return_url ;
213213 }
214214
215215 /**
216216 * sets the return_url.
217217 */
218- public function setReturnUrl ($ return_url )
218+ public function setReturnUrl ($ return_url ): self
219219 {
220220 $ this ->return_url = $ return_url ;
221221
@@ -225,15 +225,15 @@ public function setReturnUrl($return_url)
225225 /**
226226 * gets cancel_url.
227227 */
228- public function getCancelUrl ()
228+ public function getCancelUrl (): ? string
229229 {
230230 return $ this ->cancel_url ;
231231 }
232232
233233 /**
234234 * sets the cancel_url.
235235 */
236- public function setCancelUrl ($ cancel_url )
236+ public function setCancelUrl ($ cancel_url ): self
237237 {
238238 $ this ->cancel_url = $ cancel_url ;
239239
@@ -243,15 +243,15 @@ public function setCancelUrl($cancel_url)
243243 /**
244244 * gets user_action.
245245 */
246- public function getUserAction ()
246+ public function getUserAction (): string
247247 {
248248 return $ this ->user_action ;
249249 }
250250
251251 /**
252252 * sets the user_action.
253253 */
254- public function setUserAction ($ user_action )
254+ public function setUserAction ($ user_action ): self
255255 {
256256 $ validOptions = [ACTION_CONTINUE , ACTION_PAY_NOW ];
257257 if (!in_array ($ user_action , $ validOptions )) {
@@ -264,19 +264,17 @@ public function setUserAction($user_action)
264264
265265 /**
266266 * Get the instance as an array.
267- *
268- * @return array
269267 */
270- public function toArray ()
268+ public function toArray (): array
271269 {
272270 $ arrayable = [
273- 'brand_name ' => $ this ->brand_name ?? null ,
274- 'locale ' => $ this ->locale ?? null ,
275- 'shipping_preference ' => $ this ->shipping_preference ?? null ,
276- 'landing_page ' => $ this ->landing_page ?? null ,
277- 'user_action ' => $ this ->user_action ?? null ,
278- 'return_url ' => $ this ->return_url ?? null ,
279- 'cancel_url ' => $ this ->cancel_url ?? null ,
271+ 'brand_name ' => $ this ->getBrandName () ?? null ,
272+ 'locale ' => $ this ->getLocale () ?? null ,
273+ 'shipping_preference ' => $ this ->getShippingPreference () ?? null ,
274+ 'landing_page ' => $ this ->getLandingPage () ?? null ,
275+ 'user_action ' => $ this ->getUserAction () ?? null ,
276+ 'return_url ' => $ this ->getReturnUrl () ?? null ,
277+ 'cancel_url ' => $ this ->getCancelUrl () ?? null ,
280278 ];
281279
282280 return array_filter (
0 commit comments