Issues (85)

src/Operation/Unwindow.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
10
/**
11
 * @immutable
12
 *
13
 * @template TKey
14
 * @template T
15
 */
16
final class Unwindow extends AbstractOperation
17
{
18
    /**
19
     * @return Closure(iterable<TKey, list<T>>): Generator<TKey, T|null>
20
     */
21 2
    public function __invoke(): Closure
22
    {
23
        /** @var Closure(iterable<TKey, list<T>>): Generator<TKey, T|null> $pipe */
24 2
        $pipe = (new Pipe())()(
25 2
            (new Map())()(
26
                /**
27
                 * @param list<T> $iterable
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...
28
                 *
29
                 * @return Generator<TKey, T>
30
                 */
31 2
                static fn (iterable $iterable): Generator => (new Last())()($iterable)
32 2
            ),
33 2
            (new Map())()(
34
                /**
35
                 * @param Generator<TKey, T> $iterable
36
                 *
37
                 * @return T|null
38
                 */
39 2
                static fn (Generator $iterable): mixed => $iterable->current()
40 2
            ),
41 2
        );
42
43
        // Point free style.
44 2
        return $pipe;
45
    }
46
}
47