Make page and pagesize optional

This commit is contained in:
mathiaspalmqvist committed 2025-06-30 11:11:29 +02:00
1 parent 410906b2cd
commit 27ddeeacb5
1 file changed
+12 -5
+12 -5
View File
@@ -13,12 +13,19 @@ class Customer
/** /**
* Get a list of all customers. * Get a list of all customers.
*/ */
public function all(int $page = 1, int $pageSize = 25): object public function all(?int $page = null, ?int $pageSize = null): object
{ {
return $this->client->get('customers', [ $query = [];
'page' => $page,
'pageSize' => $pageSize, if ($page !== null) {
]); $query['page'] = $page;
}
if ($pageSize !== null) {
$query['pageSize'] = $pageSize;
}
return $this->client->get('customers', $query);
} }
public function get(string $customerId): object public function get(string $customerId): object