From 958f5c8553be555f0d43ff95191869cea6f61c39 Mon Sep 17 00:00:00 2001 From: Shubham Tiwari Date: Wed, 9 Apr 2025 12:17:56 +0530 Subject: [PATCH] chore: revert #169 --- lib/Client.php | 24 ++++++++++++------------ test/unit/MockClient.php | 2 +- 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/lib/Client.php b/lib/Client.php index 375d059..5d32bbe 100644 --- a/lib/Client.php +++ b/lib/Client.php @@ -226,13 +226,13 @@ class Client * @param bool $verifySSLCerts Set default verify certificates flag */ public function __construct( - string $host, - ?array $headers = null, - ?string $version = null, - ?array $path = null, - ?array $curlOptions = null, - bool $retryOnLimit = false, - bool $verifySSLCerts = true + $host, + $headers = null, + $version = null, + $path = null, + $curlOptions = null, + $retryOnLimit = false, + $verifySSLCerts = true ) { $this->host = $host; $this->headers = $headers ?: []; @@ -364,7 +364,7 @@ public function setIsConcurrentRequest($isConcurrent) * * @return string */ - private function buildUrl(?array $queryParams = null) + private function buildUrl($queryParams = null) { $path = '/' . implode('/', $this->path); if (isset($queryParams)) { @@ -380,12 +380,12 @@ private function buildUrl(?array $queryParams = null) * this function does not mutate any private variables. * * @param string $method - * @param array $body + * @param $body * @param array $headers * * @return array */ - private function createCurlOptions($method, ?array $body = null, ?array $headers = null) + private function createCurlOptions($method, $body = null, $headers = null) { $options = [ CURLOPT_RETURNTRANSFER => true, @@ -508,7 +508,7 @@ private function retryRequest(array $responseHeaders, $method, $url, $body, $hea * * @throws InvalidRequest */ - public function makeRequest($method, $url, ?array $body = null, ?array $headers = null, $retryOnLimit = false) + public function makeRequest($method, $url, $body = null, $headers = null, $retryOnLimit = false) { $channel = curl_init($url); @@ -604,7 +604,7 @@ public function makeAllRequests(array $requests = []) * * @return Client object */ - public function _(?string $name = null) + public function _($name = null) { if (isset($name)) { $this->path[] = $name; diff --git a/test/unit/MockClient.php b/test/unit/MockClient.php index 4b45433..b1c897a 100644 --- a/test/unit/MockClient.php +++ b/test/unit/MockClient.php @@ -10,7 +10,7 @@ class MockClient extends Client public $requestHeaders; public $url; - public function makeRequest($method, $url, ?array $requestBody = null, ?array $requestHeaders = null, $retryOnLimit = false) + public function makeRequest($method, $url, $requestBody = null, $requestHeaders = null, $retryOnLimit = false) { $this->requestBody = $requestBody; $this->requestHeaders = $requestHeaders;