Words::__invoke()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 16
Code Lines 6

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 9
CRAP Score 1

Importance

Changes 2
Bugs 1 Features 0
Metric Value
cc 1
eloc 6
c 2
b 1
f 0
nc 1
nop 0
dl 0
loc 16
ccs 9
cts 9
cp 1
crap 1
rs 10
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