Skip to content

Commit

Permalink
Merge pull request #152 from mlahargou/php-8-4-fixes
Browse files Browse the repository at this point in the history
PHP 8.4 Fixes
  • Loading branch information
gnikyt authored Jan 30, 2025
2 parents 8d51d6b + 1d3025d commit 012e2bb
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,7 @@ $result = $api->graph(...);
Requests are made using Guzzle.

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

Expand Down
4 changes: 2 additions & 2 deletions src/BasicShopifyAPI.php
Original file line number Diff line number Diff line change
Expand Up @@ -426,7 +426,7 @@ public function graphAsync(string $query, array $variables = []): Promise
/**
* @see Rest::request
*/
public function rest(string $type, string $path, array $params = null, array $headers = [], bool $sync = true)
public function rest(string $type, string $path, ?array $params = null, array $headers = [], bool $sync = true)
{
return $this->getRestClient()->request($type, $path, $params, $headers, $sync);
}
Expand All @@ -437,7 +437,7 @@ public function rest(string $type, string $path, array $params = null, array $he
*
* @see rest
*/
public function restAsync(string $type, string $path, array $params = null, array $headers = []): Promise
public function restAsync(string $type, string $path, ?array $params = null, array $headers = []): Promise
{
return $this->rest($type, $path, $params, $headers, false);
}
Expand Down
2 changes: 1 addition & 1 deletion src/Clients/Rest.php
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ public function getAuthUrl($scopes, string $redirectUri, string $mode = 'offline
/**
* {@inheritdoc}
*/
public function request(string $type, string $path, array $params = null, array $headers = [], bool $sync = true)
public function request(string $type, string $path, ?array $params = null, array $headers = [], bool $sync = true)
{
// Build URI
$uri = $this->getBaseUri()->withPath($path);
Expand Down
2 changes: 1 addition & 1 deletion src/Contracts/RestRequester.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ interface RestRequester extends LimitAccesser, TimeAccesser, SessionAware, Clien
*
* @return array|Promise
*/
public function request(string $type, string $path, array $params = null, array $headers = [], bool $sync = true);
public function request(string $type, string $path, ?array $params = null, array $headers = [], bool $sync = true);

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

0 comments on commit 012e2bb

Please sign in to comment.