Issues (85)

src/Operation/Window.php (1 issue)

Labels
Severity
1
<?php
2
3
declare(strict_types=1);
4
5
namespace loophp\collection\Operation;
6
7
use Closure;
8
use Generator;
9
use loophp\iterators\LimitIterableAggregate;
10
use loophp\iterators\ReductionIterableAggregate;
11
12
use function array_slice;
13
14
/**
15
 * @immutable
16
 *
17
 * @template TKey
18
 * @template T
19
 */
20
final class Window extends AbstractOperation
21
{
22
    /**
23
     * @return Closure(int): Closure(iterable<TKey, T>): Generator<TKey|int, list<T>>
24
     */
25 8
    public function __invoke(): Closure
26
    {
27 8
        return
28
            /**
29
             * @return Closure(iterable<TKey, T>): Generator<TKey|int, list<T>>
30
             */
31 8
            static fn (int $size): Closure =>
32
                /**
33
                 * @param iterable<TKey, T> $iterable
34
                 *
35
                 * @return Generator<TKey|int, list<T>>
36
                 */
37 8
                static fn (iterable $iterable): Generator => yield from new LimitIterableAggregate(new ReductionIterableAggregate(
38 8
                    $iterable,
39
                    /**
40
                     * @param list<T> $stack
0 ignored issues
show
The type loophp\collection\Operation\list was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
41
                     * @param T $current
42
                     *
43
                     * @return list<T>
44
                     */
45 8
                    static fn (array $stack, mixed $current): array => array_slice([...$stack, $current], ++$size * -1),
46 8
                    []
47 8
                ), 1);
48
    }
49
}
50