1 | <?php |
||
8 | class DiffRowPosition |
||
9 | { |
||
10 | /** |
||
11 | * @var int |
||
12 | */ |
||
13 | protected $indexInOld; |
||
14 | |||
15 | /** |
||
16 | * @var int |
||
17 | */ |
||
18 | protected $indexInNew; |
||
19 | |||
20 | /** |
||
21 | * @var int |
||
22 | */ |
||
23 | protected $columnInOld; |
||
24 | |||
25 | /** |
||
26 | * @var int |
||
27 | */ |
||
28 | protected $columnInNew; |
||
29 | |||
30 | /** |
||
31 | * DiffRowPosition constructor. |
||
32 | * |
||
33 | * @param int $indexInOld |
||
34 | * @param int $indexInNew |
||
35 | * @param int $columnInOld |
||
36 | * @param int $columnInNew |
||
37 | */ |
||
38 | 1 | public function __construct($indexInOld = 0, $indexInNew = 0, $columnInOld = 0, $columnInNew = 0) |
|
39 | { |
||
40 | 1 | $this->indexInOld = $indexInOld; |
|
41 | 1 | $this->indexInNew = $indexInNew; |
|
42 | 1 | $this->columnInOld = $columnInOld; |
|
43 | 1 | $this->columnInNew = $columnInNew; |
|
44 | 1 | } |
|
45 | |||
46 | /** |
||
47 | * @return int |
||
48 | */ |
||
49 | 1 | public function getIndexInOld() |
|
50 | { |
||
51 | 1 | return $this->indexInOld; |
|
52 | } |
||
53 | |||
54 | /** |
||
55 | * @param int $indexInOld |
||
56 | * |
||
57 | * @return DiffRowPosition |
||
58 | */ |
||
59 | public function setIndexInOld($indexInOld) |
||
65 | |||
66 | /** |
||
67 | * @return int |
||
68 | */ |
||
69 | 1 | public function getIndexInNew() |
|
70 | { |
||
71 | 1 | return $this->indexInNew; |
|
72 | } |
||
73 | |||
74 | /** |
||
75 | * @param int $indexInNew |
||
76 | * |
||
77 | * @return DiffRowPosition |
||
78 | */ |
||
79 | public function setIndexInNew($indexInNew) |
||
85 | |||
86 | /** |
||
87 | * @return int |
||
88 | */ |
||
89 | 1 | public function getColumnInOld() |
|
90 | { |
||
91 | 1 | return $this->columnInOld; |
|
92 | } |
||
93 | |||
94 | /** |
||
95 | * @param int $columnInOld |
||
96 | * |
||
97 | * @return DiffRowPosition |
||
98 | */ |
||
99 | public function setColumnInOld($columnInOld) |
||
105 | |||
106 | /** |
||
107 | * @return int |
||
108 | */ |
||
109 | 1 | public function getColumnInNew() |
|
110 | { |
||
111 | 1 | return $this->columnInNew; |
|
112 | } |
||
113 | |||
114 | /** |
||
115 | * @param int $columnInNew |
||
116 | * |
||
117 | * @return DiffRowPosition |
||
118 | */ |
||
119 | public function setColumnInNew($columnInNew) |
||
125 | |||
126 | /** |
||
127 | * @param int $increment |
||
128 | * |
||
129 | * @return int |
||
130 | */ |
||
131 | 1 | public function incrementColumnInNew($increment = 1) |
|
132 | { |
||
133 | 1 | $this->columnInNew += $increment; |
|
134 | |||
135 | 1 | return $this->columnInNew; |
|
136 | } |
||
137 | |||
138 | /** |
||
139 | * @param int $increment |
||
140 | * |
||
141 | * @return int |
||
142 | */ |
||
143 | 1 | public function incrementColumnInOld($increment = 1) |
|
144 | { |
||
145 | 1 | $this->columnInOld += $increment; |
|
146 | |||
147 | 1 | return $this->columnInOld; |
|
148 | } |
||
149 | |||
150 | /** |
||
151 | * @param int $increment |
||
152 | * |
||
153 | * @return int |
||
154 | */ |
||
155 | 1 | public function incrementIndexInNew($increment = 1) |
|
156 | { |
||
157 | 1 | $this->indexInNew += $increment; |
|
158 | |||
159 | 1 | return $this->indexInNew; |
|
160 | } |
||
161 | |||
162 | /** |
||
163 | * @param int $increment |
||
164 | * |
||
165 | * @return int |
||
166 | */ |
||
167 | 1 | public function incrementIndexInOld($increment = 1) |
|
168 | { |
||
169 | 1 | $this->indexInOld += $increment; |
|
170 | |||
171 | 1 | return $this->indexInOld; |
|
172 | } |
||
173 | |||
174 | /** |
||
175 | * @param string $type |
||
176 | * @param int $increment |
||
177 | * |
||
178 | * @return int |
||
179 | */ |
||
180 | public function incrementIndex($type, $increment = 1) |
||
188 | |||
189 | /** |
||
190 | * @param string $type |
||
191 | * @param int $increment |
||
192 | * |
||
193 | * @return int |
||
194 | */ |
||
195 | public function incrementColumn($type, $increment = 1) |
||
203 | |||
204 | /** |
||
205 | * @param string $type |
||
206 | * |
||
207 | * @return bool |
||
208 | */ |
||
209 | public function isColumnLessThanOther($type) |
||
217 | |||
218 | /** |
||
219 | * @param string $type |
||
220 | * |
||
221 | * @return int |
||
222 | */ |
||
223 | public function getColumn($type) |
||
231 | |||
232 | /** |
||
233 | * @param string $type |
||
234 | * |
||
235 | * @return int |
||
236 | */ |
||
237 | public function getIndex($type) |
||
245 | |||
246 | /** |
||
247 | * @return bool |
||
248 | */ |
||
249 | 1 | public function areColumnsEqual() |
|
250 | { |
||
251 | 1 | return $this->getColumnInOld() === $this->getColumnInNew(); |
|
252 | } |
||
253 | |||
254 | /** |
||
255 | * @return null|string |
||
256 | */ |
||
257 | public function getLesserColumnType() |
||
267 | } |
||
268 |