Skip to content

Commit 4a8fa8a

Browse files
authored
Merge pull request #10 from mveldhuizen/prevent-implicit-null-deprecation-errors
prevent implicit nullable deprecation errors in php 8.4
2 parents a389ac4 + faaf401 commit 4a8fa8a

2 files changed

Lines changed: 5 additions & 5 deletions

File tree

src/ApiException.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ final class ApiException extends \Exception
1313
* @param \Throwable|null $previous
1414
* @param string[][] $errors
1515
*/
16-
public function __construct(string $message = "", int $code = 0, \Throwable $previous = null, array $errors = [])
16+
public function __construct(string $message = "", int $code = 0, ?\Throwable $previous = null, array $errors = [])
1717
{
1818
$this->errors = $errors;
1919

src/Connection.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -355,8 +355,8 @@ private function createRequest(
355355
string $method,
356356
string $endpoint,
357357
$body = null,
358-
array $params = null,
359-
array $headers = null
358+
?array $params = null,
359+
?array $headers = null
360360
): Request {
361361
$headers = array_merge($headers, [
362362
'Accept' => 'application/json',
@@ -394,14 +394,14 @@ public function get($url, array $params = [], array $headers = []): array
394394

395395
/**
396396
* @param UriInterface|string $url
397-
* @param array<string, mixed|mixed[]> $body
397+
* @param array<string, mixed|mixed[]>|null $body
398398
* @param array<string, mixed|mixed[]> $params
399399
* @param array<string, mixed|mixed[]> $headers
400400
* @return array<string, mixed|array<string|mixed>>
401401
* @throws ApiException
402402
* @throws GuzzleException
403403
*/
404-
public function post($url, array $body = null, array $params = [], array $headers = []): array
404+
public function post($url, ?array $body = null, array $params = [], array $headers = []): array
405405
{
406406
$url = self::API_URL . $url;
407407

0 commit comments

Comments
 (0)