1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
/** |
4
|
|
|
* GitElephant - An abstraction layer for git written in PHP |
5
|
|
|
* Copyright (C) 2013 Matteo Giachino |
6
|
|
|
* |
7
|
|
|
* This program is free software: you can redistribute it and/or modify |
8
|
|
|
* it under the terms of the GNU General Public License as published by |
9
|
|
|
* the Free Software Foundation, either version 3 of the License, or |
10
|
|
|
* (at your option) any later version. |
11
|
|
|
* |
12
|
|
|
* This program is distributed in the hope that it will be useful, |
13
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
14
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
15
|
|
|
* GNU General Public License for more details. |
16
|
|
|
* |
17
|
|
|
* You should have received a copy of the GNU General Public License |
18
|
|
|
* along with this program. If not, see [http://www.gnu.org/licenses/]. |
19
|
|
|
*/ |
20
|
|
|
|
21
|
|
|
namespace GitElephant\Objects\Diff; |
22
|
|
|
|
23
|
|
|
/** |
24
|
|
|
* DiffChunkLine unchanged |
25
|
|
|
* |
26
|
|
|
* @author Matteo Giachino <[email protected]> |
27
|
|
|
*/ |
28
|
|
|
class DiffChunkLineUnchanged extends DiffChunkLine |
29
|
|
|
{ |
30
|
|
|
/** |
31
|
|
|
* Origin line number |
32
|
|
|
* |
33
|
|
|
* @var int |
34
|
|
|
*/ |
35
|
|
|
protected $originNumber; |
36
|
|
|
|
37
|
|
|
/** |
38
|
|
|
* Destination line number |
39
|
|
|
* |
40
|
|
|
* @var int |
41
|
|
|
*/ |
42
|
|
|
protected $destNumber; |
43
|
|
|
|
44
|
|
|
/** |
45
|
|
|
* Class constructor |
46
|
|
|
* |
47
|
|
|
* @param int $originNumber original line number |
48
|
|
|
* @param int $destinationNumber destination line number |
49
|
|
|
* @param string $content line content |
50
|
|
|
* |
51
|
|
|
* @internal param int $number line number |
52
|
|
|
*/ |
53
|
2 |
|
public function __construct(int $originNumber, int $destinationNumber, string $content) |
54
|
|
|
{ |
55
|
2 |
|
$this->setOriginNumber($originNumber); |
56
|
2 |
|
$this->setDestNumber($destinationNumber); |
57
|
2 |
|
$this->setContent($content); |
58
|
2 |
|
$this->setType(self::UNCHANGED); |
59
|
2 |
|
} |
60
|
|
|
|
61
|
|
|
/** |
62
|
|
|
* Set origin line number |
63
|
|
|
* |
64
|
|
|
* @param int $number line number |
65
|
|
|
*/ |
66
|
2 |
|
public function setOriginNumber(int $number): void |
67
|
|
|
{ |
68
|
2 |
|
$this->originNumber = $number; |
69
|
2 |
|
} |
70
|
|
|
|
71
|
|
|
/** |
72
|
|
|
* Get origin line number |
73
|
|
|
* |
74
|
|
|
* @return int |
75
|
|
|
*/ |
76
|
1 |
|
public function getOriginNumber(): ?int |
77
|
|
|
{ |
78
|
1 |
|
return $this->originNumber; |
79
|
|
|
} |
80
|
|
|
|
81
|
|
|
/** |
82
|
|
|
* Set destination line number |
83
|
|
|
* |
84
|
|
|
* @param int $number line number |
85
|
|
|
*/ |
86
|
2 |
|
public function setDestNumber(int $number): void |
87
|
|
|
{ |
88
|
2 |
|
$this->destNumber = $number; |
89
|
2 |
|
} |
90
|
|
|
|
91
|
|
|
/** |
92
|
|
|
* Get destination line number |
93
|
|
|
* |
94
|
|
|
* @return int |
95
|
|
|
*/ |
96
|
1 |
|
public function getDestNumber(): ?int |
97
|
|
|
{ |
98
|
1 |
|
return $this->destNumber; |
99
|
|
|
} |
100
|
|
|
} |
101
|
|
|
|