1 | <?php |
||
27 | final class MergeConflict |
||
28 | { |
||
29 | |||
30 | /** |
||
31 | * The lines from the original. |
||
32 | * |
||
33 | * @var string[] |
||
34 | */ |
||
35 | protected $base; |
||
36 | |||
37 | /** |
||
38 | * The conflicting line changes from the first source. |
||
39 | * |
||
40 | * @var string[] |
||
41 | */ |
||
42 | protected $remote; |
||
43 | |||
44 | /** |
||
45 | * The conflicting line changes from the second source. |
||
46 | * |
||
47 | * @var string[] |
||
48 | */ |
||
49 | protected $local; |
||
50 | |||
51 | /** |
||
52 | * The line number in the original text. |
||
53 | * |
||
54 | * @var int |
||
55 | */ |
||
56 | protected $baseLine; |
||
57 | |||
58 | /** |
||
59 | * The line number in the merged text. |
||
60 | * |
||
61 | * @var int |
||
62 | */ |
||
63 | protected $mergedLine; |
||
64 | |||
65 | /** |
||
66 | * MergeConflict constructor. |
||
67 | * |
||
68 | * @param string[] $base |
||
69 | * The original lines where the conflict happened. |
||
70 | * @param string[] $remote |
||
71 | * The conflicting line changes from the first source. |
||
72 | * @param string[] $local |
||
73 | * The conflicting line changes from the second source. |
||
74 | * @param int $baseLine |
||
75 | * The line number in the original text. |
||
76 | * @param int $mergedLine |
||
77 | * The line number in the merged text. |
||
78 | */ |
||
79 | 10 | public function __construct($base, $remote, $local, $baseLine, $mergedLine) |
|
88 | |||
89 | /** |
||
90 | * Get the base text of the conflict. |
||
91 | * |
||
92 | * @return string[] |
||
93 | * The array of lines which are involved in the conflict. |
||
94 | */ |
||
95 | 6 | public function getBase() |
|
99 | |||
100 | /** |
||
101 | * Get the lines from the first text. |
||
102 | * |
||
103 | * @return string[] |
||
104 | * The array of lines from the first text involved in the conflict. |
||
105 | */ |
||
106 | 2 | public function getRemote() |
|
110 | |||
111 | /** |
||
112 | * Get the lines from the second text. |
||
113 | * |
||
114 | * @return string[] |
||
115 | * The array of lines from the first text involved in the conflict. |
||
116 | */ |
||
117 | 2 | public function getLocal() |
|
121 | |||
122 | /** |
||
123 | * Get the line number in the original text where the conflict starts. |
||
124 | * |
||
125 | * @return int |
||
126 | * The line number as in the original text. |
||
127 | */ |
||
128 | 6 | public function getBaseLine() |
|
132 | |||
133 | /** |
||
134 | * Get the line number in the merged text where the conflict starts. |
||
135 | * |
||
136 | * @return int |
||
137 | * The line number in the merged text. |
||
138 | */ |
||
139 | 2 | public function getMergedLine() |
|
143 | |||
144 | /** |
||
145 | * Remove the trailing EOL that are now added by sebastian/diff. |
||
146 | * |
||
147 | * @param string[] $lines |
||
148 | * The lines to fix. |
||
149 | * |
||
150 | * @return string[] |
||
151 | * The fixed lines. |
||
152 | */ |
||
153 | 10 | private static function fixEOL(array $lines) |
|
160 | } |
||
161 |
Late static binding only has effect in subclasses. A
final
class cannot be extended anymore so late static binding cannot occurr. Consider replacingstatic::
withself::
.To learn more about late static binding, please refer to the PHP core documentation.