Words   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 21
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 3
Bugs 1 Features 0
Metric Value
eloc 7
c 3
b 1
f 0
dl 0
loc 21
ccs 9
cts 9
cp 1
rs 10
wmc 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A __invoke() 0 16 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 Words extends AbstractOperation
17
{
18
    /**
19
     * @return Closure(iterable<TKey, T>): Generator<TKey, string>
20
     */
21 2
    public function __invoke(): Closure
22
    {
23
        /** @var Closure(iterable<TKey, T>): Generator<TKey, string> $pipe */
24 2
        $pipe = (new Pipe())()(
25 2
            (new Explode())()(["\t", "\n", ' ']),
26 2
            (new Map())()(
27
                /**
28
                 * @param list<string> $value
0 ignored issues
show
Bug introduced by
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...
29
                 */
30 2
                static fn (array $value): string => implode('', $value)
31 2
            ),
32 2
            (new Compact())()([])
33 2
        );
34
35
        // Point free style.
36 2
        return $pipe;
37
    }
38
}
39