Issues (85)

src/Operation/Pair.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 Pair extends AbstractOperation
17
{
18
    /**
19
     * @return Closure(iterable<TKey, T>): Generator<T, T|null>
20
     */
21 12
    public function __invoke(): Closure
22
    {
23
        /** @var Closure(iterable<TKey, T>): Generator<T, T|null> $pipe */
24 12
        $pipe = (new Pipe())()(
25 12
            (new Normalize())(),
26 12
            (new Chunk())()(2),
27 12
            (new Associate())()(
28
                /**
29
                 * @param TKey $key
0 ignored issues
show
The type loophp\collection\Operation\TKey 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...
30
                 * @param array{0: TKey, 1: T} $value
31
                 *
32
                 * @return TKey|null
33
                 */
34 12
                static fn (mixed $key, array $value): mixed => $value[0] ?? null
35 12
            )(
36
                /**
37
                 * @param array{0: TKey, 1: T} $value
38
                 *
39
                 * @return T|null
40
                 */
41 12
                static fn (array $value): mixed => $value[1] ?? null
42 12
            )
43 12
        );
44
45
        // Point free style.
46 12
        return $pipe;
47
    }
48
}
49