From 26407b489e94accaec8e6bc1881f0ea4c004329a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joachim=20L=C3=B8vgaard?= Date: Thu, 27 Jun 2024 13:12:01 +0200 Subject: [PATCH] Allow empty PageQuery --- src/Client/Endpoint/ProductEndpoint.php | 4 +++- src/Client/Endpoint/ProductEndpointInterface.php | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/Client/Endpoint/ProductEndpoint.php b/src/Client/Endpoint/ProductEndpoint.php index 44a4fd8..224ddce 100644 --- a/src/Client/Endpoint/ProductEndpoint.php +++ b/src/Client/Endpoint/ProductEndpoint.php @@ -24,8 +24,10 @@ final class ProductEndpoint extends Endpoint implements ProductEndpointInterface /** * @return PaginatedCollection */ - public function getPage(PageQuery $query): PaginatedCollection + public function getPage(PageQuery $query = null): PaginatedCollection { + $query ??= PageQuery::create(); + /** @var class-string> $signature */ $signature = sprintf('%s<%s>', PaginatedCollection::class, self::getDataClass()); diff --git a/src/Client/Endpoint/ProductEndpointInterface.php b/src/Client/Endpoint/ProductEndpointInterface.php index 6087349..e5bb0b4 100644 --- a/src/Client/Endpoint/ProductEndpointInterface.php +++ b/src/Client/Endpoint/ProductEndpointInterface.php @@ -18,7 +18,7 @@ interface ProductEndpointInterface extends EndpointInterface, CreatableEndpointI /** * @return PaginatedCollection */ - public function getPage(PageQuery $query): PaginatedCollection; + public function getPage(PageQuery $query = null): PaginatedCollection; /** * @return Collection