AnalyserEffectedFilesResult   A
last analyzed

Complexity

Total Complexity 7

Size/Duplication

Total Lines 65
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

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

6 Methods

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