Skip to content

Commit

Permalink
Fixes coding style
Browse files Browse the repository at this point in the history
  • Loading branch information
Naoray authored and github-actions[bot] committed Jan 20, 2025
1 parent e3898ff commit 2cac3e1
Show file tree
Hide file tree
Showing 20 changed files with 33 additions and 36 deletions.
2 changes: 1 addition & 1 deletion src/EndpointCollection/PaymentEndpointCollection.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
namespace Mollie\Api\EndpointCollection;

use Mollie\Api\Exceptions\ApiException;
use Mollie\Api\Factories\CreatePaymentRequestFactory;
use Mollie\Api\Factories\CreatePaymentRefundRequestFactory;
use Mollie\Api\Factories\CreatePaymentRequestFactory;
use Mollie\Api\Factories\GetPaymentRequestFactory;
use Mollie\Api\Factories\SortablePaginatedQueryFactory;
use Mollie\Api\Factories\UpdatePaymentRequestFactory;
Expand Down
2 changes: 1 addition & 1 deletion src/Factories/CreateMandatePayloadFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ public function create(): CreateMandatePayload
$this->get('consumerAccount'),
$this->get('consumerBic'),
$this->get('consumerEmail'),
$this->mapIfNotNull('signatureDate', fn(string $date) => DateTimeImmutable::createFromFormat('Y-m-d', $date)),
$this->mapIfNotNull('signatureDate', fn (string $date) => DateTimeImmutable::createFromFormat('Y-m-d', $date)),
$this->get('mandateReference'),
$this->get('paypalBillingAgreementId'),
);
Expand Down
2 changes: 1 addition & 1 deletion src/Factories/CreatePaymentCapturePayloadFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ public function create(): CreatePaymentCapturePayload
{
return new CreatePaymentCapturePayload(
$this->get('description'),
$this->mapIfNotNull('amount', fn(array $item) => MoneyFactory::new($item)->create()),
$this->mapIfNotNull('amount', fn (array $item) => MoneyFactory::new($item)->create()),
$this->mapIfNotNull('metadata', Metadata::class)
);
}
Expand Down
2 changes: 1 addition & 1 deletion src/Factories/CreatePaymentLinkPayloadFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ public function create(): CreatePaymentLinkPayload
{
return new CreatePaymentLinkPayload(
$this->get('description'),
$this->mapIfNotNull('amount', fn(array $amount) => MoneyFactory::new($amount)->create()),
$this->mapIfNotNull('amount', fn (array $amount) => MoneyFactory::new($amount)->create()),
$this->get('redirectUrl'),
$this->get('webhookUrl'),
$this->get('profileId'),
Expand Down
2 changes: 1 addition & 1 deletion src/Factories/CreatePaymentRefundRequestFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ public function create(): CreatePaymentRefundRequest
$this
->mapIfNotNull(
'routingReversals',
fn(array $items) => RefundRouteCollectionFactory::new($items)->create()
fn (array $items) => RefundRouteCollectionFactory::new($items)->create()
),
);
}
Expand Down
10 changes: 5 additions & 5 deletions src/Factories/CreatePaymentRequestFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,10 @@ public function create(): CreatePaymentRequest
$this
->mapIfNotNull(
'lines',
fn(array $items) => OrderLineCollectionFactory::new($items)->create()
fn (array $items) => OrderLineCollectionFactory::new($items)->create()
),
$this->mapIfNotNull('billingAddress', fn(array $item) => Address::fromArray($item)),
$this->mapIfNotNull('shippingAddress', fn(array $item) => Address::fromArray($item)),
$this->mapIfNotNull('billingAddress', fn (array $item) => Address::fromArray($item)),
$this->mapIfNotNull('shippingAddress', fn (array $item) => Address::fromArray($item)),
$this->payload('locale'),
$this->payload('method'),
$this->payload('issuer'),
Expand All @@ -39,11 +39,11 @@ public function create(): CreatePaymentRequest
$this->payload('captureDelay'),
$this->mapIfNotNull(
'applicationFee',
fn(array $item) => ApplicationFeeFactory::new($item)->create()
fn (array $item) => ApplicationFeeFactory::new($item)->create()
),
$this->mapIfNotNull(
'routing',
fn(array $items) => PaymentRouteCollectionFactory::new($items)->create()
fn (array $items) => PaymentRouteCollectionFactory::new($items)->create()
),
$this->payload('sequenceType'),
$this->payload('mandateId'),
Expand Down
8 changes: 4 additions & 4 deletions src/Factories/CreateSalesInvoicePayloadFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,14 @@ public function create(): CreateSalesInvoicePayload
$this
->mapIfNotNull(
'lines',
fn(array $items) => InvoiceLineCollectionFactory::new($items)->create()
fn (array $items) => InvoiceLineCollectionFactory::new($items)->create()
),
$this->get('profileId'),
$this->get('memo'),
$this->mapIfNotNull('paymentDetails', fn(array $data) => PaymentDetails::fromArray($data)),
$this->mapIfNotNull('emailDetails', fn(array $data) => EmailDetails::fromArray($data)),
$this->mapIfNotNull('paymentDetails', fn (array $data) => PaymentDetails::fromArray($data)),
$this->mapIfNotNull('emailDetails', fn (array $data) => EmailDetails::fromArray($data)),
$this->get('webhookUrl'),
$this->mapIfNotNull('discount', fn(array $data) => Discount::fromArray($data))
$this->mapIfNotNull('discount', fn (array $data) => Discount::fromArray($data))
);
}
}
4 changes: 2 additions & 2 deletions src/Factories/CreateSubscriptionPayloadFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ public function create(): CreateSubscriptionPayload
$this->get('description'),
$this->get('status'),
$this->get('times'),
$this->mapIfNotNull('startDate', fn(string $date) => DateTimeImmutable::createFromFormat('Y-m-d', $date)),
$this->mapIfNotNull('startDate', fn (string $date) => DateTimeImmutable::createFromFormat('Y-m-d', $date)),
$this->get('method'),
$this->mapIfNotNull('applicationFee', fn(array $fee) => ApplicationFeeFactory::new($fee)->create()),
$this->mapIfNotNull('applicationFee', fn (array $fee) => ApplicationFeeFactory::new($fee)->create()),
$this->mapIfNotNull('metadata', Metadata::class),
$this->get('webhookUrl'),
$this->get('mandateId'),
Expand Down
2 changes: 1 addition & 1 deletion src/Factories/GetEnabledPaymentMethodsQueryFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ public function create(): GetEnabledPaymentMethodsQuery
$this->get('sequenceType', SequenceType::ONEOFF),
$this->get('resource', MethodQuery::RESOURCE_PAYMENTS),
$this->get('locale'),
$this->mapIfNotNull('amount', fn(array $item) => MoneyFactory::new($item)->create()),
$this->mapIfNotNull('amount', fn (array $item) => MoneyFactory::new($item)->create()),
$this->get('billingCountry'),
$this->get('includeWallets'),
$this->get('orderLineCategories', []),
Expand Down
2 changes: 1 addition & 1 deletion src/Factories/InvoiceLineCollectionFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ class InvoiceLineCollectionFactory extends OldFactory
public function create(): DataCollection
{
return new DataCollection(array_map(
fn(array $item) => InvoiceLineFactory::new($item)->create(),
fn (array $item) => InvoiceLineFactory::new($item)->create(),
$this->data
));
}
Expand Down
2 changes: 1 addition & 1 deletion src/Factories/InvoiceLineFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ public function create(): InvoiceLine
$this->get('quantity'),
$this->get('vatRate'),
MoneyFactory::new($this->get('unitPrice'))->create(),
$this->mapIfNotNull('discount', fn(array $data) => Discount::fromArray($data))
$this->mapIfNotNull('discount', fn (array $data) => Discount::fromArray($data))
);
}
}
2 changes: 1 addition & 1 deletion src/Factories/OrderLineCollectionFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ class OrderLineCollectionFactory extends OldFactory
public function create(): DataCollection
{
return new DataCollection(array_map(
fn(array $item) => OrderLineFactory::new($item)->create(),
fn (array $item) => OrderLineFactory::new($item)->create(),
$this->data
));
}
Expand Down
6 changes: 3 additions & 3 deletions src/Factories/OrderLineFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@ public function create(): OrderLine
MoneyFactory::new($this->get('totalAmount'))->create(),
$this->get('type'),
$this->get('quantityUnit'),
$this->mapIfNotNull('discountAmount', fn(array $item) => MoneyFactory::new($item)->create()),
$this->mapIfNotNull('recurring', fn(array $item) => RecurringBillingCycleFactory::new($item)->create()),
$this->mapIfNotNull('discountAmount', fn (array $item) => MoneyFactory::new($item)->create()),
$this->mapIfNotNull('recurring', fn (array $item) => RecurringBillingCycleFactory::new($item)->create()),
$this->get('vatRate'),
$this->mapIfNotNull('vatAmount', fn(array $item) => MoneyFactory::new($item)->create()),
$this->mapIfNotNull('vatAmount', fn (array $item) => MoneyFactory::new($item)->create()),
$this->get('sku'),
$this->get('imageUrl'),
$this->get('productUrl'),
Expand Down
2 changes: 1 addition & 1 deletion src/Factories/PaymentRouteCollectionFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ public function create(): DataCollection
Arr::get($item, 'destination.organizationId'),
Utility::compose(
Arr::get($item, 'delayUntil'),
fn($value) => DateTimeImmutable::createFromFormat('Y-m-d', $value)
fn ($value) => DateTimeImmutable::createFromFormat('Y-m-d', $value)
)
);
}, $this->data);
Expand Down
4 changes: 2 additions & 2 deletions src/Factories/RecurringBillingCycleFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ public function create(): RecurringBillingCycle
return new RecurringBillingCycle(
$this->get('interval'),
$this->get('descriptipn'),
$this->mapIfNotNull('amount', fn(array $item) => MoneyFactory::new($item)->create()),
$this->mapIfNotNull('amount', fn (array $item) => MoneyFactory::new($item)->create()),
$this->get('times'),
$this->mapIfNotNull('startDate', fn(string $item) => DateTimeImmutable::createFromFormat('Y-m-d', $item)),
$this->mapIfNotNull('startDate', fn (string $item) => DateTimeImmutable::createFromFormat('Y-m-d', $item)),
);
}
}
10 changes: 5 additions & 5 deletions src/Factories/UpdateSalesInvoicePayloadFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,16 +19,16 @@ public function create(): UpdateSalesInvoicePayload
$this->get('recipientIdentifier'),
$this->get('paymentTerm'),
$this->get('memo'),
$this->mapIfNotNull('paymentDetails', fn(array $data) => PaymentDetails::fromArray($data)),
$this->mapIfNotNull('emailDetails', fn(array $data) => EmailDetails::fromArray($data)),
$this->mapIfNotNull('recipient', fn(array $data) => RecipientFactory::new($data)->create()),
$this->mapIfNotNull('paymentDetails', fn (array $data) => PaymentDetails::fromArray($data)),
$this->mapIfNotNull('emailDetails', fn (array $data) => EmailDetails::fromArray($data)),
$this->mapIfNotNull('recipient', fn (array $data) => RecipientFactory::new($data)->create()),
$this
->mapIfNotNull(
'lines',
fn(array $items) => InvoiceLineCollectionFactory::new($items)->create()
fn (array $items) => InvoiceLineCollectionFactory::new($items)->create()
),
$this->get('webhookUrl'),
$this->mapIfNotNull('discount', fn(array $data) => Discount::fromArray($data))
$this->mapIfNotNull('discount', fn (array $data) => Discount::fromArray($data))
);
}
}
4 changes: 2 additions & 2 deletions src/Factories/UpdateSubscriptionPayloadFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@ class UpdateSubscriptionPayloadFactory extends OldFactory
public function create(): UpdateSubscriptionPayload
{
return new UpdateSubscriptionPayload(
$this->mapIfNotNull('amount', fn(array $amount) => MoneyFactory::new($amount)->create()),
$this->mapIfNotNull('amount', fn (array $amount) => MoneyFactory::new($amount)->create()),
$this->get('description'),
$this->get('interval'),
$this->mapIfNotNull('startDate', fn(string $date) => DateTimeImmutable::createFromFormat('Y-m-d', $date)),
$this->mapIfNotNull('startDate', fn (string $date) => DateTimeImmutable::createFromFormat('Y-m-d', $date)),
$this->get('times'),
$this->mapIfNotNull('metadata', Metadata::class),
$this->get('webhookUrl'),
Expand Down
1 change: 0 additions & 1 deletion src/Http/Requests/UpdatePaymentRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
use Mollie\Api\Contracts\HasPayload;
use Mollie\Api\Contracts\SupportsTestmodeInQuery;
use Mollie\Api\Http\Data\Metadata;
use Mollie\Api\Http\Data\UpdatePaymentPayload;
use Mollie\Api\Resources\Payment;
use Mollie\Api\Traits\HasJsonPayload;
use Mollie\Api\Types\Method;
Expand Down
1 change: 0 additions & 1 deletion tests/Http/Requests/CreatePaymentRequestTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@

use Mollie\Api\Fake\MockMollieClient;
use Mollie\Api\Fake\MockResponse;
use Mollie\Api\Http\Data\CreatePaymentPayload;
use Mollie\Api\Http\Data\Money;
use Mollie\Api\Http\Requests\CreatePaymentRequest;
use Mollie\Api\Resources\Payment;
Expand Down
1 change: 0 additions & 1 deletion tests/Http/Requests/UpdatePaymentRequestTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@

use Mollie\Api\Fake\MockMollieClient;
use Mollie\Api\Fake\MockResponse;
use Mollie\Api\Http\Data\UpdatePaymentPayload;
use Mollie\Api\Http\Requests\UpdatePaymentRequest;
use Mollie\Api\Resources\Payment;
use PHPUnit\Framework\TestCase;
Expand Down

0 comments on commit 2cac3e1

Please sign in to comment.