Stub   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 37
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

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

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 3 1
A __invoke() 0 3 1
A getName() 0 3 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Improved\IteratorPipeline\PipelineBuilder;
6
7
/**
8
 * A stub for a step in the pipeline builder.
9
 * @internal
10
 */
11
class Stub
12
{
13
    /**
14
     * @var string
15
     */
16
    protected $name;
17
18
    /**
19
     * Class constructor.
20
     *
21
     * @param string $name
22
     */
23 2
    public function __construct(string $name)
24
    {
25 2
        $this->name = $name;
26 2
    }
27
28
    /**
29
     * Get the name of the stub.
30
     *
31
     * @return string
32
     */
33 2
    public function getName()
34
    {
35 2
        return $this->name;
36
    }
37
38
39
    /**
40
     * Invoke stub
41
     *
42
     * @param iterable $iterable
43
     * @return iterable
44
     */
45 1
    public function __invoke(iterable $iterable)
0 ignored issues
show
introduced by
Method Improved\IteratorPipeline\PipelineBuilder\Stub::__invoke() has parameter $iterable with no value type specified in iterable type iterable.
Loading history...
introduced by
Method Improved\IteratorPipeline\PipelineBuilder\Stub::__invoke() return type has no value type specified in iterable type iterable.
Loading history...
46
    {
47 1
        return $iterable;
48
    }
49
}
50