WriterStep   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 25
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Test Coverage

Coverage 100%

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A process() 0 6 1
1
<?php
2
3
namespace Port\Steps\Step;
4
5
use Port\Steps\Step;
6
use Port\Writer;
7
8
/**
9
 * @author Márk Sági-Kazár <[email protected]>
10
 */
11
class WriterStep implements Step
12
{
13
    /**
14
     * @var Writer
15
     */
16
    private $writer;
17
18
    /**
19
     * @param Writer $writer
20
     */
21 7
    public function __construct(Writer $writer)
22
    {
23 7
        $this->writer = $writer;
24 7
    }
25
26
    /**
27
     * {@inheritdoc}
28
     */
29 5
    public function process($item, callable $next)
30
    {
31 5
        $this->writer->writeItem($item);
32
33 3
        return $next($item);
34
    }
35
}
36