Skip to content

Commit

Permalink
Allow empty PageQuery
Browse files Browse the repository at this point in the history
  • Loading branch information
loevgaard committed Jun 27, 2024
1 parent f1e4a6f commit 26407b4
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 3 additions & 1 deletion src/Client/Endpoint/ProductEndpoint.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,10 @@ final class ProductEndpoint extends Endpoint implements ProductEndpointInterface
/**
* @return PaginatedCollection<Product>
*/
public function getPage(PageQuery $query): PaginatedCollection
public function getPage(PageQuery $query = null): PaginatedCollection
{
$query ??= PageQuery::create();

/** @var class-string<PaginatedCollection<Product>> $signature */
$signature = sprintf('%s<%s>', PaginatedCollection::class, self::getDataClass());

Expand Down
2 changes: 1 addition & 1 deletion src/Client/Endpoint/ProductEndpointInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ interface ProductEndpointInterface extends EndpointInterface, CreatableEndpointI
/**
* @return PaginatedCollection<Product>
*/
public function getPage(PageQuery $query): PaginatedCollection;
public function getPage(PageQuery $query = null): PaginatedCollection;

/**
* @return Collection<Product>
Expand Down

0 comments on commit 26407b4

Please sign in to comment.