Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/ApiException.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ final class ApiException extends \Exception
* @param \Throwable|null $previous
* @param string[][] $errors
*/
public function __construct(string $message = "", int $code = 0, \Throwable $previous = null, array $errors = [])
public function __construct(string $message = "", int $code = 0, ?\Throwable $previous = null, array $errors = [])
{
$this->errors = $errors;

Expand Down
8 changes: 4 additions & 4 deletions src/Connection.php
Original file line number Diff line number Diff line change
Expand Up @@ -355,8 +355,8 @@ private function createRequest(
string $method,
string $endpoint,
$body = null,
array $params = null,
array $headers = null
?array $params = null,
?array $headers = null
): Request {
$headers = array_merge($headers, [
'Accept' => 'application/json',
Expand Down Expand Up @@ -394,14 +394,14 @@ public function get($url, array $params = [], array $headers = []): array

/**
* @param UriInterface|string $url
* @param array<string, mixed|mixed[]> $body
* @param array<string, mixed|mixed[]>|null $body
* @param array<string, mixed|mixed[]> $params
* @param array<string, mixed|mixed[]> $headers
* @return array<string, mixed|array<string|mixed>>
* @throws ApiException
* @throws GuzzleException
*/
public function post($url, array $body = null, array $params = [], array $headers = []): array
public function post($url, ?array $body = null, array $params = [], array $headers = []): array
{
$url = self::API_URL . $url;

Expand Down