ColumnExpressionCollection   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 54
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
eloc 9
dl 0
loc 54
ccs 11
cts 11
cp 1
rs 10
c 0
b 0
f 0
wmc 4

4 Methods

Rating   Name   Duplication   Size   Complexity  
A getColumns() 0 3 1
A toArray() 0 5 1
A __construct() 0 3 1
A setColumns() 0 4 1
1
<?php
2
/**
3
 * @category    Brownie/BpmOnline
4
 * @author      Brownie <[email protected]>
5
 * @license     https://opensource.org/licenses/MIT
6
 */
7
8
namespace Brownie\BpmOnline\DataService\Column;
9
10
/**
11
 * Collection of column expressions.
12
 */
13
class ColumnExpressionCollection implements Column
14
{
15
16
    /**
17
     * Column expression collection.
18
     *
19
     * @var ColumnExpression[]
20
     */
21
    private $columns;
22
23
    /**
24
     * Sets the input values.
25
     *
26
     * @param ColumnExpression[]    $columns    Column expression collection.
27
     */
28 1
    public function __construct(array $columns)
29
    {
30 1
        $this->setColumns($columns);
31 1
    }
32
33
    /**
34
     * Sets column expression collection.
35
     * Returns the current object.
36
     *
37
     * @param ColumnExpression[]    $columns    Column expression collection.
38
     *
39
     * @return self
40
     */
41 1
    private function setColumns(array $columns)
42
    {
43 1
        $this->columns = $columns;
44 1
        return $this;
45
    }
46
47
    /**
48
     * Gets column expression collection.
49
     *
50
     * @return ColumnExpression[]
51
     */
52 1
    private function getColumns()
53
    {
54 1
        return $this->columns;
55
    }
56
57
    /**
58
     * Returns data as an associative array.
59
     *
60
     * @return array
61
     */
62
    public function toArray()
63
    {
64 1
        return array_map(function($column) {
65 1
            return $column->toArray();
66 1
        }, $this->getColumns());
67
    }
68
}
69