From 9375c469512eac3f4fab13e5cf27ceca6c88ec2f Mon Sep 17 00:00:00 2001 From: Sajjad Esmaeely Date: Tue, 12 Dec 2023 16:56:47 +0100 Subject: [PATCH 1/3] add php83 --- .github/workflows/run-tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/run-tests.yml b/.github/workflows/run-tests.yml index 7fefe35..3761563 100644 --- a/.github/workflows/run-tests.yml +++ b/.github/workflows/run-tests.yml @@ -13,7 +13,7 @@ jobs: fail-fast: true matrix: os: [ubuntu-latest, windows-latest] - php: [8.2, 8.1] + php: [8.3, 8.2, 8.1] laravel: [10.*] stability: [prefer-lowest, prefer-stable] include: From 994a74304533986f8f1cabf26093a0fc8c507554 Mon Sep 17 00:00:00 2001 From: Hamed Panjeh <16323354+HPWebdeveloper@users.noreply.github.com> Date: Tue, 12 Dec 2023 13:39:15 -0300 Subject: [PATCH 2/3] Update HandlesPayment.php Modify variable name from $wallets to $walletsInOrder --- src/Traits/HandlesPayment.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Traits/HandlesPayment.php b/src/Traits/HandlesPayment.php index 63f8a33..721f497 100644 --- a/src/Traits/HandlesPayment.php +++ b/src/Traits/HandlesPayment.php @@ -24,9 +24,9 @@ public function pay(int|float $orderValue): void DB::transaction(function () use ($orderValue) { $remainingOrderValue = $orderValue; - $wallets = $this->wallets()->whereIn('type', $this->walletsInOrder())->get(); + $walletsInOrder = $this->wallets()->whereIn('type', $this->walletsInOrder())->get(); - foreach ($wallets as $wallet) { + foreach ($walletsInOrder as $wallet) { if (! $wallet || ! $wallet->hasBalance()) { continue; } From bf92ab1f69641047a88b2559f8fce555c9032074 Mon Sep 17 00:00:00 2001 From: HPWebdeveloper Date: Tue, 12 Dec 2023 16:39:41 +0000 Subject: [PATCH 3/3] Fix styling --- src/Exceptions/InsufficientBalanceException.php | 2 +- src/Exceptions/InvalidDepositException.php | 2 +- src/Exceptions/InvalidValueException.php | 2 +- src/Exceptions/InvalidWalletTypeException.php | 2 +- src/Exceptions/WalletNotFoundException.php | 2 +- src/Traits/HandlesPayment.php | 2 -- 6 files changed, 5 insertions(+), 7 deletions(-) diff --git a/src/Exceptions/InsufficientBalanceException.php b/src/Exceptions/InsufficientBalanceException.php index e7332f1..1e87b6f 100644 --- a/src/Exceptions/InsufficientBalanceException.php +++ b/src/Exceptions/InsufficientBalanceException.php @@ -12,7 +12,7 @@ class InsufficientBalanceException extends Exception * @param string $message * @param int $code */ - public function __construct($message = 'Insufficient balance to cover the order', $code = 0, \Throwable $previous = null) + public function __construct($message = 'Insufficient balance to cover the order', $code = 0, ?\Throwable $previous = null) { parent::__construct($message, $code, $previous); } diff --git a/src/Exceptions/InvalidDepositException.php b/src/Exceptions/InvalidDepositException.php index da644ba..937011e 100644 --- a/src/Exceptions/InvalidDepositException.php +++ b/src/Exceptions/InvalidDepositException.php @@ -12,7 +12,7 @@ class InvalidDepositException extends Exception * @param string $message * @param int $code */ - public function __construct($message = 'Invalid deposit operation', $code = 0, \Throwable $previous = null) + public function __construct($message = 'Invalid deposit operation', $code = 0, ?\Throwable $previous = null) { parent::__construct($message, $code, $previous); } diff --git a/src/Exceptions/InvalidValueException.php b/src/Exceptions/InvalidValueException.php index 36a6d7e..7c351db 100644 --- a/src/Exceptions/InvalidValueException.php +++ b/src/Exceptions/InvalidValueException.php @@ -12,7 +12,7 @@ class InvalidValueException extends Exception * @param string $message * @param int $code */ - public function __construct($message = 'Invalie value to deposit', $code = 0, \Throwable $previous = null) + public function __construct($message = 'Invalie value to deposit', $code = 0, ?\Throwable $previous = null) { parent::__construct($message, $code, $previous); } diff --git a/src/Exceptions/InvalidWalletTypeException.php b/src/Exceptions/InvalidWalletTypeException.php index cfae06d..5f35ef9 100644 --- a/src/Exceptions/InvalidWalletTypeException.php +++ b/src/Exceptions/InvalidWalletTypeException.php @@ -6,7 +6,7 @@ class InvalidWalletTypeException extends Exception { - public function __construct($message = 'Invalid wallet type', $code = 0, \Throwable $previous = null) + public function __construct($message = 'Invalid wallet type', $code = 0, ?\Throwable $previous = null) { parent::__construct($message, $code, $previous); } diff --git a/src/Exceptions/WalletNotFoundException.php b/src/Exceptions/WalletNotFoundException.php index ee62fde..4b314a6 100644 --- a/src/Exceptions/WalletNotFoundException.php +++ b/src/Exceptions/WalletNotFoundException.php @@ -6,7 +6,7 @@ class WalletNotFoundException extends Exception { - public function __construct($message = 'Wallet not found', $code = 0, \Throwable $previous = null) + public function __construct($message = 'Wallet not found', $code = 0, ?\Throwable $previous = null) { parent::__construct($message, $code, $previous); } diff --git a/src/Traits/HandlesPayment.php b/src/Traits/HandlesPayment.php index 721f497..2e31745 100644 --- a/src/Traits/HandlesPayment.php +++ b/src/Traits/HandlesPayment.php @@ -10,8 +10,6 @@ trait HandlesPayment /** * Pay the order value from the user's wallets. * - * @param int|float $orderValue - * @return void * * @throws InsufficientBalanceException */