Skip to content

Commit

Permalink
Update configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
cerbero90 committed Jan 23, 2024
1 parent 1a70b47 commit d54561d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
5 changes: 2 additions & 3 deletions src/Dtos/Config.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,11 @@
final class Config
{
public function __construct(
public readonly string $dot = "*",
public readonly string $pointer = '',
public readonly string $pointer,
public readonly string $pageName = 'page',
public readonly int $firstPage = 1,
public readonly ?string $totalPagesKey = null,
public readonly ?int $totalItems = null,
public readonly ?string $totalItemsKey = null,
public readonly ?int $perPage = null,
public readonly ?string $perPageKey = null,
public readonly ?int $perPageOverride = null,
Expand Down
5 changes: 2 additions & 3 deletions src/LazyJsonPages.php
Original file line number Diff line number Diff line change
Expand Up @@ -104,9 +104,9 @@ private function valueFromResponse(Closure|string $key): mixed
/**
* Set the total number of items.
*/
public function totalItems(Closure|string $totalItems): self
public function totalItems(string $key): self
{
$this->config['totalItems'] = $this->integerFromResponse($totalItems);
$this->config['totalItemsKey'] = $key;

return $this;
}
Expand Down Expand Up @@ -209,7 +209,6 @@ public function backoff(Closure $callback): self
*/
public function collect(string $dot = '*'): LazyCollection
{
$this->config['dot'] = $dot;
$this->config['pointer'] = DotsConverter::toPointer($dot);

Client::configure($this->requestOptions);
Expand Down

0 comments on commit d54561d

Please sign in to comment.