Column   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 29
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
eloc 11
c 0
b 0
f 0
dl 0
loc 29
ccs 12
cts 12
cp 1
rs 10
wmc 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A __invoke() 0 24 1
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 Column extends AbstractOperation
17
{
18
    /**
19
     * @return Closure(mixed): Closure(iterable<TKey, T>): Generator<int, mixed>
20
     */
21 6
    public function __invoke(): Closure
22
    {
23 6
        return
24
            /**
25
             * @return Closure(iterable<TKey, T>): Generator<int, mixed>
26
             */
27 6
            static function (mixed $column): Closure {
28 6
                $filterCallbackBuilder =
29
                    /**
30
                     * @param T $value
31
                     * @param TKey $key
0 ignored issues
show
Bug introduced by
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...
32
                     */
33 6
                    static fn (mixed $value, mixed $key): bool => $key === $column;
34
35
                /** @var Closure(iterable<TKey, T>): Generator<int, mixed> $pipe */
36 6
                $pipe = (new Pipe())()(
37 6
                    (new Transpose())(),
38 6
                    (new Filter())()($filterCallbackBuilder),
39 6
                    (new Head())(),
40 6
                    (new Flatten())()(1)
41 6
                );
42
43
                // Point free style.
44 6
                return $pipe;
45 6
            };
46
    }
47
}
48