The trait Cerbero\LazyJsonPages\Concerns\YieldsItemsByLength requires some properties which are not provided by Cerbero\LazyJsonPages\Pa...talItemsAwarePagination: $attempts, $backoff, $firstPage, $async, $rateLimits
Loading history...
16
17
/**
18
* Determine whether this pagination matches the configuration.
19
*/
20
34
public function matches(): bool
21
{
22
34
return $this->config->totalItemsKey !== null
23
34
&& $this->config->totalPagesKey === null
24
34
&& $this->config->lastPageKey === null;
25
}
26
27
/**
28
* Yield the paginated items.
29
*
30
* @return Traversable<int, mixed>
31
*/
32
4
public function getIterator(): Traversable
33
{
34
/** @phpstan-ignore-next-line */
35
4
yield from $this->yieldItemsUntilKey($this->config->totalItemsKey, function (int $totalItems) {
It seems like $this->config->totalItemsKey can also be of type null; however, parameter $key of Cerbero\LazyJsonPages\Pa...n::yieldItemsUntilKey() 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
35
yield from $this->yieldItemsUntilKey(/** @scrutinizer ignore-type */ $this->config->totalItemsKey, function (int $totalItems) {