Scoreboard::lineOfProcess()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
nc 1
nop 0
dl 0
loc 4
rs 10
c 0
b 0
f 0
1
<?php
2
/**
3
 * @author stev leibelt <[email protected]>
4
 * @since 2017-04-04
5
 */
6
7
namespace Net\Bazzline\Component\ApacheServerStatusParser\DomainModel;
8
9
class Scoreboard implements ReduceDataAbleToArrayInterface
10
{
11
    const REDUCED_DATA_TO_ARRAY_KEY_LIST_OF_LEGEND  = 'legend';
12
    const REDUCED_DATA_TO_ARRAY_KEY_LINE_OF_PROCESS = 'process';
13
14
    /** @var string */
15
    private $lineOfProcess;
16
17
    /** @var array */
18
    private $listOfLegend;
19
20
    /**
21
     * Scoreboard constructor.
22
     *
23
     * @param string $lineOfProcess
24
     * @param array $listOfLegend
25
     */
26
    public function __construct(
27
        $lineOfProcess,
28
        array $listOfLegend
29
    ) {
30
        $this->lineOfProcess    = $lineOfProcess;
31
        $this->listOfLegend     = $listOfLegend;
32
    }
33
34
    /**
35
     * @return string
36
     */
37
    public function lineOfProcess()
38
    {
39
        return $this->lineOfProcess;
40
    }
41
42
    /**
43
     * @return array
44
     */
45
    public function listOfLegend()
46
    {
47
        return $this->listOfLegend;
48
    }
49
50
    /**
51
     * @return array
52
     *  [
53
     *      'legend'    : array,
54
     *      'process'   : array
55
     *  ]
56
     */
57
    public function reduceDataToArray()
58
    {
59
        return [
60
            self::REDUCED_DATA_TO_ARRAY_KEY_LINE_OF_PROCESS => $this->lineOfProcess,
61
            self::REDUCED_DATA_TO_ARRAY_KEY_LIST_OF_LEGEND  => $this->listOfLegend
62
        ];
63
    }
64
}
65