Skip to content

Commit 012e2bb

Browse files
authored
Merge pull request #152 from mlahargou/php-8-4-fixes
PHP 8.4 Fixes
2 parents 8d51d6b + 1d3025d commit 012e2bb

File tree

4 files changed

+5
-5
lines changed

4 files changed

+5
-5
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -276,7 +276,7 @@ $result = $api->graph(...);
276276
Requests are made using Guzzle.
277277

278278
```php
279-
$api->rest(string $type, string $path, array $params = null, array $headers = [], bool $sync = true);
279+
$api->rest(string $type, string $path, ?array $params = null, array $headers = [], bool $sync = true);
280280
// or $api->getRestClient()->request(....);
281281
```
282282

src/BasicShopifyAPI.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -426,7 +426,7 @@ public function graphAsync(string $query, array $variables = []): Promise
426426
/**
427427
* @see Rest::request
428428
*/
429-
public function rest(string $type, string $path, array $params = null, array $headers = [], bool $sync = true)
429+
public function rest(string $type, string $path, ?array $params = null, array $headers = [], bool $sync = true)
430430
{
431431
return $this->getRestClient()->request($type, $path, $params, $headers, $sync);
432432
}
@@ -437,7 +437,7 @@ public function rest(string $type, string $path, array $params = null, array $he
437437
*
438438
* @see rest
439439
*/
440-
public function restAsync(string $type, string $path, array $params = null, array $headers = []): Promise
440+
public function restAsync(string $type, string $path, ?array $params = null, array $headers = []): Promise
441441
{
442442
return $this->rest($type, $path, $params, $headers, false);
443443
}

src/Clients/Rest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ public function getAuthUrl($scopes, string $redirectUri, string $mode = 'offline
103103
/**
104104
* {@inheritdoc}
105105
*/
106-
public function request(string $type, string $path, array $params = null, array $headers = [], bool $sync = true)
106+
public function request(string $type, string $path, ?array $params = null, array $headers = [], bool $sync = true)
107107
{
108108
// Build URI
109109
$uri = $this->getBaseUri()->withPath($path);

src/Contracts/RestRequester.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ interface RestRequester extends LimitAccesser, TimeAccesser, SessionAware, Clien
2525
*
2626
* @return array|Promise
2727
*/
28-
public function request(string $type, string $path, array $params = null, array $headers = [], bool $sync = true);
28+
public function request(string $type, string $path, ?array $params = null, array $headers = [], bool $sync = true);
2929

3030
/**
3131
* Gets the access object from a "code" supplied by Shopify request after successfull auth (for public apps).

0 commit comments

Comments
 (0)