WorkflowConcatenator   A
last analyzed

Complexity

Total Complexity 5

Size/Duplication

Total Lines 45
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 0

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 1 Features 0
Metric Value
wmc 5
lcom 1
cbo 0
dl 0
loc 45
ccs 11
cts 11
cp 1
rs 10
c 1
b 1
f 0

5 Methods

Rating   Name   Duplication   Size   Complexity  
A getIterator() 0 4 1
A count() 0 4 1
A writeItem() 0 4 1
A prepare() 0 3 1
A finish() 0 3 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