diff --git a/src/ApiException.php b/src/ApiException.php index 977eea5..e66c9cd 100644 --- a/src/ApiException.php +++ b/src/ApiException.php @@ -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; diff --git a/src/Connection.php b/src/Connection.php index c8be086..dc23ae8 100644 --- a/src/Connection.php +++ b/src/Connection.php @@ -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', @@ -394,14 +394,14 @@ public function get($url, array $params = [], array $headers = []): array /** * @param UriInterface|string $url - * @param array $body + * @param array|null $body * @param array $params * @param array $headers * @return array> * @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;