From 73a330c02b433d0c21018da0c76b110a17b5c869 Mon Sep 17 00:00:00 2001 From: Sander van Hooft Date: Mon, 9 Dec 2024 13:09:05 +0100 Subject: [PATCH 1/2] wip --- src/Endpoints/PaymentLinkPaymentEndpoint.php | 4 ++-- src/Endpoints/SettlementChargebackEndpoint.php | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Endpoints/PaymentLinkPaymentEndpoint.php b/src/Endpoints/PaymentLinkPaymentEndpoint.php index d118b3666..034664393 100644 --- a/src/Endpoints/PaymentLinkPaymentEndpoint.php +++ b/src/Endpoints/PaymentLinkPaymentEndpoint.php @@ -29,14 +29,14 @@ protected function getResourceObject() return new Payment($this->client); } - public function pageForId(string $paymentLinkId, string $from = null, int $limit = null, array $filters = []) + public function pageForId(string $paymentLinkId, ?string $from = null, ?int $limit = null, array $filters = []) { $this->parentId = $paymentLinkId; return $this->rest_list($from, $limit, $filters); } - public function pageFor(PaymentLink $paymentLink, string $from = null, int $limit = null, array $filters = []) + public function pageFor(PaymentLink $paymentLink, ?string $from = null, ?int $limit = null, array $filters = []) { return $this->pageForId($paymentLink->id, $from, $limit, $filters); } diff --git a/src/Endpoints/SettlementChargebackEndpoint.php b/src/Endpoints/SettlementChargebackEndpoint.php index 585ccf2c5..3dd7b19fa 100644 --- a/src/Endpoints/SettlementChargebackEndpoint.php +++ b/src/Endpoints/SettlementChargebackEndpoint.php @@ -39,7 +39,7 @@ protected function getResourceCollectionObject($count, $_links) * @return mixed * @throws \Mollie\Api\Exceptions\ApiException */ - public function pageForId(string $settlementId, string $from = null, int $limit = null, array $parameters = []) + public function pageForId(string $settlementId, ?string $from = null, ?int $limit = null, array $parameters = []) { $this->parentId = $settlementId; From fc1d01d61ff9f35b4521fb2d49130d7a6d9e706c Mon Sep 17 00:00:00 2001 From: Sander van Hooft Date: Mon, 9 Dec 2024 13:16:32 +0100 Subject: [PATCH 2/2] wip --- src/Endpoints/SettlementCaptureEndpoint.php | 2 +- src/Endpoints/SettlementRefundEndpoint.php | 2 +- src/HttpAdapter/Guzzle6And7RetryMiddlewareFactory.php | 4 ++-- src/Resources/LazyCollection.php | 2 +- src/Resources/PaymentLink.php | 2 +- src/Resources/Settlement.php | 8 ++++---- 6 files changed, 10 insertions(+), 10 deletions(-) diff --git a/src/Endpoints/SettlementCaptureEndpoint.php b/src/Endpoints/SettlementCaptureEndpoint.php index 3e51443ef..553f7499b 100644 --- a/src/Endpoints/SettlementCaptureEndpoint.php +++ b/src/Endpoints/SettlementCaptureEndpoint.php @@ -36,7 +36,7 @@ protected function getResourceCollectionObject($count, $_links) * @return mixed * @throws \Mollie\Api\Exceptions\ApiException */ - public function pageForId(string $settlementId, string $from = null, int $limit = null, array $parameters = []) + public function pageForId(string $settlementId, ?string $from = null, ?int $limit = null, array $parameters = []) { $this->parentId = $settlementId; diff --git a/src/Endpoints/SettlementRefundEndpoint.php b/src/Endpoints/SettlementRefundEndpoint.php index 4f751da79..53d36d79a 100644 --- a/src/Endpoints/SettlementRefundEndpoint.php +++ b/src/Endpoints/SettlementRefundEndpoint.php @@ -39,7 +39,7 @@ protected function getResourceObject() * @return mixed * @throws \Mollie\Api\Exceptions\ApiException */ - public function pageForId(string $settlementId, string $from = null, int $limit = null, array $parameters = []) + public function pageForId(string $settlementId, ?string $from = null, ?int $limit = null, array $parameters = []) { $this->parentId = $settlementId; diff --git a/src/HttpAdapter/Guzzle6And7RetryMiddlewareFactory.php b/src/HttpAdapter/Guzzle6And7RetryMiddlewareFactory.php index b6d8cb73e..a0543e083 100644 --- a/src/HttpAdapter/Guzzle6And7RetryMiddlewareFactory.php +++ b/src/HttpAdapter/Guzzle6And7RetryMiddlewareFactory.php @@ -66,8 +66,8 @@ private function newRetryDecider() return function ( $retries, Request $request, - Response $response = null, - TransferException $exception = null + ?Response $response = null, + ?TransferException $exception = null ) { if ($retries >= static::MAX_RETRIES) { return false; diff --git a/src/Resources/LazyCollection.php b/src/Resources/LazyCollection.php index 0fc90f081..94179a653 100644 --- a/src/Resources/LazyCollection.php +++ b/src/Resources/LazyCollection.php @@ -76,7 +76,7 @@ public function filter(callable $callback): self * @param (callable(TValue, TKey): bool)|null $callback * @return TValue|null */ - public function first(callable $callback = null) + public function first(?callable $callback = null) { $iterator = $this->getIterator(); diff --git a/src/Resources/PaymentLink.php b/src/Resources/PaymentLink.php index bef2c9e30..c37776a58 100644 --- a/src/Resources/PaymentLink.php +++ b/src/Resources/PaymentLink.php @@ -166,7 +166,7 @@ public function archive() * @param array $filters * @return mixed|\Mollie\Api\Resources\BaseCollection */ - public function payments(string $from = null, int $limit = null, array $filters = []) + public function payments(?string $from = null, ?int $limit = null, array $filters = []) { return $this->client->paymentLinkPayments->pageFor( $this, diff --git a/src/Resources/Settlement.php b/src/Resources/Settlement.php index 54f71cd24..d3b77ddeb 100644 --- a/src/Resources/Settlement.php +++ b/src/Resources/Settlement.php @@ -118,7 +118,7 @@ public function isFailed() * @return PaymentCollection * @throws \Mollie\Api\Exceptions\ApiException */ - public function payments(int $limit = null, array $parameters = []): PaymentCollection + public function payments(?int $limit = null, array $parameters = []): PaymentCollection { return $this->client->settlementPayments->pageForId( $this->id, @@ -136,7 +136,7 @@ public function payments(int $limit = null, array $parameters = []): PaymentColl * @return RefundCollection * @throws ApiException */ - public function refunds(int $limit = null, array $parameters = []) + public function refunds(?int $limit = null, array $parameters = []) { return $this->client->settlementRefunds->pageForId( $this->id, @@ -154,7 +154,7 @@ public function refunds(int $limit = null, array $parameters = []) * @return ChargebackCollection * @throws ApiException */ - public function chargebacks(int $limit = null, array $parameters = []) + public function chargebacks(?int $limit = null, array $parameters = []) { return $this->client->settlementChargebacks->pageForId( $this->id, @@ -172,7 +172,7 @@ public function chargebacks(int $limit = null, array $parameters = []) * @return CaptureCollection * @throws ApiException */ - public function captures(int $limit = null, array $parameters = []) + public function captures(?int $limit = null, array $parameters = []) { return $this->client->settlementCaptures->pageForId( $this->id,