Scoreboard   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 56
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 0

Importance

Changes 0
Metric Value
dl 0
loc 56
rs 10
c 0
b 0
f 0
wmc 4
lcom 1
cbo 0

4 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 7 1
A lineOfProcess() 0 4 1
A listOfLegend() 0 4 1
A reduceDataToArray() 0 7 1
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