Skip to content

Commit f01ce63

Browse files
committed
remove-php-8-4] explicitly set nullable parameter.
1 parent a4829d6 commit f01ce63

21 files changed

+132
-134
lines changed

src/Interfaces/CancelServiceInterface.php

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ interface CancelServiceInterface
3030
* @throws UnzerApiException An UnzerApiException is thrown if there is an error returned on API-request.
3131
* @throws RuntimeException A RuntimeException is thrown when there is an error while using the SDK.
3232
*/
33-
public function cancelAuthorization(Authorization $authorization, float $amount = null): Cancellation;
33+
public function cancelAuthorization(Authorization $authorization, ?float $amount = null): Cancellation;
3434

3535
/**
3636
* Performs a Cancellation transaction for the Authorization of the given Payment object.
@@ -44,7 +44,7 @@ public function cancelAuthorization(Authorization $authorization, float $amount
4444
* @throws UnzerApiException An UnzerApiException is thrown if there is an error returned on API-request.
4545
* @throws RuntimeException A RuntimeException is thrown when there is an error while using the SDK.
4646
*/
47-
public function cancelAuthorizationByPayment($payment, float $amount = null): Cancellation;
47+
public function cancelAuthorizationByPayment($payment, ?float $amount = null): Cancellation;
4848

4949
/**
5050
* Performs a Cancellation transaction for the given Charge and returns the resulting Cancellation object.
@@ -67,11 +67,11 @@ public function cancelAuthorizationByPayment($payment, float $amount = null): Ca
6767
public function cancelChargeById(
6868
$payment,
6969
string $chargeId,
70-
float $amount = null,
70+
?float $amount = null,
7171
?string $reasonCode = null,
7272
?string $referenceText = null,
73-
float $amountNet = null,
74-
float $amountVat = null
73+
?float $amountNet = null,
74+
?float $amountVat = null
7575
): Cancellation;
7676

7777
/**
@@ -93,11 +93,11 @@ public function cancelChargeById(
9393
*/
9494
public function cancelCharge(
9595
Charge $charge,
96-
float $amount = null,
96+
?float $amount = null,
9797
?string $reasonCode = null,
9898
?string $referenceText = null,
99-
float $amountNet = null,
100-
float $amountVat = null
99+
?float $amountNet = null,
100+
?float $amountVat = null
101101
): Cancellation;
102102

103103
/**
@@ -119,11 +119,11 @@ public function cancelCharge(
119119
*/
120120
public function cancelPayment(
121121
$payment,
122-
float $amount = null,
122+
?float $amount = null,
123123
?string $reasonCode = CancelReasonCodes::REASON_CODE_CANCEL,
124124
?string $referenceText = null,
125-
float $amountNet = null,
126-
float $amountVat = null
125+
?float $amountNet = null,
126+
?float $amountVat = null
127127
): array;
128128

129129
/**
@@ -167,5 +167,5 @@ public function cancelChargedPayment($payment, ?Cancellation $cancellation = nul
167167
* @throws UnzerApiException An UnzerApiException is thrown if there is an error returned on API-request.
168168
* @throws RuntimeException A RuntimeException is thrown when there is a error while using the SDK.
169169
*/
170-
public function cancelPaymentAuthorization($payment, float $amount = null): ?Cancellation;
170+
public function cancelPaymentAuthorization($payment, ?float $amount = null): ?Cancellation;
171171
}

src/Interfaces/PaymentServiceInterface.php

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,8 @@ public function performAuthorization(
4848
Authorization $authorization,
4949
$paymentType,
5050
$customer = null,
51-
Metadata $metadata = null,
52-
Basket $basket = null
51+
?Metadata $metadata = null,
52+
?Basket $basket = null
5353
): Authorization;
5454

5555
/**
@@ -130,8 +130,8 @@ public function performCharge(
130130
Charge $charge,
131131
$paymentType,
132132
$customer = null,
133-
Metadata $metadata = null,
134-
Basket $basket = null
133+
?Metadata $metadata = null,
134+
?Basket $basket = null
135135
): Charge;
136136

137137
/**
@@ -229,7 +229,7 @@ public function performChargeOnPayment(
229229
*/
230230
public function chargeAuthorization(
231231
$payment,
232-
float $amount = null,
232+
?float $amount = null,
233233
?string $orderId = null,
234234
?string $invoiceId = null
235235
): Charge;
@@ -252,7 +252,7 @@ public function chargeAuthorization(
252252
*/
253253
public function chargePayment(
254254
$payment,
255-
float $amount = null,
255+
?float $amount = null,
256256
?string $orderId = null,
257257
?string $invoiceId = null
258258
): Charge;
@@ -284,11 +284,11 @@ public function payout(
284284
$paymentType,
285285
string $returnUrl,
286286
$customer = null,
287-
string $orderId = null,
288-
Metadata $metadata = null,
289-
Basket $basket = null,
290-
string $invoiceId = null,
291-
string $referenceText = null
287+
?string $orderId = null,
288+
?Metadata $metadata = null,
289+
?Basket $basket = null,
290+
?string $invoiceId = null,
291+
?string $referenceText = null
292292
): Payout;
293293

294294
/**
@@ -328,9 +328,9 @@ public function ship($payment, ?string $invoiceId = null, ?string $orderId = nul
328328
*/
329329
public function initPayPageCharge(
330330
Paypage $paypage,
331-
Customer $customer = null,
332-
Basket $basket = null,
333-
Metadata $metadata = null
331+
?Customer $customer = null,
332+
?Basket $basket = null,
333+
?Metadata $metadata = null
334334
): Paypage;
335335

336336
/**
@@ -356,9 +356,9 @@ public function initPayPageCharge(
356356
*/
357357
public function initPayPageAuthorize(
358358
Paypage $paypage,
359-
Customer $customer = null,
360-
Basket $basket = null,
361-
Metadata $metadata = null
359+
?Customer $customer = null,
360+
?Basket $basket = null,
361+
?Metadata $metadata = null
362362
): Paypage;
363363

364364
/**
@@ -378,7 +378,7 @@ public function fetchInstallmentPlans(
378378
float $amount,
379379
string $currency,
380380
float $effectiveInterest,
381-
DateTime $orderDate = null
381+
?DateTime $orderDate = null
382382
): InstalmentPlans;
383383

384384
/**

src/Interfaces/WebhookServiceInterface.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,10 @@
88

99
namespace UnzerSDK\Interfaces;
1010

11+
use RuntimeException;
1112
use UnzerSDK\Exceptions\UnzerApiException;
1213
use UnzerSDK\Resources\AbstractUnzerResource;
1314
use UnzerSDK\Resources\Webhook;
14-
use RuntimeException;
1515

1616
interface WebhookServiceInterface
1717
{
@@ -106,5 +106,5 @@ public function registerMultipleWebhooks(string $url, array $events): array;
106106
* @throws UnzerApiException An UnzerApiException is thrown if there is an error returned on API-request.
107107
* @throws RuntimeException A RuntimeException is thrown when there is an error while using the SDK.
108108
*/
109-
public function fetchResourceFromEvent(string $eventJson = null): AbstractUnzerResource;
109+
public function fetchResourceFromEvent(?string $eventJson = null): AbstractUnzerResource;
110110
}

src/Resources/EmbeddedResources/GooglePay/SignedMessage.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ class SignedMessage extends AbstractUnzerResource
2020
* @param string $ephemeralPublicKey
2121
* @param string $encryptedMessage
2222
*/
23-
public function __construct(string $tag = null, ?string $ephemeralPublicKey = null, ?string $encryptedMessage = null)
23+
public function __construct(?string $tag = null, ?string $ephemeralPublicKey = null, ?string $encryptedMessage = null)
2424
{
2525
$this->tag = $tag;
2626
$this->ephemeralPublicKey = $ephemeralPublicKey;

src/Resources/InstalmentPlan.php

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -77,17 +77,17 @@ class InstalmentPlan extends BasePaymentType
7777
* @param float|null $lastRate
7878
*/
7979
public function __construct(
80-
int $numberOfRates = null,
80+
?int $numberOfRates = null,
8181
?string $dayOfPurchase = null,
82-
float $totalPurchaseAmount = null,
83-
float $totalInterestAmount = null,
84-
float $totalAmount = null,
85-
float $effectiveInterestRate = null,
86-
float $nominalInterestRate = null,
87-
float $feeFirstRate = null,
88-
float $feePerRate = null,
89-
float $monthlyRate = null,
90-
float $lastRate = null
82+
?float $totalPurchaseAmount = null,
83+
?float $totalInterestAmount = null,
84+
?float $totalAmount = null,
85+
?float $effectiveInterestRate = null,
86+
?float $nominalInterestRate = null,
87+
?float $feeFirstRate = null,
88+
?float $feePerRate = null,
89+
?float $monthlyRate = null,
90+
?float $lastRate = null
9191
) {
9292
$this->numberOfRates = $numberOfRates;
9393
$this->dayOfPurchase = $dayOfPurchase;

src/Resources/Payment.php

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -829,11 +829,11 @@ public function getExternalId(): ?string
829829
* @throws RuntimeException A RuntimeException is thrown when there is an error while using the SDK.
830830
*/
831831
public function cancelAmount(
832-
float $amount = null,
832+
?float $amount = null,
833833
?string $reasonCode = CancelReasonCodes::REASON_CODE_CANCEL,
834-
string $paymentReference = null,
835-
float $amountNet = null,
836-
float $amountVat = null
834+
?string $paymentReference = null,
835+
?float $amountNet = null,
836+
?float $amountVat = null
837837
): array {
838838
return $this->getUnzerObject()->cancelPayment($this, $amount, $reasonCode, $paymentReference, $amountNet, $amountVat);
839839
}
@@ -850,7 +850,7 @@ public function cancelAmount(
850850
* @throws UnzerApiException An UnzerApiException is thrown if there is an error returned on API-request.
851851
* @throws RuntimeException A RuntimeException is thrown when there is an error while using the SDK.
852852
*/
853-
public function cancelAuthorizationAmount(float $amount = null): ?Cancellation
853+
public function cancelAuthorizationAmount(?float $amount = null): ?Cancellation
854854
{
855855
return $this->getUnzerObject()->cancelPaymentAuthorization($this, $amount);
856856
}
@@ -865,7 +865,7 @@ public function cancelAuthorizationAmount(float $amount = null): ?Cancellation
865865
* @throws UnzerApiException An UnzerApiException is thrown if there is an error returned on API-request.
866866
* @throws RuntimeException A RuntimeException is thrown when there is an error while using the SDK.
867867
*/
868-
public function charge(float $amount = null): Charge
868+
public function charge(?float $amount = null): Charge
869869
{
870870
return $this->getUnzerObject()->chargePayment($this, $amount);
871871
}
@@ -881,7 +881,7 @@ public function charge(float $amount = null): Charge
881881
* @throws UnzerApiException An UnzerApiException is thrown if there is an error returned on API-request.
882882
* @throws RuntimeException A RuntimeException is thrown when there is an error while using the SDK.
883883
*/
884-
public function ship(string $invoiceId = null, ?string $orderId = null)
884+
public function ship(?string $invoiceId = null, ?string $orderId = null)
885885
{
886886
return $this->getUnzerObject()->ship($this, $invoiceId, $orderId);
887887
}

src/Resources/PaymentTypes/InstallmentSecured.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ class InstallmentSecured extends InstalmentPlan
3434
* @param null|DateTime|string $invoiceDate
3535
* @param null|DateTime|string $invoiceDueDate
3636
*/
37-
public function __construct(InstalmentPlan $selectedPlan = null, $iban = null, $accountHolder = null, $orderDate = null, $bic = null, $invoiceDate = null, $invoiceDueDate = null)
37+
public function __construct(?InstalmentPlan $selectedPlan = null, $iban = null, $accountHolder = null, $orderDate = null, $bic = null, $invoiceDate = null, $invoiceDueDate = null)
3838
{
3939
parent::__construct();
4040

src/Resources/PaymentTypes/OpenbankingPis.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ class OpenbankingPis extends BasePaymentType
99
/** @var string|null $ibanCountry */
1010
protected $ibanCountry;
1111

12-
public function __construct(string $ibanCountry = null)
12+
public function __construct(?string $ibanCountry = null)
1313
{
1414
$this->ibanCountry = $ibanCountry;
1515
}

src/Resources/PaymentTypes/PaylaterDirectDebit.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ class PaylaterDirectDebit extends BasePaymentType
1212
/** @var string $holder */
1313
protected $holder;
1414

15-
public function __construct(string $iban = null, ?string $holder = null)
15+
public function __construct(?string $iban = null, ?string $holder = null)
1616
{
1717
$this->iban = $iban;
1818
$this->holder = $holder;

src/Resources/TransactionTypes/Authorization.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ class Authorization extends AbstractTransactionType
5555
* @param string|null $currency
5656
* @param string|null $returnUrl
5757
*/
58-
public function __construct(float $amount = null, ?string $currency = null, ?string $returnUrl = null)
58+
public function __construct(?float $amount = null, ?string $currency = null, ?string $returnUrl = null)
5959
{
6060
$this->setAmount($amount);
6161
$this->setCurrency($currency);
@@ -250,7 +250,7 @@ protected function getResourcePath(string $httpMethod = HttpAdapterInterface::RE
250250
* @throws UnzerApiException An UnzerApiException is thrown if there is an error returned on API-request.
251251
* @throws RuntimeException A RuntimeException is thrown when there is an error while using the SDK.
252252
*/
253-
public function cancel(float $amount = null): Cancellation
253+
public function cancel(?float $amount = null): Cancellation
254254
{
255255
return $this->getUnzerObject()->cancelAuthorization($this, $amount);
256256
}
@@ -265,7 +265,7 @@ public function cancel(float $amount = null): Cancellation
265265
* @throws UnzerApiException An UnzerApiException is thrown if there is an error returned on API-request.
266266
* @throws RuntimeException A RuntimeException is thrown when there is an error while using the SDK.
267267
*/
268-
public function charge(float $amount = null): Charge
268+
public function charge(?float $amount = null): Charge
269269
{
270270
$payment = $this->getPayment();
271271
if (!$payment instanceof Payment) {

0 commit comments

Comments
 (0)