@@ -27,13 +27,13 @@ class Api
2727 private ?OAuth \Token $ token = null ;
2828
2929
30- public function __construct (Http \IClient $ client = null )
30+ public function __construct (? Http \IClient $ client = null )
3131 {
3232 $ this ->client = $ client ?: Helpers::createDefaultClient ();
3333 }
3434
3535
36- public function setToken (OAuth \Token $ token = null ): static
36+ public function setToken (? OAuth \Token $ token = null ): static
3737 {
3838 $ this ->token = $ token ;
3939 return $ this ;
@@ -46,7 +46,7 @@ public function getToken(): ?OAuth\Token
4646 }
4747
4848
49- public function setDefaultParameters (array $ defaults = null ): static
49+ public function setDefaultParameters (? array $ defaults = null ): static
5050 {
5151 $ this ->defaultParameters = $ defaults ?: [];
5252 return $ this ;
@@ -189,7 +189,7 @@ public function request(Http\Request $request): Http\Response
189189 * @throws MissingParameterException when substitution is used in URL but parameter is missing
190190 * @throws JsonException when encoding to JSON fails
191191 */
192- public function createRequest (string $ method , string $ urlPath , array $ parameters = [], array $ headers = [], string |array |object $ content = null ): Http \Request
192+ public function createRequest (string $ method , string $ urlPath , array $ parameters = [], array $ headers = [], string |array |object | null $ content = null ): Http \Request
193193 {
194194 if (stripos ($ urlPath , $ this ->url ) === 0 ) { # Allows non-HTTPS URLs
195195 $ baseUrl = $ this ->url ;
@@ -225,7 +225,7 @@ public function createRequest(string $method, string $urlPath, array $parameters
225225 *
226226 * @throws ApiException
227227 */
228- public function decode (Http \Response $ response , array $ okCodes = null ): mixed
228+ public function decode (Http \Response $ response , ? array $ okCodes = null ): mixed
229229 {
230230 $ content = $ response ->getContent ();
231231 if (preg_match ('~application/json~i ' , $ response ->getHeader ('Content-Type ' , '' ))) {
@@ -460,7 +460,7 @@ private function prefix(array $flags, string $name, string $value): string
460460 }
461461
462462
463- private function escape (array $ flags , string |int |false $ value , int $ maxLength = null ): string
463+ private function escape (array $ flags , string |int |false $ value , ? int $ maxLength = null ): string
464464 {
465465 $ value = (string ) $ value ;
466466
0 commit comments