From cad36a06ca70efefc7188ab1abc390aba670ede7 Mon Sep 17 00:00:00 2001 From: Franck DAKIA Date: Sun, 28 Dec 2025 17:03:12 +0000 Subject: [PATCH] Fix php core lang --- .github/workflows/php.yml | 4 ++-- docs/en.md | 8 ++++---- docs/fr.md | 8 ++++---- src/Exceptions/PaymentException.php | 4 ++-- src/Exceptions/PaymentRequestException.php | 4 ++-- src/Exceptions/TokenGenerationException.php | 4 ++-- src/Exceptions/TransactionVerificationException.php | 4 ++-- .../Collection/MomoPayment.php | 6 +++--- .../Collection/MomoPaymentStatus.php | 2 +- .../Collection/MomoTransaction.php | 6 +++--- .../MTNMobileMoneyGateway.php | 12 ++++++------ .../{MTNMobileMoney => Mono}/MomoEnvironment.php | 2 +- .../IvoryCost/{MTNMobileMoney => Mono}/MomoToken.php | 2 +- .../{MTNMobileMoney => Mono}/MonoTokenGenerator.php | 6 +++--- src/Payment.php | 2 +- tests/PaymentTest.php | 2 +- 16 files changed, 38 insertions(+), 38 deletions(-) rename src/Gateway/IvoryCost/{MTNMobileMoney => Mono}/Collection/MomoPayment.php (93%) rename src/Gateway/IvoryCost/{MTNMobileMoney => Mono}/Collection/MomoPaymentStatus.php (96%) rename src/Gateway/IvoryCost/{MTNMobileMoney => Mono}/Collection/MomoTransaction.php (93%) rename src/Gateway/IvoryCost/{MTNMobileMoney => Mono}/MTNMobileMoneyGateway.php (87%) rename src/Gateway/IvoryCost/{MTNMobileMoney => Mono}/MomoEnvironment.php (97%) rename src/Gateway/IvoryCost/{MTNMobileMoney => Mono}/MomoToken.php (94%) rename src/Gateway/IvoryCost/{MTNMobileMoney => Mono}/MonoTokenGenerator.php (90%) diff --git a/.github/workflows/php.yml b/.github/workflows/php.yml index 7761d58..f463e54 100644 --- a/.github/workflows/php.yml +++ b/.github/workflows/php.yml @@ -2,9 +2,9 @@ name: PHP Composer on: push: - branches: [ "master" ] + branches: [ "main" ] pull_request: - branches: [ "master" ] + branches: [ "main" ] permissions: contents: read diff --git a/docs/en.md b/docs/en.md index a935656..3f13b55 100644 --- a/docs/en.md +++ b/docs/en.md @@ -332,9 +332,9 @@ $status = $gateway->verify([ ### MTN Mobile Money Direct Usage ```php -use Bow\Payment\Gateway\IvoryCost\MTNMobileMoney\MTNMobileMoneyGateway; -use Bow\Payment\Gateway\IvoryCost\MTNMobileMoney\MomoEnvironment; -use Bow\Payment\Gateway\IvoryCost\MTNMobileMoney\MomoTokenGenerator; +use Bow\Payment\Gateway\IvoryCost\Mono\MonoGateway; +use Bow\Payment\Gateway\IvoryCost\Mono\MomoEnvironment; +use Bow\Payment\Gateway\IvoryCost\Mono\MomoTokenGenerator; $config = [ 'subscription_key' => 'YOUR_SUBSCRIPTION_KEY', @@ -351,7 +351,7 @@ $tokenGenerator = new MomoTokenGenerator( $environment ); -$gateway = new MTNMobileMoneyGateway($tokenGenerator, $config, $environment); +$gateway = new MonoGateway($tokenGenerator, $config, $environment); $result = $gateway->payment([ 'amount' => 1000, diff --git a/docs/fr.md b/docs/fr.md index 7d8888d..5761061 100644 --- a/docs/fr.md +++ b/docs/fr.md @@ -332,9 +332,9 @@ $status = $gateway->verify([ ### Utilisation Directe de MTN Mobile Money ```php -use Bow\Payment\Gateway\IvoryCost\MTNMobileMoney\MTNMobileMoneyGateway; -use Bow\Payment\Gateway\IvoryCost\MTNMobileMoney\MomoEnvironment; -use Bow\Payment\Gateway\IvoryCost\MTNMobileMoney\MomoTokenGenerator; +use Bow\Payment\Gateway\IvoryCost\Mono\MonoGateway; +use Bow\Payment\Gateway\IvoryCost\Mono\MomoEnvironment; +use Bow\Payment\Gateway\IvoryCost\Mono\MomoTokenGenerator; $config = [ 'subscription_key' => 'VOTRE_SUBSCRIPTION_KEY', @@ -351,7 +351,7 @@ $tokenGenerator = new MomoTokenGenerator( $environment ); -$gateway = new MTNMobileMoneyGateway($tokenGenerator, $config, $environment); +$gateway = new MonoGateway($tokenGenerator, $config, $environment); $result = $gateway->payment([ 'amount' => 1000, diff --git a/src/Exceptions/PaymentException.php b/src/Exceptions/PaymentException.php index eec1d14..1441e0a 100644 --- a/src/Exceptions/PaymentException.php +++ b/src/Exceptions/PaymentException.php @@ -14,9 +14,9 @@ class PaymentException extends Exception * * @param string $message * @param int $code - * @param Exception|null $previous + * @param ?Exception $previous */ - public function __construct(string $message = "", int $code = 0, Exception $previous = null) + public function __construct(string $message = "", int $code = 0, ?Exception $previous = null) { parent::__construct($message, $code, $previous); } diff --git a/src/Exceptions/PaymentRequestException.php b/src/Exceptions/PaymentRequestException.php index 85897b6..1095ced 100644 --- a/src/Exceptions/PaymentRequestException.php +++ b/src/Exceptions/PaymentRequestException.php @@ -12,9 +12,9 @@ class PaymentRequestException extends PaymentException * * @param string $message * @param int $code - * @param \Exception|null $previous + * @param ?\Exception $previous */ - public function __construct(string $message, int $code = 500, \Exception $previous = null) + public function __construct(string $message, int $code = 500, ?\Exception $previous = null) { parent::__construct("Payment request failed: {$message}", $code, $previous); } diff --git a/src/Exceptions/TokenGenerationException.php b/src/Exceptions/TokenGenerationException.php index 81ad374..fe10aa8 100644 --- a/src/Exceptions/TokenGenerationException.php +++ b/src/Exceptions/TokenGenerationException.php @@ -11,9 +11,9 @@ class TokenGenerationException extends PaymentException * Create a new token generation exception * * @param string $provider - * @param \Exception|null $previous + * @param ?\Exception $previous */ - public function __construct(string $provider = '', \Exception $previous = null) + public function __construct(string $provider = '', ?\Exception $previous = null) { $message = $provider ? "Failed to generate authentication token for {$provider}" diff --git a/src/Exceptions/TransactionVerificationException.php b/src/Exceptions/TransactionVerificationException.php index 87649b8..549e6bc 100644 --- a/src/Exceptions/TransactionVerificationException.php +++ b/src/Exceptions/TransactionVerificationException.php @@ -11,9 +11,9 @@ class TransactionVerificationException extends PaymentException * Create a new transaction verification exception * * @param string $transactionId - * @param \Exception|null $previous + * @param ?\Exception $previous */ - public function __construct(string $transactionId = '', \Exception $previous = null) + public function __construct(string $transactionId = '', ?\Exception $previous = null) { $message = $transactionId ? "Failed to verify transaction [{$transactionId}]" diff --git a/src/Gateway/IvoryCost/MTNMobileMoney/Collection/MomoPayment.php b/src/Gateway/IvoryCost/Mono/Collection/MomoPayment.php similarity index 93% rename from src/Gateway/IvoryCost/MTNMobileMoney/Collection/MomoPayment.php rename to src/Gateway/IvoryCost/Mono/Collection/MomoPayment.php index 0fccd9f..35d7023 100644 --- a/src/Gateway/IvoryCost/MTNMobileMoney/Collection/MomoPayment.php +++ b/src/Gateway/IvoryCost/Mono/Collection/MomoPayment.php @@ -1,11 +1,11 @@ \Bow\Payment\Gateway\IvoryCost\OrangeMoney\OrangeMoneyGateway::class, - Payment::MTN => \Bow\Payment\Gateway\IvoryCost\MTNMobileMoney\MTNMobileMoneyGateway::class, + Payment::MTN => \Bow\Payment\Gateway\IvoryCost\Mono\MonoGateway::class, Payment::MOOV => \Bow\Payment\Gateway\IvoryCost\MoovFlooz\MoovFloozGateway::class, Payment::WAVE => \Bow\Payment\Gateway\IvoryCost\Wave\WaveGateway::class, Payment::DJAMO => \Bow\Payment\Gateway\IvoryCost\Djamo\DjamoGateway::class, diff --git a/tests/PaymentTest.php b/tests/PaymentTest.php index 4ed7efa..dd8c203 100644 --- a/tests/PaymentTest.php +++ b/tests/PaymentTest.php @@ -34,7 +34,7 @@ public function testProviderMapping() ); $this->assertEquals( - \Bow\Payment\Gateway\IvoryCost\MTNMobileMoney\MTNMobileMoneyGateway::class, + \Bow\Payment\Gateway\IvoryCost\Mono\MonoGateway::class, $providers[Payment::MTN] ); }