Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 10 additions & 7 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -22,11 +22,14 @@ jobs:
- name: Install dependencies
run: composer install --prefer-dist --no-progress

# - name: Check code style
# run: composer cs-check
- name: Copy the phpunit.xml
run: cp phpunit.xml.dist phpunit.xml

# - name: Run PHPStan
# run: composer stan
- name: Check code style
run: composer cs-check

# - name: Run tests
# run: composer test
- name: Run PHPStan
run: composer stan

- name: Run tests
run: composer test
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
"prefer-stable": true,
"config": {
"platform": {
"php": "8.2.0"
"php": "8.3.0"
},
"allow-plugins": {
"pestphp/pest-plugin": true
Expand All @@ -49,4 +49,4 @@
"@test"
]
}
}
}
33 changes: 19 additions & 14 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion phpstan.neon
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
parameters:
paths:
- src
level: 1
- tests
level: 5
3 changes: 2 additions & 1 deletion src/Invoice/APIs/CancelInvoiceRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@ class CancelInvoiceRequest extends Request

public function __construct(
public readonly string $invoiceId,
) {}
) {
}

public function resolveEndpoint(): string
{
Expand Down
3 changes: 2 additions & 1 deletion src/Invoice/APIs/CreateInvoiceRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@ class CreateInvoiceRequest extends Request implements HasBody

public function __construct(
public readonly CreateInvoiceDTO $createInvoiceDTO,
) {}
) {
}

public function resolveEndpoint(): string
{
Expand Down
3 changes: 2 additions & 1 deletion src/Invoice/APIs/GetInvoiceRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@ class GetInvoiceRequest extends Request

public function __construct(
public readonly string $invoiceId,
) {}
) {
}

public function resolveEndpoint(): string
{
Expand Down
3 changes: 2 additions & 1 deletion src/Invoice/APIs/UpdateInvoiceRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
{
Expand Down
3 changes: 2 additions & 1 deletion src/Invoice/DTO/CreateInvoiceDTO.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
{
Expand Down
3 changes: 2 additions & 1 deletion src/Invoice/DTO/UpdateInvoiceDTO.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,6 @@
*/
public function __construct(
public array $metadata,
) {}
) {
}
}
3 changes: 2 additions & 1 deletion src/Moyasar.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@ class Moyasar extends Connector
public function __construct(
protected readonly string $baseUrl,
protected readonly string $apiKey,
) {}
) {
}

public function resolveBaseUrl(): string
{
Expand Down
3 changes: 2 additions & 1 deletion src/Payment/APIs/CapturePaymentRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
{
Expand Down
3 changes: 2 additions & 1 deletion src/Payment/APIs/CreatePaymentRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@ class CreatePaymentRequest extends Request implements HasBody

public function __construct(
public readonly CreatePaymentDTO $createPaymentDTO,
) {}
) {
}

public function resolveEndpoint(): string
{
Expand Down
3 changes: 2 additions & 1 deletion src/Payment/APIs/GetPaymentRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@ class GetPaymentRequest extends Request

public function __construct(
public readonly string $paymentId,
) {}
) {
}

public function resolveEndpoint(): string
{
Expand Down
3 changes: 2 additions & 1 deletion src/Payment/APIs/RefundPaymentRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
{
Expand Down
3 changes: 2 additions & 1 deletion src/Payment/APIs/UpdatePaymentRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
{
Expand Down
3 changes: 2 additions & 1 deletion src/Payment/APIs/VoidPaymentRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@ class VoidPaymentRequest extends Request

public function __construct(
public readonly string $paymentId,
) {}
) {
}

public function resolveEndpoint(): string
{
Expand Down
3 changes: 2 additions & 1 deletion src/Payment/DTO/CreatePaymentDTO.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@ public function __construct(
public ?string $callbackUrl = null,
public ?array $metadata = null,
public ?bool $applyCoupon = null,
) {}
) {
}

/**
* @param array<string, mixed> $data
Expand Down
3 changes: 2 additions & 1 deletion src/Payment/DTO/PaymentDTO.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,8 @@ public function __construct(
public array $metadata,
public array $source,
public ?string $givenId = null,
) {}
) {
}

public static function fromResponse(Response $response): self
{
Expand Down
3 changes: 2 additions & 1 deletion src/Payment/DTO/Source/CreditCardSourceDTO.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@ public function __construct(
public ?bool $manual = null,
public ?bool $saveCard = null,
public ?string $token = null,
) {}
) {
}

/**
* @return array<string, mixed>
Expand Down
3 changes: 2 additions & 1 deletion src/Payment/DTO/UpdatePaymentDTO.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,6 @@
public function __construct(
public ?string $description = null,
public ?array $metadata = null,
) {}
) {
}
}
2 changes: 1 addition & 1 deletion src/Payment/PaymentResource.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 2 additions & 1 deletion tests/Config/ExtraData.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@ class ExtraData
{
public function __construct(
private readonly MockClient $client
) {}
) {
}

public function getClient(): MockClient
{
Expand Down
Loading
Loading