From a4ec8fab10d32b9ff6d8dec0a93da1ef0e6de93b Mon Sep 17 00:00:00 2001 From: Mohammed Hamoda Date: Wed, 6 May 2026 04:17:12 +0200 Subject: [PATCH 1/4] fix code style issue to be compatiable with PSR-12 --- .github/workflows/ci.yml | 4 ++-- src/Invoice/APIs/CancelInvoiceRequest.php | 3 ++- src/Invoice/APIs/CreateInvoiceRequest.php | 3 ++- src/Invoice/APIs/GetInvoiceRequest.php | 3 ++- src/Invoice/APIs/UpdateInvoiceRequest.php | 3 ++- src/Invoice/DTO/CreateInvoiceDTO.php | 3 ++- src/Invoice/DTO/UpdateInvoiceDTO.php | 3 ++- src/Moyasar.php | 3 ++- src/Payment/APIs/CapturePaymentRequest.php | 3 ++- src/Payment/APIs/CreatePaymentRequest.php | 3 ++- src/Payment/APIs/GetPaymentRequest.php | 3 ++- src/Payment/APIs/RefundPaymentRequest.php | 3 ++- src/Payment/APIs/UpdatePaymentRequest.php | 3 ++- src/Payment/APIs/VoidPaymentRequest.php | 3 ++- src/Payment/DTO/CreatePaymentDTO.php | 3 ++- src/Payment/DTO/PaymentDTO.php | 3 ++- .../DTO/Source/CreditCardSourceDTO.php | 3 ++- src/Payment/DTO/UpdatePaymentDTO.php | 3 ++- src/Payment/PaymentResource.php | 2 +- tests/Config/ExtraData.php | 3 ++- tests/Config/MockResponses.php | 22 +++++++++++-------- tests/Config/Samples/InvoiceSamples.php | 8 +++---- tests/ExampleTest.php | 3 --- tests/Feature/ExampleTest.php | 5 ----- tests/Unit/.gitkeep | 0 tests/Unit/ExampleTest.php | 5 ----- 26 files changed, 56 insertions(+), 47 deletions(-) delete mode 100644 tests/ExampleTest.php delete mode 100644 tests/Feature/ExampleTest.php create mode 100644 tests/Unit/.gitkeep delete mode 100644 tests/Unit/ExampleTest.php diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c3da837..f49cb0e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -22,8 +22,8 @@ jobs: - name: Install dependencies run: composer install --prefer-dist --no-progress - # - name: Check code style - # run: composer cs-check + - name: Check code style + run: composer cs-check # - name: Run PHPStan # run: composer stan diff --git a/src/Invoice/APIs/CancelInvoiceRequest.php b/src/Invoice/APIs/CancelInvoiceRequest.php index 08fd5c8..12ae829 100644 --- a/src/Invoice/APIs/CancelInvoiceRequest.php +++ b/src/Invoice/APIs/CancelInvoiceRequest.php @@ -13,7 +13,8 @@ class CancelInvoiceRequest extends Request public function __construct( public readonly string $invoiceId, - ) {} + ) { + } public function resolveEndpoint(): string { diff --git a/src/Invoice/APIs/CreateInvoiceRequest.php b/src/Invoice/APIs/CreateInvoiceRequest.php index b0d9148..a475022 100644 --- a/src/Invoice/APIs/CreateInvoiceRequest.php +++ b/src/Invoice/APIs/CreateInvoiceRequest.php @@ -18,7 +18,8 @@ class CreateInvoiceRequest extends Request implements HasBody public function __construct( public readonly CreateInvoiceDTO $createInvoiceDTO, - ) {} + ) { + } public function resolveEndpoint(): string { diff --git a/src/Invoice/APIs/GetInvoiceRequest.php b/src/Invoice/APIs/GetInvoiceRequest.php index 19e46f6..5fe4fbf 100644 --- a/src/Invoice/APIs/GetInvoiceRequest.php +++ b/src/Invoice/APIs/GetInvoiceRequest.php @@ -13,7 +13,8 @@ class GetInvoiceRequest extends Request public function __construct( public readonly string $invoiceId, - ) {} + ) { + } public function resolveEndpoint(): string { diff --git a/src/Invoice/APIs/UpdateInvoiceRequest.php b/src/Invoice/APIs/UpdateInvoiceRequest.php index dfa9434..d06f8a6 100644 --- a/src/Invoice/APIs/UpdateInvoiceRequest.php +++ b/src/Invoice/APIs/UpdateInvoiceRequest.php @@ -19,7 +19,8 @@ class UpdateInvoiceRequest extends Request implements HasBody public function __construct( public readonly string $invoiceId, public readonly UpdateInvoiceDTO $updateInvoiceDTO, - ) {} + ) { + } public function resolveEndpoint(): string { diff --git a/src/Invoice/DTO/CreateInvoiceDTO.php b/src/Invoice/DTO/CreateInvoiceDTO.php index 36dbb52..4555f00 100644 --- a/src/Invoice/DTO/CreateInvoiceDTO.php +++ b/src/Invoice/DTO/CreateInvoiceDTO.php @@ -13,7 +13,8 @@ public function __construct( public ?string $backUrl = null, public ?string $expiredAt = null, public ?array $metadata = null, - ) {} + ) { + } public static function fromArray(array $data): self { diff --git a/src/Invoice/DTO/UpdateInvoiceDTO.php b/src/Invoice/DTO/UpdateInvoiceDTO.php index 5829d89..1c161ba 100644 --- a/src/Invoice/DTO/UpdateInvoiceDTO.php +++ b/src/Invoice/DTO/UpdateInvoiceDTO.php @@ -9,5 +9,6 @@ */ public function __construct( public array $metadata, - ) {} + ) { + } } diff --git a/src/Moyasar.php b/src/Moyasar.php index c0eb367..8f2e249 100644 --- a/src/Moyasar.php +++ b/src/Moyasar.php @@ -12,7 +12,8 @@ class Moyasar extends Connector public function __construct( protected readonly string $baseUrl, protected readonly string $apiKey, - ) {} + ) { + } public function resolveBaseUrl(): string { diff --git a/src/Payment/APIs/CapturePaymentRequest.php b/src/Payment/APIs/CapturePaymentRequest.php index c19875c..b63c306 100644 --- a/src/Payment/APIs/CapturePaymentRequest.php +++ b/src/Payment/APIs/CapturePaymentRequest.php @@ -18,7 +18,8 @@ class CapturePaymentRequest extends Request implements HasBody public function __construct( public readonly string $paymentId, public readonly ?int $amount = null, - ) {} + ) { + } public function resolveEndpoint(): string { diff --git a/src/Payment/APIs/CreatePaymentRequest.php b/src/Payment/APIs/CreatePaymentRequest.php index a68232c..e1478c9 100644 --- a/src/Payment/APIs/CreatePaymentRequest.php +++ b/src/Payment/APIs/CreatePaymentRequest.php @@ -19,7 +19,8 @@ class CreatePaymentRequest extends Request implements HasBody public function __construct( public readonly CreatePaymentDTO $createPaymentDTO, - ) {} + ) { + } public function resolveEndpoint(): string { diff --git a/src/Payment/APIs/GetPaymentRequest.php b/src/Payment/APIs/GetPaymentRequest.php index 68740c2..039b0a2 100644 --- a/src/Payment/APIs/GetPaymentRequest.php +++ b/src/Payment/APIs/GetPaymentRequest.php @@ -13,7 +13,8 @@ class GetPaymentRequest extends Request public function __construct( public readonly string $paymentId, - ) {} + ) { + } public function resolveEndpoint(): string { diff --git a/src/Payment/APIs/RefundPaymentRequest.php b/src/Payment/APIs/RefundPaymentRequest.php index ba0afcd..1be8dc7 100644 --- a/src/Payment/APIs/RefundPaymentRequest.php +++ b/src/Payment/APIs/RefundPaymentRequest.php @@ -18,7 +18,8 @@ class RefundPaymentRequest extends Request implements HasBody public function __construct( public readonly string $paymentId, public readonly ?int $amount = null, - ) {} + ) { + } public function resolveEndpoint(): string { diff --git a/src/Payment/APIs/UpdatePaymentRequest.php b/src/Payment/APIs/UpdatePaymentRequest.php index f760e31..0de1ed0 100644 --- a/src/Payment/APIs/UpdatePaymentRequest.php +++ b/src/Payment/APIs/UpdatePaymentRequest.php @@ -19,7 +19,8 @@ class UpdatePaymentRequest extends Request implements HasBody public function __construct( public readonly string $paymentId, public readonly UpdatePaymentDTO $updatePaymentDTO, - ) {} + ) { + } public function resolveEndpoint(): string { diff --git a/src/Payment/APIs/VoidPaymentRequest.php b/src/Payment/APIs/VoidPaymentRequest.php index fe830c8..26f89fd 100644 --- a/src/Payment/APIs/VoidPaymentRequest.php +++ b/src/Payment/APIs/VoidPaymentRequest.php @@ -13,7 +13,8 @@ class VoidPaymentRequest extends Request public function __construct( public readonly string $paymentId, - ) {} + ) { + } public function resolveEndpoint(): string { diff --git a/src/Payment/DTO/CreatePaymentDTO.php b/src/Payment/DTO/CreatePaymentDTO.php index c4b1d43..9d00180 100644 --- a/src/Payment/DTO/CreatePaymentDTO.php +++ b/src/Payment/DTO/CreatePaymentDTO.php @@ -19,7 +19,8 @@ public function __construct( public ?string $callbackUrl = null, public ?array $metadata = null, public ?bool $applyCoupon = null, - ) {} + ) { + } /** * @param array $data diff --git a/src/Payment/DTO/PaymentDTO.php b/src/Payment/DTO/PaymentDTO.php index 5743d72..db0510d 100644 --- a/src/Payment/DTO/PaymentDTO.php +++ b/src/Payment/DTO/PaymentDTO.php @@ -37,7 +37,8 @@ public function __construct( public array $metadata, public array $source, public ?string $givenId = null, - ) {} + ) { + } public static function fromResponse(Response $response): self { diff --git a/src/Payment/DTO/Source/CreditCardSourceDTO.php b/src/Payment/DTO/Source/CreditCardSourceDTO.php index f8bf318..fe5c91f 100644 --- a/src/Payment/DTO/Source/CreditCardSourceDTO.php +++ b/src/Payment/DTO/Source/CreditCardSourceDTO.php @@ -16,7 +16,8 @@ public function __construct( public ?bool $manual = null, public ?bool $saveCard = null, public ?string $token = null, - ) {} + ) { + } /** * @return array diff --git a/src/Payment/DTO/UpdatePaymentDTO.php b/src/Payment/DTO/UpdatePaymentDTO.php index c8de99e..e486797 100644 --- a/src/Payment/DTO/UpdatePaymentDTO.php +++ b/src/Payment/DTO/UpdatePaymentDTO.php @@ -10,5 +10,6 @@ public function __construct( public ?string $description = null, public ?array $metadata = null, - ) {} + ) { + } } diff --git a/src/Payment/PaymentResource.php b/src/Payment/PaymentResource.php index ee5479b..aab3c06 100644 --- a/src/Payment/PaymentResource.php +++ b/src/Payment/PaymentResource.php @@ -23,7 +23,7 @@ public function get(string $paymentId): PaymentDTO public function list(): ListPaymentsRequest { - return new ListPaymentsRequest; + return new ListPaymentsRequest(); } public function create(CreatePaymentDTO $dto): PaymentDTO diff --git a/tests/Config/ExtraData.php b/tests/Config/ExtraData.php index dad18f7..16f77e3 100644 --- a/tests/Config/ExtraData.php +++ b/tests/Config/ExtraData.php @@ -8,7 +8,8 @@ class ExtraData { public function __construct( private readonly MockClient $client - ) {} + ) { + } public function getClient(): MockClient { diff --git a/tests/Config/MockResponses.php b/tests/Config/MockResponses.php index 748010b..ea840ae 100644 --- a/tests/Config/MockResponses.php +++ b/tests/Config/MockResponses.php @@ -4,21 +4,25 @@ use Saloon\Http\Faking\MockResponse; use Tests\Config\Samples\InvoiceSamples; +use HamodaDev\Moyasar\Invoice\APIs\CancelInvoiceRequest; +use HamodaDev\Moyasar\Invoice\APIs\BulkCreateInvoicesRequest; +use HamodaDev\Moyasar\Invoice\APIs\CreateInvoiceRequest; +use HamodaDev\Moyasar\Invoice\APIs\GetInvoiceRequest; +use HamodaDev\Moyasar\Invoice\APIs\ListInvoicesRequest; +use HamodaDev\Moyasar\Invoice\APIs\UpdateInvoiceRequest; return [ // invoice - \HamodaDev\Moyasar\Invoice\APIs\CreateInvoiceRequest::class => MockResponse::make(body: InvoiceSamples::TEST_INVOICE), - \HamodaDev\Moyasar\Invoice\APIs\BulkCreateInvoicesRequest::class => MockResponse::make(body: [ + CreateInvoiceRequest::class => MockResponse::make(body: InvoiceSamples::TEST_INVOICE), + BulkCreateInvoicesRequest::class => MockResponse::make(body: [ 'invoices' => [InvoiceSamples::TEST_INVOICE, InvoiceSamples::TEST_INVOICE_2] ]), - \HamodaDev\Moyasar\Invoice\APIs\GetInvoiceRequest::class => MockResponse::make(body: InvoiceSamples::TEST_INVOICE_3), - \HamodaDev\Moyasar\Invoice\APIs\ListInvoicesRequest::class => MockResponse::make(body: [ + GetInvoiceRequest::class => MockResponse::make(body: InvoiceSamples::TEST_INVOICE_3), + ListInvoicesRequest::class => MockResponse::make(body: [ 'invoices' => [InvoiceSamples::TEST_INVOICE, InvoiceSamples::TEST_INVOICE_2, InvoiceSamples::TEST_INVOICE_3], ]), - \HamodaDev\Moyasar\Invoice\APIs\UpdateInvoiceRequest::class => MockResponse::make(body: InvoiceSamples::TEST_INVOICE), - \HamodaDev\Moyasar\Invoice\APIs\CancelInvoiceRequest::class => MockResponse::make(body: InvoiceSamples::CANCELED_TEST_INVOICE), + UpdateInvoiceRequest::class => MockResponse::make(body: InvoiceSamples::TEST_INVOICE), + CancelInvoiceRequest::class => MockResponse::make(body: InvoiceSamples::CANCELED_TEST_INVOICE), - // payment - /** TODO */ + //TODO: payment ]; - diff --git a/tests/Config/Samples/InvoiceSamples.php b/tests/Config/Samples/InvoiceSamples.php index 8466af0..2fe2265 100644 --- a/tests/Config/Samples/InvoiceSamples.php +++ b/tests/Config/Samples/InvoiceSamples.php @@ -6,7 +6,7 @@ class InvoiceSamples { /** @var string */ public const MOCK_URL = "https://example.com"; - + /** @var array */ public const TEST_INVOICE = [ 'id' => '1234', @@ -20,7 +20,7 @@ class InvoiceSamples 'order_id' => '1234' ], ]; - + /** @var array */ public const array CANCELED_TEST_INVOICE = [ 'id' => '1234', @@ -34,7 +34,7 @@ class InvoiceSamples 'order_id' => '1234' ], ]; - + /** @var array */ public const array TEST_INVOICE_2 = [ 'id' => '5678', @@ -45,7 +45,7 @@ class InvoiceSamples 'amount_format' => '10.00 SAR', 'url' => self::MOCK_URL, ]; - + /** @var array */ public const array TEST_INVOICE_3 = [ 'id' => '91011', diff --git a/tests/ExampleTest.php b/tests/ExampleTest.php deleted file mode 100644 index b193d74..0000000 --- a/tests/ExampleTest.php +++ /dev/null @@ -1,3 +0,0 @@ - expect(true)->toBe(true)); diff --git a/tests/Feature/ExampleTest.php b/tests/Feature/ExampleTest.php deleted file mode 100644 index 61cd84c..0000000 --- a/tests/Feature/ExampleTest.php +++ /dev/null @@ -1,5 +0,0 @@ -toBeTrue(); -}); diff --git a/tests/Unit/.gitkeep b/tests/Unit/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/tests/Unit/ExampleTest.php b/tests/Unit/ExampleTest.php deleted file mode 100644 index 61cd84c..0000000 --- a/tests/Unit/ExampleTest.php +++ /dev/null @@ -1,5 +0,0 @@ -toBeTrue(); -}); From 8a73208a79d0780a2522f07f0bec848c9d348a9a Mon Sep 17 00:00:00 2001 From: Mohammed Hamoda Date: Wed, 6 May 2026 04:21:09 +0200 Subject: [PATCH 2/4] run the tests in the pip --- .github/workflows/ci.yml | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index f49cb0e..33de2d5 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -22,11 +22,14 @@ jobs: - name: Install dependencies run: composer install --prefer-dist --no-progress + - name: Copy the phpunit.xml + run: cp phpunit.xml.dist phpunit.xml + - name: Check code style run: composer cs-check # - name: Run PHPStan # run: composer stan - # - name: Run tests - # run: composer test + - name: Run tests + run: composer test From 89da2e42953d7df576d433a307bf935d81a88389 Mon Sep 17 00:00:00 2001 From: Mohammed Hamoda Date: Wed, 6 May 2026 05:12:50 +0200 Subject: [PATCH 3/4] refator the MockResponse to be class insted of returned file --- tests/Config/MockResponses.php | 46 ++++++++++++++++++++--------- tests/Config/MoyasarInitializer.php | 3 +- 2 files changed, 33 insertions(+), 16 deletions(-) diff --git a/tests/Config/MockResponses.php b/tests/Config/MockResponses.php index ea840ae..5de949d 100644 --- a/tests/Config/MockResponses.php +++ b/tests/Config/MockResponses.php @@ -11,18 +11,36 @@ use HamodaDev\Moyasar\Invoice\APIs\ListInvoicesRequest; use HamodaDev\Moyasar\Invoice\APIs\UpdateInvoiceRequest; -return [ - // invoice - CreateInvoiceRequest::class => MockResponse::make(body: InvoiceSamples::TEST_INVOICE), - BulkCreateInvoicesRequest::class => MockResponse::make(body: [ - 'invoices' => [InvoiceSamples::TEST_INVOICE, InvoiceSamples::TEST_INVOICE_2] - ]), - GetInvoiceRequest::class => MockResponse::make(body: InvoiceSamples::TEST_INVOICE_3), - ListInvoicesRequest::class => MockResponse::make(body: [ - 'invoices' => [InvoiceSamples::TEST_INVOICE, InvoiceSamples::TEST_INVOICE_2, InvoiceSamples::TEST_INVOICE_3], - ]), - UpdateInvoiceRequest::class => MockResponse::make(body: InvoiceSamples::TEST_INVOICE), - CancelInvoiceRequest::class => MockResponse::make(body: InvoiceSamples::CANCELED_TEST_INVOICE), +class MockResponses +{ + public static function getAll(): array + { + return array_merge( + self::invoiceResponses(), + // self::paymentResponses(), // TODO: add when payment mocks are ready + ); + } - //TODO: payment -]; + private static function invoiceResponses(): array + { + return [ + CreateInvoiceRequest::class => MockResponse::make(body: InvoiceSamples::TEST_INVOICE), + BulkCreateInvoicesRequest::class => MockResponse::make(body: [ + 'invoices' => [ + InvoiceSamples::TEST_INVOICE, + InvoiceSamples::TEST_INVOICE_2, + ], + ]), + GetInvoiceRequest::class => MockResponse::make(body: InvoiceSamples::TEST_INVOICE_3), + ListInvoicesRequest::class => MockResponse::make(body: [ + 'invoices' => [ + InvoiceSamples::TEST_INVOICE, + InvoiceSamples::TEST_INVOICE_2, + InvoiceSamples::TEST_INVOICE_3, + ], + ]), + UpdateInvoiceRequest::class => MockResponse::make(body: InvoiceSamples::TEST_INVOICE), + CancelInvoiceRequest::class => MockResponse::make(body: InvoiceSamples::CANCELED_TEST_INVOICE), + ]; + } +} diff --git a/tests/Config/MoyasarInitializer.php b/tests/Config/MoyasarInitializer.php index 7cf8cd8..8e6a153 100644 --- a/tests/Config/MoyasarInitializer.php +++ b/tests/Config/MoyasarInitializer.php @@ -29,8 +29,7 @@ public static function getInstance(): self apiKey: "sk_test_AbCd", ); - /** @var array */ - $mockRouter = require_once "MockResponses.php"; + $mockRouter = MockResponses::getAll(); $extra = new ExtraData(new MockClient($mockRouter)); $moyasar->withMockClient($extra->getClient()); From b1c867d03bbc71498c6b348c24f737885ac1f6aa Mon Sep 17 00:00:00 2001 From: Mohammed Hamoda Date: Wed, 6 May 2026 05:28:09 +0200 Subject: [PATCH 4/4] use phpstan --- .github/workflows/ci.yml | 6 ++--- composer.json | 4 +-- composer.lock | 33 ++++++++++++++----------- phpstan.neon | 3 ++- tests/Config/Samples/InvoiceSamples.php | 4 +-- tests/Pest.php | 6 +---- 6 files changed, 29 insertions(+), 27 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 33de2d5..1ea9ce8 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -8,7 +8,7 @@ jobs: strategy: fail-fast: true matrix: - php: [8.2, 8.3, 8.4, 8.5] + php: [8.3, 8.4, 8.5] steps: - uses: actions/checkout@v4 @@ -28,8 +28,8 @@ jobs: - name: Check code style run: composer cs-check - # - name: Run PHPStan - # run: composer stan + - name: Run PHPStan + run: composer stan - name: Run tests run: composer test diff --git a/composer.json b/composer.json index 0c31811..f1dac97 100644 --- a/composer.json +++ b/composer.json @@ -27,7 +27,7 @@ "prefer-stable": true, "config": { "platform": { - "php": "8.2.0" + "php": "8.3.0" }, "allow-plugins": { "pestphp/pest-plugin": true @@ -49,4 +49,4 @@ "@test" ] } -} +} \ No newline at end of file diff --git a/composer.lock b/composer.lock index 7ba6a0b..c581aa1 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "71798ca3ccf65b3002efd11d920a1b41", + "content-hash": "745775b7253ceb81109cff4a620c2157", "packages": [ { "name": "guzzlehttp/guzzle", @@ -3820,16 +3820,16 @@ }, { "name": "symfony/console", - "version": "v7.4.8", + "version": "v7.4.9", "source": { "type": "git", "url": "https://github.com/symfony/console.git", - "reference": "1e92e39c51f95b88e3d66fa2d9f06d1fb45dd707" + "reference": "d7d2b64a45a89d607865927b176fa51c33ddbb58" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/console/zipball/1e92e39c51f95b88e3d66fa2d9f06d1fb45dd707", - "reference": "1e92e39c51f95b88e3d66fa2d9f06d1fb45dd707", + "url": "https://api.github.com/repos/symfony/console/zipball/d7d2b64a45a89d607865927b176fa51c33ddbb58", + "reference": "d7d2b64a45a89d607865927b176fa51c33ddbb58", "shasum": "" }, "require": { @@ -3894,7 +3894,7 @@ "terminal" ], "support": { - "source": "https://github.com/symfony/console/tree/v7.4.8" + "source": "https://github.com/symfony/console/tree/v7.4.9" }, "funding": [ { @@ -3914,7 +3914,7 @@ "type": "tidelift" } ], - "time": "2026-03-30T13:54:39+00:00" + "time": "2026-04-22T15:21:55+00:00" }, { "name": "symfony/finder", @@ -4236,19 +4236,20 @@ }, { "name": "symfony/polyfill-mbstring", - "version": "v1.31.0", + "version": "v1.37.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-mbstring.git", - "reference": "85181ba99b2345b0ef10ce42ecac37612d9fd341" + "reference": "6a21eb99c6973357967f6ce3708cd55a6bec6315" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/85181ba99b2345b0ef10ce42ecac37612d9fd341", - "reference": "85181ba99b2345b0ef10ce42ecac37612d9fd341", + "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/6a21eb99c6973357967f6ce3708cd55a6bec6315", + "reference": "6a21eb99c6973357967f6ce3708cd55a6bec6315", "shasum": "" }, "require": { + "ext-iconv": "*", "php": ">=7.2" }, "provide": { @@ -4296,7 +4297,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-mbstring/tree/v1.31.0" + "source": "https://github.com/symfony/polyfill-mbstring/tree/v1.37.0" }, "funding": [ { @@ -4307,12 +4308,16 @@ "url": "https://github.com/fabpot", "type": "github" }, + { + "url": "https://github.com/nicolas-grekas", + "type": "github" + }, { "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", "type": "tidelift" } ], - "time": "2024-09-09T11:45:10+00:00" + "time": "2026-04-10T17:25:58+00:00" }, { "name": "symfony/process", @@ -4737,7 +4742,7 @@ "platform": {}, "platform-dev": {}, "platform-overrides": { - "php": "8.2.0" + "php": "8.3.0" }, "plugin-api-version": "2.9.0" } diff --git a/phpstan.neon b/phpstan.neon index 74bf342..79b90ad 100644 --- a/phpstan.neon +++ b/phpstan.neon @@ -1,4 +1,5 @@ parameters: paths: - src - level: 1 + - tests + level: 5 diff --git a/tests/Config/Samples/InvoiceSamples.php b/tests/Config/Samples/InvoiceSamples.php index 2fe2265..102bb84 100644 --- a/tests/Config/Samples/InvoiceSamples.php +++ b/tests/Config/Samples/InvoiceSamples.php @@ -5,10 +5,10 @@ class InvoiceSamples { /** @var string */ - public const MOCK_URL = "https://example.com"; + public const string MOCK_URL = "https://example.com"; /** @var array */ - public const TEST_INVOICE = [ + public const array TEST_INVOICE = [ 'id' => '1234', 'status' => 'initiated', 'amount' => 1000, diff --git a/tests/Pest.php b/tests/Pest.php index 4c964f8..6a1d083 100644 --- a/tests/Pest.php +++ b/tests/Pest.php @@ -28,12 +28,8 @@ | */ -expect()->extend('toBeOne', function () { - return $this->toBe(1); -}); - uses() - ->beforeEach(fn() => MockClient::destroyGlobal()) + ->beforeEach(fn () => MockClient::destroyGlobal()) ->in(__DIR__); function validateEnvIsSet()