Skip to content

Commit e3229cc

Browse files
PHPSDK-163: Fix PHP 8.4 deprecations (#366)
1 parent fdb3b3f commit e3229cc

5 files changed

Lines changed: 6 additions & 6 deletions

File tree

src/Api/TransactionManager.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ public function captureReservationCancel(string $orderId, CaptureRequest $captur
136136
* @return Response
137137
* @throws ClientExceptionInterface|ApiException
138138
*/
139-
public function refund(Transaction $transaction, RefundRequest $requestRefund, string $orderId = null): Response
139+
public function refund(Transaction $transaction, RefundRequest $requestRefund, ?string $orderId = null): Response
140140
{
141141
return $this->client->createPostRequest(
142142
'json/orders/' . ($orderId ?: $transaction->getOrderId()) . '/refunds',

src/Api/Transactions/TransactionListing.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ class TransactionListing
2525
* @param array $data
2626
* @param Pager|null $pager
2727
*/
28-
public function __construct(array $data, Pager $pager = null)
28+
public function __construct(array $data, ?Pager $pager = null)
2929
{
3030
$transactions = [];
3131
if (!empty($data)) {

src/Client/Client.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ public function __construct(
108108
*/
109109
public function createPostRequest(
110110
string $endpoint,
111-
RequestBodyInterface $requestBody = null,
111+
?RequestBodyInterface $requestBody = null,
112112
array $context = []
113113
): ApiResponse {
114114
$request = $this->createRequest($endpoint, self::METHOD_POST)
@@ -133,7 +133,7 @@ public function createPostRequest(
133133
*/
134134
public function createPatchRequest(
135135
string $endpoint,
136-
RequestBodyInterface $requestBody = null,
136+
?RequestBodyInterface $requestBody = null,
137137
array $context = []
138138
): ApiResponse {
139139
$request = $this->createRequest($endpoint, self::METHOD_PATCH)

src/Sdk.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ class Sdk
5252
public function __construct(
5353
string $apiKey,
5454
bool $isProduction,
55-
ClientInterface $httpClient = null,
55+
?ClientInterface $httpClient = null,
5656
?RequestFactoryInterface $requestFactory = null,
5757
?StreamFactoryInterface $streamFactory = null,
5858
string $locale = 'en_US',

src/ValueObject/CartItem.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ public function addName(string $name): CartItem
101101
* @return $this
102102
* @throws InvalidArgumentException
103103
*/
104-
public function addUnitPriceValue(UnitPrice $unitPrice, float $taxRate = null): CartItem
104+
public function addUnitPriceValue(UnitPrice $unitPrice, ?float $taxRate = null): CartItem
105105
{
106106
$this->unitPriceValue = $unitPrice;
107107

0 commit comments

Comments
 (0)