LineNumberMapper   A
last analyzed

Complexity

Total Complexity 6

Size/Duplication

Total Lines 42
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 6
eloc 11
dl 0
loc 42
rs 10
c 0
b 0
f 0

6 Methods

Rating   Name   Duplication   Size   Complexity  
A incrementBoth() 0 4 1
A __construct() 0 4 1
A incrementNew() 0 3 1
A incrementOriginal() 0 3 1
A getOriginalLineNumber() 0 3 1
A getNewLineNumber() 0 3 1
1
<?php
2
3
/**
4
 * Static Analysis Results Baseliner (sarb).
5
 *
6
 * (c) Dave Liddament
7
 *
8
 * For the full copyright and licence information please view the LICENSE file distributed with this source code.
9
 */
10
11
declare(strict_types=1);
12
13
namespace DaveLiddament\StaticAnalysisResultsBaseliner\Plugins\GitDiffHistoryAnalyser\internal;
14
15
/**
16
 * Holds current Original and New Line numbers.
17
 */
18
final class LineNumberMapper
19
{
20
    /**
21
     * @var int
22
     */
23
    private $originalLineNumber;
24
25
    /**
26
     * @var int
27
     */
28
    private $newLineNumber;
29
30
    public function __construct()
31
    {
32
        $this->originalLineNumber = 0;
33
        $this->newLineNumber = 0;
34
    }
35
36
    public function incrementBoth(): void
37
    {
38
        ++$this->originalLineNumber;
39
        ++$this->newLineNumber;
40
    }
41
42
    public function incrementOriginal(): void
43
    {
44
        ++$this->originalLineNumber;
45
    }
46
47
    public function incrementNew(): void
48
    {
49
        ++$this->newLineNumber;
50
    }
51
52
    public function getOriginalLineNumber(): int
53
    {
54
        return $this->originalLineNumber;
55
    }
56
57
    public function getNewLineNumber(): int
58
    {
59
        return $this->newLineNumber;
60
    }
61
}
62