TotalIssueMap   A
last analyzed

Complexity

Total Complexity 7

Size/Duplication

Total Lines 60
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
dl 0
loc 60
ccs 16
cts 16
cp 1
rs 10
c 0
b 0
f 0
wmc 7

5 Methods

Rating   Name   Duplication   Size   Complexity  
A getErrorCounter() 0 6 2
A getWarningMap() 0 3 1
A __construct() 0 4 1
A getWarningCounter() 0 6 2
A getErrorMap() 0 3 1
1
<?php
2
3
4
namespace cwreden\php7ccAnalyser;
5
6
7
class TotalIssueMap
8
{
9
    /**
10
     * @var array
11
     */
12
    private $warningMap;
13
    /**
14
     * @var array
15
     */
16
    private $errorMap;
17
18
    /**
19
     * TotalIssueMap constructor.
20
     * @param array $warningMap
21
     * @param array $errorMap
22
     */
23 4
    public function __construct(array $warningMap, array $errorMap)
24
    {
25 4
        $this->warningMap = $warningMap;
26 4
        $this->errorMap = $errorMap;
27 4
    }
28
29
    /**
30
     * @param string $key
31
     * @return int
32
     */
33 1
    public function getWarningCounter(string $key): int
34
    {
35 1
        if (isset($this->warningMap[$key])) {
36 1
            return $this->warningMap[$key];
37
        }
38 1
        return 0;
39
    }
40
41
    /**
42
     * @param string $key
43
     * @return int
44
     */
45 1
    public function getErrorCounter(string $key): int
46
    {
47 1
        if (isset($this->errorMap[$key])) {
48 1
            return $this->errorMap[$key];
49
        }
50 1
        return 0;
51
    }
52
53
    /**
54
     * @return array
55
     */
56 1
    public function getWarningMap(): array
57
    {
58 1
        return $this->warningMap;
59
    }
60
61
    /**
62
     * @return array
63
     */
64 1
    public function getErrorMap(): array
65
    {
66 1
        return $this->errorMap;
67
    }
68
69
}