@@ -161,7 +161,7 @@ public function setAmount(int $amount): static
161161
162162 public function setCustomerTrns (?string $ customerTrns ): static
163163 {
164- if (! $ customerTrns && strlen ($ customerTrns ) > 2048 ) {
164+ if (!$ customerTrns && strlen ($ customerTrns ) > 2048 ) {
165165 throw new InvalidArgumentException ('CustomerTrns length must be less than or equal to 2048. ' );
166166 }
167167
@@ -204,12 +204,12 @@ public function setAllowRecurring(bool $allowRecurring): static
204204
205205 public function setMaxInstallments (int $ maxInstallments ): static
206206 {
207- $ this ->maxInstallments = $ maxInstallments ;
208-
209207 if ($ maxInstallments < 0 || $ maxInstallments > 36 ) {
210208 throw new InvalidArgumentException ('maxInstallments value must be between 0 and 36 ' );
211209 }
212210
211+ $ this ->maxInstallments = $ maxInstallments ;
212+
213213 return $ this ;
214214 }
215215
@@ -278,10 +278,11 @@ public function setMerchantTrns(?string $merchantTrns): static
278278 public function setTags (?array $ tags ): static
279279 {
280280 if ($ tags ) {
281- collect ($ tags )->each (
282- fn (mixed $ tag ) =>
283- is_string ($ tag ) or throw new InvalidArgumentException ('tags must be an array of strings. ' )
284- );
281+ collect ($ tags )->each (function (mixed $ tag ) {
282+ if (!is_string ($ tag )) {
283+ throw new InvalidArgumentException ('tags must be an array of strings. ' );
284+ }
285+ });
285286 }
286287
287288 $ this ->tags = $ tags ;
@@ -322,12 +323,10 @@ public function __construct(int $amount, ?VivaWalletCustomer $customer = null, ?
322323
323324 public function setConfig (array $ config ): static
324325 {
325- $ this ->config = $ config ;
326-
327- $ configPayment = $ this ->config ['payment ' ];
326+ $ configPayment = $ config ['payment ' ];
328327
329328 $ this
330- ->setEnv ($ this -> config ['env ' ])
329+ ->setEnv ($ config ['env ' ])
331330 ->setPreauth ($ configPayment ['preauth ' ])
332331 ->setPaymentTimeOut ($ configPayment ['timeout ' ])
333332 ->setDisableCash ($ configPayment ['disable_cash ' ])
0 commit comments