Skip to content

Commit 66193d4

Browse files
committed
[PayPalClient + PayPalClientInterface] Fix deprecated message by explicitly defining as a nullable array in functions post() patch() and request().
1 parent 063d669 commit 66193d4

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

src/Client/PayPalClient.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -66,19 +66,19 @@ public function get(string $url, string $token): array
6666
return $this->request('GET', $url, $token);
6767
}
6868

69-
public function post(string $url, string $token, array $data = null, array $extraHeaders = []): array
69+
public function post(string $url, string $token, ?array $data = null, array $extraHeaders = []): array
7070
{
7171
$headers = array_merge($extraHeaders, ['PayPal-Request-Id' => $this->uuidProvider->provide()]);
7272

7373
return $this->request('POST', $url, $token, $data, $headers);
7474
}
7575

76-
public function patch(string $url, string $token, array $data = null): array
76+
public function patch(string $url, string $token, ?array $data = null): array
7777
{
7878
return $this->request('PATCH', $url, $token, $data);
7979
}
8080

81-
private function request(string $method, string $url, string $token, array $data = null, array $extraHeaders = []): array
81+
private function request(string $method, string $url, string $token, ?array $data = null, array $extraHeaders = []): array
8282
{
8383
/** @var ChannelInterface $channel */
8484
$channel = $this->channelContext->getChannel();

src/Client/PayPalClientInterface.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ public function authorize(string $clientId, string $clientSecret): array;
2222

2323
public function get(string $url, string $token): array;
2424

25-
public function post(string $url, string $token, array $data = null, array $extraHeaders = []): array;
25+
public function post(string $url, string $token, ?array $data = null, array $extraHeaders = []): array;
2626

27-
public function patch(string $url, string $token, array $data = null): array;
27+
public function patch(string $url, string $token, ?array $data = null): array;
2828
}

0 commit comments

Comments
 (0)