WriterStep::process()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 6

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 3
CRAP Score 1

Importance

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