Stage   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 26
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 2
lcom 1
cbo 2
dl 0
loc 26
ccs 7
cts 7
cp 1
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A process() 0 7 1
1
<?php
2
/**
3
 * This file is part of Zee Project.
4
 *
5
 * For the full copyright and license information, please view the LICENSE
6
 * file that was distributed with this source code.
7
 *
8
 * @see https://github.com/zee/
9
 */
10
11
declare(strict_types=1);
12
13
namespace Zee\Chains;
14
15
/**
16
 * Chain stage.
17
 */
18
final class Stage
19
{
20
    /**
21
     * @var Sequence
22
     */
23
    private $iterator;
24
25
    /**
26
     * @param Sequence $iterator
27
     */
28 2
    public function __construct(Sequence $iterator)
29
    {
30 2
        $this->iterator = $iterator;
31 2
    }
32
33
    /**
34
     * {@inheritdoc}
35
     */
36 2
    public function process($payload)
37
    {
38 2
        $handler = $this->iterator->pickNext();
39 2
        $payload = $handler->handle($payload, $this);
40
41 2
        return $payload;
42
    }
43
}
44