Skip to content

Commit 955bcb4

Browse files
Merge pull request #212 from bigwhoop/php84-fix-implicitly-nullable-parameter-types
PHP 8.4 Support: Explicitly marked property and parameter types as nullable
2 parents c386432 + 270e0db commit 955bcb4

32 files changed

+209
-209
lines changed

src/Builders/CustomerCreditTransfer/CustomerCreditTransferBuilder.php

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -53,10 +53,10 @@ public function createInstance(
5353
string $debitorFinInstBIC,
5454
string $debitorIBAN,
5555
string $debitorName,
56-
DateTime $executionDate = null,
56+
?DateTime $executionDate = null,
5757
bool $batchBooking = true,
58-
string $msgId = null,
59-
string $paymentReference = null
58+
?string $msgId = null,
59+
?string $paymentReference = null
6060
): CustomerCreditTransferBuilder {
6161
$this->instance = new CustomerCreditTransfer();
6262
$now = new DateTime();
@@ -191,8 +191,8 @@ public function createInstance(
191191

192192
private function createCreditTransferTransactionElement(
193193
float $amount,
194-
string $instrId = null,
195-
string $endToEndId = null
194+
?string $instrId = null,
195+
?string $endToEndId = null
196196
): DOMElement {
197197
$xpath = $this->prepareXPath($this->instance);
198198
$nbOfTxsList = $xpath->query('//CstmrCdtTrfInitn//GrpHdr/NbOfTxs');
@@ -257,7 +257,7 @@ private function addCreditor(
257257
string $creditorIBAN,
258258
string $creditorName,
259259
?PostalAddressInterface $postalAddress,
260-
string $purpose = null
260+
?string $purpose = null
261261
): void {
262262
//agent
263263
if ($creditorFinInstBIC !== null) {
@@ -312,7 +312,7 @@ public function addBankTransaction(
312312
?PostalAddressInterface $postalAddress,
313313
float $amount,
314314
string $currency,
315-
string $purpose = null
315+
?string $purpose = null
316316
): CustomerCreditTransferBuilder {
317317
if ($currency !== 'EUR') {
318318
throw new InvalidArgumentException('The SEPA transaction is restricted to EUR currency.');
@@ -334,7 +334,7 @@ public function addSEPATransaction(
334334
?PostalAddressInterface $postalAddress,
335335
float $amount,
336336
string $currency,
337-
string $purpose = null
337+
?string $purpose = null
338338
): CustomerCreditTransferBuilder {
339339
if ($currency !== 'EUR') {
340340
throw new InvalidArgumentException('The SEPA transaction is restricted to EUR currency.');
@@ -378,7 +378,7 @@ public function addForeignTransaction(
378378
?PostalAddressInterface $postalAddress,
379379
float $amount,
380380
string $currency,
381-
string $purpose = null
381+
?string $purpose = null
382382
): CustomerCreditTransferBuilder {
383383
$xmlCdtTrfTxInf = $this->createCreditTransferTransactionElement($amount);
384384

src/Builders/CustomerCreditTransfer/CustomerInstantCreditTransferBuilder.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,8 @@ public function createInstance(
4444
string $debttorIban,
4545
string $debitorName,
4646
bool $batchBooking = true,
47-
string $msgId = null,
48-
string $paymentReference = null
47+
?string $msgId = null,
48+
?string $paymentReference = null
4949
): CustomerInstantCreditTransferBuilder {
5050
$this->instance = new CustomerCreditTransfer();
5151
$now = new DateTime();
@@ -197,8 +197,8 @@ public function addTransaction(
197197
float $amount,
198198
string $currency,
199199
string $purpose,
200-
string $endToEndId = null,
201-
string $purposeCode = null
200+
?string $endToEndId = null,
201+
?string $purposeCode = null
202202
): CustomerInstantCreditTransferBuilder {
203203
$xpath = $this->prepareXPath($this->instance);
204204
$nbOfTxsList = $xpath->query('//CstmrCdtTrfInitn/PmtInf/NbOfTxs');

src/Builders/CustomerCreditTransfer/CustomerSwissCreditTransferBuilder.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,7 @@ private function addCreditor(
195195
string $creditorIBAN,
196196
string $creditorName,
197197
?PostalAddressInterface $postalAddress,
198-
string $purpose = null
198+
?string $purpose = null
199199
): void {
200200
//agent
201201
if ($creditorFinInstBIC !== null) {
@@ -250,7 +250,7 @@ public function addBankTransaction(
250250
?PostalAddressInterface $postalAddress,
251251
float $amount,
252252
string $currency,
253-
string $purpose = null
253+
?string $purpose = null
254254
): CustomerSwissCreditTransferBuilder {
255255
if (!in_array($currency, ['CHF', 'EUR'], true)) {
256256
throw new InvalidArgumentException('The SEPA transaction is restricted to CHF and EUR currency.');
@@ -274,7 +274,7 @@ public function addSEPATransaction(
274274
?PostalAddressInterface $postalAddress,
275275
float $amount,
276276
string $currency,
277-
string $purpose = null
277+
?string $purpose = null
278278
): CustomerSwissCreditTransferBuilder {
279279
if ($currency !== 'EUR') {
280280
throw new InvalidArgumentException('The SEPA transaction is restricted to EUR currency.');
@@ -321,7 +321,7 @@ public function addForeignTransaction(
321321
?PostalAddressInterface $postalAddress,
322322
float $amount,
323323
string $currency,
324-
string $purpose = null
324+
?string $purpose = null
325325
): CustomerSwissCreditTransferBuilder {
326326
$xmlCdtTrfTxInf = $this->createCreditTransferTransactionElement($amount);
327327

src/Builders/CustomerDirectDebit/CustomerDirectDebitBuilder.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -49,12 +49,12 @@ public function createInstance(
4949
string $creditorFinInstBic,
5050
string $creditorIban,
5151
string $creditorName,
52-
string $creditorId = null,
52+
?string $creditorId = null,
5353
string $sequenceType = 'FRST',
54-
DateTime $collectionDate = null,
54+
?DateTime $collectionDate = null,
5555
bool $batchBooking = true,
56-
string $msgId = null,
57-
string $paymentReference = null,
56+
?string $msgId = null,
57+
?string $paymentReference = null,
5858
string $localInstrument = 'CORE'
5959
): CustomerDirectDebitBuilder {
6060
$this->instance = new CustomerDirectDebit();
@@ -227,8 +227,8 @@ public function addTransaction(
227227
string $currency,
228228
string $purpose,
229229
string $mandateReference = '1',
230-
DateTime $signatureDate = null,
231-
string $endToEndId = null
230+
?DateTime $signatureDate = null,
231+
?string $endToEndId = null
232232
): CustomerDirectDebitBuilder {
233233
$xpath = $this->prepareXPath($this->instance);
234234
$nbOfTxsList = $xpath->query('//CstmrDrctDbtInitn/PmtInf/NbOfTxs');

src/Builders/Request/DataTransferBuilder.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ public function createInstance(): DataTransferBuilder
3636
return $this;
3737
}
3838

39-
public function addOrderData(string $orderData = null, string $transactionKey = null): DataTransferBuilder
39+
public function addOrderData(?string $orderData = null, ?string $transactionKey = null): DataTransferBuilder
4040
{
4141
$xmlDataTransfer = $this->dom->createElement('OrderData');
4242
$this->instance->appendChild($xmlDataTransfer);
@@ -60,7 +60,7 @@ public function addOrderData(string $orderData = null, string $transactionKey =
6060
return $this;
6161
}
6262

63-
public function addDataEncryptionInfo(Closure $callable = null): DataTransferBuilder
63+
public function addDataEncryptionInfo(?Closure $callable = null): DataTransferBuilder
6464
{
6565
$dataEncryptionInfoBuilder = new DataEncryptionInfoBuilder($this->cryptService, $this->dom);
6666
$this->instance->appendChild($dataEncryptionInfoBuilder->createInstance()->getInstance());
@@ -87,7 +87,7 @@ public function addSignatureData(SignatureDataInterface $userSignature, string $
8787
return $this;
8888
}
8989

90-
abstract public function addDataDigest(string $signatureVersion, string $digest = null): DataTransferBuilder;
90+
abstract public function addDataDigest(string $signatureVersion, ?string $digest = null): DataTransferBuilder;
9191

9292
abstract public function addAdditionalOrderInfo(): DataTransferBuilder;
9393

src/Builders/Request/DataTransferBuilderV2.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
*/
1111
final class DataTransferBuilderV2 extends DataTransferBuilder
1212
{
13-
public function addDataDigest(string $signatureVersion, string $digest = null): DataTransferBuilder
13+
public function addDataDigest(string $signatureVersion, ?string $digest = null): DataTransferBuilder
1414
{
1515
// Skipped.
1616
return $this;

src/Builders/Request/DataTransferBuilderV3.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
*/
1111
final class DataTransferBuilderV3 extends DataTransferBuilder
1212
{
13-
public function addDataDigest(string $signatureVersion, string $digest = null): DataTransferBuilder
13+
public function addDataDigest(string $signatureVersion, ?string $digest = null): DataTransferBuilder
1414
{
1515
$xmlDataDigest = $this->dom->createElement('DataDigest');
1616
$xmlDataDigest->setAttribute('SignatureVersion', $signatureVersion);

src/Builders/Request/HeaderBuilder.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ public function createInstance(): HeaderBuilder
4040

4141
abstract public function addStatic(Closure $callback): HeaderBuilder;
4242

43-
public function addMutable(Closure $callable = null): HeaderBuilder
43+
public function addMutable(?Closure $callable = null): HeaderBuilder
4444
{
4545
$mutableBuilder = new MutableBuilder($this->dom);
4646
$this->instance->appendChild($mutableBuilder->createInstance()->getInstance());

src/Builders/Request/MutableBuilder.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ public function addTransactionPhase(string $transactionPhase): MutableBuilder
4747
return $this;
4848
}
4949

50-
public function addSegmentNumber(int $segmentNumber = null, ?bool $isLastSegment = null): MutableBuilder
50+
public function addSegmentNumber(?int $segmentNumber = null, ?bool $isLastSegment = null): MutableBuilder
5151
{
5252
if (null !== $segmentNumber) {
5353
$xmlSegmentNumber = $this->dom->createElement('SegmentNumber');

src/Builders/Request/OrderDetailsBuilder.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,8 +62,8 @@ public function addOrderId(string $orderId): OrderDetailsBuilder
6262
abstract public function addOrderAttribute(string $orderAttribute): OrderDetailsBuilder;
6363

6464
public function addStandardOrderParams(
65-
DateTimeInterface $startDateTime = null,
66-
DateTimeInterface $endDateTime = null
65+
?DateTimeInterface $startDateTime = null,
66+
?DateTimeInterface $endDateTime = null
6767
): OrderDetailsBuilder {
6868
// Add StandardOrderParams to OrderDetails.
6969
$xmlStandardOrderParams = $this->dom->createElement('StandardOrderParams');

0 commit comments

Comments
 (0)