Skip to content

Commit

Permalink
feat(ScheduleClient): use namespace from the Service Client by defaul…
Browse files Browse the repository at this point in the history
…t in the `listSchedules()` method (#430)
  • Loading branch information
roxblnfk authored May 13, 2024
1 parent ab8a006 commit d4bd412
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/Client/ScheduleClient.php
Original file line number Diff line number Diff line change
Expand Up @@ -147,12 +147,12 @@ public function getHandle(string $scheduleID, ?string $namespace = null): Schedu
}

public function listSchedules(
string $namespace = 'default',
?string $namespace = null,
int $pageSize = 0,
): Paginator {
// Build request
$request = (new ListSchedulesRequest())
->setNamespace($namespace)
->setNamespace($namespace ?? $this->clientOptions->namespace)
->setMaximumPageSize($pageSize);

$loader = function (ListSchedulesRequest $request): \Generator {
Expand Down
4 changes: 2 additions & 2 deletions src/Client/ScheduleClientInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,10 @@ public function getHandle(string $scheduleID, ?string $namespace = null): Schedu
/**
* List all schedules in a namespace.
*
* @param non-empty-string $namespace
* @param non-empty-string|null $namespace If null, the preconfigured namespace will be used.
* @param int<0, max> $pageSize Maximum number of Schedule info per page.
*
* @return Paginator<ScheduleListEntry>
*/
public function listSchedules(string $namespace = 'default', int $pageSize = 0,): Paginator;
public function listSchedules(?string $namespace = null, int $pageSize = 0,): Paginator;
}

0 comments on commit d4bd412

Please sign in to comment.