The trait Cerbero\LazyJsonPages\Concerns\YieldsItemsByCursor requires some properties which are not provided by Cerbero\LazyJsonPages\Pa...s\CursorAwarePagination: $attempts, $backoff, $rateLimits
Loading history...
17
18
/**
19
* Determine whether this pagination matches the configuration.
20
*/
21
50
public function matches(): bool
22
{
23
50
return $this->config->cursorKey !== null
24
50
&& $this->config->totalItemsKey === null
25
50
&& $this->config->totalPagesKey === null
26
50
&& $this->config->lastPageKey === null;
27
}
28
29
/**
30
* Yield the paginated items.
31
*
32
* @return Traversable<int, mixed>
33
*/
34
2
public function getIterator(): Traversable
35
{
36
2
yield from $this->yieldItemsByCursor(function (ResponseInterface $response) {
37
/** @phpstan-ignore-next-line */
38
1
yield from $generator = $this->yieldItemsAndGetKey($response, $this->config->cursorKey);
It seems like $this->config->cursorKey can also be of type null; however, parameter $key of Cerbero\LazyJsonPages\Pa...::yieldItemsAndGetKey() does only seem to accept string, maybe add an additional type check?
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the ignore-type annotation
38
yield from $generator = $this->yieldItemsAndGetKey($response, /** @scrutinizer ignore-type */ $this->config->cursorKey);