ArrayWriter   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 31
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 0

Test Coverage

Coverage 100%
Metric Value
wmc 4
lcom 1
cbo 0
dl 0
loc 31
ccs 9
cts 9
cp 1
rs 10

4 Methods

Rating   Name   Duplication   Size   Complexity  
A getData() 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\Writer;
12
13
/**
14
 * ArrayWriter.
15
 *
16
 * @author    Florian Eckerstorfer <[email protected]>
17
 * @copyright 2014-2016 Florian Eckerstorfer
18
 */
19
class ArrayWriter implements WriterInterface
20
{
21
    /** @var array */
22
    private $data = [];
23
24
    /**
25
     * @return array
26
     */
27 1
    public function getData()
28
    {
29 1
        return $this->data;
30
    }
31
32
    /**
33
     * Writes the given item to the array.
34
     *
35
     * @param $item
36
     */
37 1
    public function writeItem($item)
38
    {
39 1
        $this->data[] = $item;
40 1
    }
41
42 1
    public function prepare()
43
    {
44 1
    }
45
46 1
    public function finish()
47
    {
48 1
    }
49
}
50