StepsStepInfoIterator   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 23
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 6
c 1
b 0
f 0
dl 0
loc 23
ccs 5
cts 5
cp 1
rs 10
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A current() 0 7 1
1
<?php
2
3
/* this file is part of pipelines */
4
5
namespace Ktomk\Pipelines\File\Info;
6
7
use Ktomk\Pipelines\File\Pipeline\Steps;
8
9
final class StepsStepInfoIterator extends \IteratorIterator
10
{
11
    /**
12
     * @var ?Steps
13
     */
14
    private $steps;
15
16
    /**
17
     * @param ?Steps $steps
18
     */
19 4
    public function __construct(Steps $steps = null)
20
    {
21 4
        $this->steps = $steps;
22 4
        parent::__construct(Steps::fullIter($steps));
23
    }
24
25 4
    #[\ReturnTypeWillChange]
26
    /**
27
     * @return StepInfo
28
     */
29
    public function current()
30
    {
31 4
        return new StepInfo(parent::current(), (int)$this->key());
32
    }
33
}
34