WorkflowConcatenator::writeItem()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 3
CRAP Score 1

Importance

Changes 1
Bugs 1 Features 0
Metric Value
dl 0
loc 4
ccs 3
cts 3
cp 1
rs 10
c 1
b 1
f 0
cc 1
eloc 2
nc 1
nop 1
crap 1
1
<?php
2
3
/**
4
 * This file is part of plumphp/plum.
5
 *
6
 * (c) Florian Eckerstorfer <[email protected]>
7
 *
8
 * For the full copyright and license information, please view the LICENSE
9
 * file that was distributed with this source code.
10
 */
11
namespace Plum\Plum;
12
13
use Plum\Plum\Reader\ReaderInterface;
14
use Plum\Plum\Writer\WriterInterface;
15
16
/**
17
 * WorkflowConcatenator.
18
 *
19
 * @author    Florian Eckerstorfer <[email protected]>
20
 * @copyright 2014-2016 Florian Eckerstorfer
21
 */
22
class WorkflowConcatenator implements ReaderInterface, WriterInterface
23
{
24
    /** @var mixed[] */
25
    private $data = [];
26
27
    /**
28
     * @return \ArrayIterator
29
     */
30 1
    public function getIterator()
31
    {
32 1
        return new \ArrayIterator($this->data);
33
    }
34
35
    /**
36
     * @return int
37
     */
38 1
    public function count()
39
    {
40 1
        return count($this->data);
41
    }
42
43
    /**
44
     * Write the given item.
45
     *
46
     * @param mixed $item
47
     */
48 1
    public function writeItem($item)
49
    {
50 1
        $this->data[] = $item;
51 1
    }
52
53
    /**
54
     * Prepare the writer.
55
     */
56 1
    public function prepare()
57
    {
58 1
    }
59
60
    /**
61
     * Finish the writer.
62
     */
63 1
    public function finish()
64
    {
65 1
    }
66
}
67