@@ -61,10 +61,10 @@ discard block |
||
61 | 61 | use Something\True; |
62 | 62 | class MyClass |
63 | 63 | { |
64 | - public function myFunction() |
|
65 | - { |
|
66 | - $var = array('foo' => new True()); |
|
67 | - } |
|
64 | + public function myFunction() |
|
65 | + { |
|
66 | + $var = array('foo' => new True()); |
|
67 | + } |
|
68 | 68 | } |
69 | 69 | |
70 | 70 | $x = $f?FALSE:true; |
@@ -72,8 +72,8 @@ discard block |
||
72 | 72 | |
73 | 73 | class MyClass |
74 | 74 | { |
75 | - // Spice things up a little. |
|
76 | - const TRUE = false; |
|
75 | + // Spice things up a little. |
|
76 | + const TRUE = false; |
|
77 | 77 | } |
78 | 78 | |
79 | 79 | var_dump(MyClass::TRUE); |
@@ -22,22 +22,4 @@ |
||
22 | 22 | <<<<<<< HEAD |
23 | 23 | $a = 1; |
24 | 24 | ======= |
25 | -$a = 2; |
|
26 | ->>>>>>> master |
|
27 | - |
|
28 | -/* |
|
29 | - * The above tests are based on "normal" tokens. |
|
30 | - * The below test checks that once the tokenizer breaks down because of |
|
31 | - * unexpected merge conflict boundaries - i.e. after the first merge conflict |
|
32 | - * opener in non-comment, non-heredoc/nowdoc, non-inline HTML code -, subsequent |
|
33 | - * merge conflict boundaries will still be detected correctly. |
|
34 | - */ |
|
35 | -?> |
|
36 | - |
|
37 | -<div class="abc"> |
|
38 | -<<<<<<< HEAD |
|
39 | - <p id="test-this">Testing a merge conflict.</p> |
|
40 | -======= |
|
41 | - <p id="test-that">Another text string.</p> |
|
42 | ->>>>>>> ref/heads/feature-branch |
|
43 | -</div> |
|
25 | +$a |
|
44 | 26 | \ No newline at end of file |
@@ -64,8 +64,4 @@ |
||
64 | 64 | <<<<<<< HEAD |
65 | 65 | can be problematic. |
66 | 66 | EOD; |
67 | -$a = 1; |
|
68 | -======= |
|
69 | -should also be detected. |
|
70 | -EOT; |
|
71 | ->>>>>>> ref/heads/other-branchname |
|
67 | +$a |
|
72 | 68 | \ No newline at end of file |
@@ -15,146 +15,146 @@ |
||
15 | 15 | { |
16 | 16 | |
17 | 17 | |
18 | - /** |
|
19 | - * Returns the lines where errors should occur. |
|
20 | - * |
|
21 | - * The key of the array should represent the line number and the value |
|
22 | - * should represent the number of errors that should occur on that line. |
|
23 | - * |
|
24 | - * @param string $testFile The name of the file being tested. |
|
25 | - * |
|
26 | - * @return array<int, int> |
|
27 | - */ |
|
28 | - public function getErrorList($testFile='GitMergeConflictUnitTest.1.inc') |
|
29 | - { |
|
30 | - switch ($testFile) { |
|
31 | - case 'GitMergeConflictUnitTest.1.inc': |
|
32 | - return [ |
|
33 | - 26 => 1, |
|
34 | - 28 => 1, |
|
35 | - 30 => 1, |
|
36 | - 45 => 1, |
|
37 | - 53 => 1, |
|
38 | - 55 => 1, |
|
39 | - 59 => 1, |
|
40 | - 61 => 1, |
|
41 | - ]; |
|
42 | - |
|
43 | - case 'GitMergeConflictUnitTest.2.inc': |
|
44 | - return [ |
|
45 | - 4 => 1, |
|
46 | - 6 => 1, |
|
47 | - 8 => 1, |
|
48 | - 14 => 1, |
|
49 | - 20 => 1, |
|
50 | - 22 => 1, |
|
51 | - 26 => 1, |
|
52 | - 28 => 1, |
|
53 | - 30 => 1, |
|
54 | - ]; |
|
55 | - |
|
56 | - case 'GitMergeConflictUnitTest.3.inc': |
|
57 | - return [ |
|
58 | - 3 => 1, |
|
59 | - 5 => 1, |
|
60 | - 7 => 1, |
|
61 | - 12 => 1, |
|
62 | - 14 => 1, |
|
63 | - 16 => 1, |
|
64 | - 22 => 1, |
|
65 | - 24 => 1, |
|
66 | - 26 => 1, |
|
67 | - 38 => 1, |
|
68 | - 40 => 1, |
|
69 | - 42 => 1, |
|
70 | - ]; |
|
71 | - |
|
72 | - case 'GitMergeConflictUnitTest.4.inc': |
|
73 | - return [ |
|
74 | - 6 => 1, |
|
75 | - 8 => 1, |
|
76 | - 10 => 1, |
|
77 | - 18 => 1, |
|
78 | - 22 => 1, |
|
79 | - 25 => 1, |
|
80 | - 29 => 1, |
|
81 | - 34 => 1, |
|
82 | - 39 => 1, |
|
83 | - 53 => 1, |
|
84 | - 55 => 1, |
|
85 | - 57 => 1, |
|
86 | - 64 => 1, |
|
87 | - 68 => 1, |
|
88 | - 71 => 1, |
|
89 | - ]; |
|
90 | - case 'GitMergeConflictUnitTest.5.inc': |
|
91 | - case 'GitMergeConflictUnitTest.6.inc': |
|
92 | - return [ |
|
93 | - 6 => 1, |
|
94 | - 8 => 1, |
|
95 | - 10 => 1, |
|
96 | - 15 => 1, |
|
97 | - 28 => 1, |
|
98 | - 30 => 1, |
|
99 | - 32 => 1, |
|
100 | - ]; |
|
101 | - |
|
102 | - case 'GitMergeConflictUnitTest.1.css': |
|
103 | - return [ |
|
104 | - 3 => 1, |
|
105 | - 5 => 1, |
|
106 | - 7 => 1, |
|
107 | - 12 => 1, |
|
108 | - 14 => 1, |
|
109 | - 16 => 1, |
|
110 | - 30 => 1, |
|
111 | - 32 => 1, |
|
112 | - 34 => 1, |
|
113 | - ]; |
|
114 | - |
|
115 | - case 'GitMergeConflictUnitTest.2.css': |
|
116 | - return [ |
|
117 | - 3 => 1, |
|
118 | - 8 => 1, |
|
119 | - 13 => 1, |
|
120 | - 27 => 1, |
|
121 | - 29 => 1, |
|
122 | - 31 => 1, |
|
123 | - ]; |
|
124 | - |
|
125 | - case 'GitMergeConflictUnitTest.js': |
|
126 | - return [ |
|
127 | - 5 => 1, |
|
128 | - 7 => 1, |
|
129 | - 9 => 1, |
|
130 | - 12 => 1, |
|
131 | - 14 => 1, |
|
132 | - 16 => 1, |
|
133 | - 24 => 1, |
|
134 | - 30 => 1, |
|
135 | - 32 => 1, |
|
136 | - ]; |
|
137 | - |
|
138 | - default: |
|
139 | - return []; |
|
140 | - }//end switch |
|
141 | - |
|
142 | - }//end getErrorList() |
|
143 | - |
|
144 | - |
|
145 | - /** |
|
146 | - * Returns the lines where warnings should occur. |
|
147 | - * |
|
148 | - * The key of the array should represent the line number and the value |
|
149 | - * should represent the number of warnings that should occur on that line. |
|
150 | - * |
|
151 | - * @return array<int, int> |
|
152 | - */ |
|
153 | - public function getWarningList() |
|
154 | - { |
|
155 | - return []; |
|
156 | - |
|
157 | - }//end getWarningList() |
|
18 | + /** |
|
19 | + * Returns the lines where errors should occur. |
|
20 | + * |
|
21 | + * The key of the array should represent the line number and the value |
|
22 | + * should represent the number of errors that should occur on that line. |
|
23 | + * |
|
24 | + * @param string $testFile The name of the file being tested. |
|
25 | + * |
|
26 | + * @return array<int, int> |
|
27 | + */ |
|
28 | + public function getErrorList($testFile='GitMergeConflictUnitTest.1.inc') |
|
29 | + { |
|
30 | + switch ($testFile) { |
|
31 | + case 'GitMergeConflictUnitTest.1.inc': |
|
32 | + return [ |
|
33 | + 26 => 1, |
|
34 | + 28 => 1, |
|
35 | + 30 => 1, |
|
36 | + 45 => 1, |
|
37 | + 53 => 1, |
|
38 | + 55 => 1, |
|
39 | + 59 => 1, |
|
40 | + 61 => 1, |
|
41 | + ]; |
|
42 | + |
|
43 | + case 'GitMergeConflictUnitTest.2.inc': |
|
44 | + return [ |
|
45 | + 4 => 1, |
|
46 | + 6 => 1, |
|
47 | + 8 => 1, |
|
48 | + 14 => 1, |
|
49 | + 20 => 1, |
|
50 | + 22 => 1, |
|
51 | + 26 => 1, |
|
52 | + 28 => 1, |
|
53 | + 30 => 1, |
|
54 | + ]; |
|
55 | + |
|
56 | + case 'GitMergeConflictUnitTest.3.inc': |
|
57 | + return [ |
|
58 | + 3 => 1, |
|
59 | + 5 => 1, |
|
60 | + 7 => 1, |
|
61 | + 12 => 1, |
|
62 | + 14 => 1, |
|
63 | + 16 => 1, |
|
64 | + 22 => 1, |
|
65 | + 24 => 1, |
|
66 | + 26 => 1, |
|
67 | + 38 => 1, |
|
68 | + 40 => 1, |
|
69 | + 42 => 1, |
|
70 | + ]; |
|
71 | + |
|
72 | + case 'GitMergeConflictUnitTest.4.inc': |
|
73 | + return [ |
|
74 | + 6 => 1, |
|
75 | + 8 => 1, |
|
76 | + 10 => 1, |
|
77 | + 18 => 1, |
|
78 | + 22 => 1, |
|
79 | + 25 => 1, |
|
80 | + 29 => 1, |
|
81 | + 34 => 1, |
|
82 | + 39 => 1, |
|
83 | + 53 => 1, |
|
84 | + 55 => 1, |
|
85 | + 57 => 1, |
|
86 | + 64 => 1, |
|
87 | + 68 => 1, |
|
88 | + 71 => 1, |
|
89 | + ]; |
|
90 | + case 'GitMergeConflictUnitTest.5.inc': |
|
91 | + case 'GitMergeConflictUnitTest.6.inc': |
|
92 | + return [ |
|
93 | + 6 => 1, |
|
94 | + 8 => 1, |
|
95 | + 10 => 1, |
|
96 | + 15 => 1, |
|
97 | + 28 => 1, |
|
98 | + 30 => 1, |
|
99 | + 32 => 1, |
|
100 | + ]; |
|
101 | + |
|
102 | + case 'GitMergeConflictUnitTest.1.css': |
|
103 | + return [ |
|
104 | + 3 => 1, |
|
105 | + 5 => 1, |
|
106 | + 7 => 1, |
|
107 | + 12 => 1, |
|
108 | + 14 => 1, |
|
109 | + 16 => 1, |
|
110 | + 30 => 1, |
|
111 | + 32 => 1, |
|
112 | + 34 => 1, |
|
113 | + ]; |
|
114 | + |
|
115 | + case 'GitMergeConflictUnitTest.2.css': |
|
116 | + return [ |
|
117 | + 3 => 1, |
|
118 | + 8 => 1, |
|
119 | + 13 => 1, |
|
120 | + 27 => 1, |
|
121 | + 29 => 1, |
|
122 | + 31 => 1, |
|
123 | + ]; |
|
124 | + |
|
125 | + case 'GitMergeConflictUnitTest.js': |
|
126 | + return [ |
|
127 | + 5 => 1, |
|
128 | + 7 => 1, |
|
129 | + 9 => 1, |
|
130 | + 12 => 1, |
|
131 | + 14 => 1, |
|
132 | + 16 => 1, |
|
133 | + 24 => 1, |
|
134 | + 30 => 1, |
|
135 | + 32 => 1, |
|
136 | + ]; |
|
137 | + |
|
138 | + default: |
|
139 | + return []; |
|
140 | + }//end switch |
|
141 | + |
|
142 | + }//end getErrorList() |
|
143 | + |
|
144 | + |
|
145 | + /** |
|
146 | + * Returns the lines where warnings should occur. |
|
147 | + * |
|
148 | + * The key of the array should represent the line number and the value |
|
149 | + * should represent the number of warnings that should occur on that line. |
|
150 | + * |
|
151 | + * @return array<int, int> |
|
152 | + */ |
|
153 | + public function getWarningList() |
|
154 | + { |
|
155 | + return []; |
|
156 | + |
|
157 | + }//end getWarningList() |
|
158 | 158 | |
159 | 159 | |
160 | 160 | }//end class |
@@ -22,13 +22,4 @@ |
||
22 | 22 | * merge conflict boundaries will still be detected correctly. |
23 | 23 | */ |
24 | 24 | |
25 | -$string = |
|
26 | - <<<"EOD" |
|
27 | - Merge conflicts in PHP 7.3 indented heredocs |
|
28 | -<<<<<<< HEAD |
|
29 | - can be problematic. |
|
30 | -======= |
|
31 | - should also be detected. |
|
32 | ->>>>>>> ref/heads/other-branchname |
|
33 | - And now they are. |
|
34 | - EOD; |
|
25 | +$string |
|
35 | 26 | \ No newline at end of file |
@@ -24,8 +24,3 @@ |
||
24 | 24 | |
25 | 25 | // Comment |
26 | 26 | <<<<<<< HEAD |
27 | -// Second comment line. NOTE: The above opener breaks the tokenizer. |
|
28 | -======= |
|
29 | -// New second comment line |
|
30 | ->>>>>>> master |
|
31 | -// Third comment line |
@@ -22,13 +22,4 @@ |
||
22 | 22 | * merge conflict boundaries will still be detected correctly. |
23 | 23 | */ |
24 | 24 | |
25 | -$string = |
|
26 | -<<<'EOD' |
|
27 | -can be problematic. |
|
28 | -<<<<<<< HEAD |
|
29 | -were previously not detected. |
|
30 | -======= |
|
31 | -should also be detected. |
|
32 | ->>>>>>> ref/heads/other-branchname |
|
33 | -And now they are. |
|
34 | -EOD; |
|
25 | +$string |
|
35 | 26 | \ No newline at end of file |
@@ -15,47 +15,47 @@ |
||
15 | 15 | { |
16 | 16 | |
17 | 17 | |
18 | - /** |
|
19 | - * Should this test be skipped for some reason. |
|
20 | - * |
|
21 | - * @return void |
|
22 | - */ |
|
23 | - protected function shouldSkipTest() |
|
24 | - { |
|
25 | - // This sniff cannot be tested as no SVN version control directory is available. |
|
26 | - return true; |
|
27 | - |
|
28 | - }//end shouldSkipTest() |
|
29 | - |
|
30 | - |
|
31 | - /** |
|
32 | - * Returns the lines where errors should occur. |
|
33 | - * |
|
34 | - * The key of the array should represent the line number and the value |
|
35 | - * should represent the number of errors that should occur on that line. |
|
36 | - * |
|
37 | - * @return array<int, int> |
|
38 | - */ |
|
39 | - public function getErrorList() |
|
40 | - { |
|
41 | - return []; |
|
42 | - |
|
43 | - }//end getErrorList() |
|
44 | - |
|
45 | - |
|
46 | - /** |
|
47 | - * Returns the lines where warnings should occur. |
|
48 | - * |
|
49 | - * The key of the array should represent the line number and the value |
|
50 | - * should represent the number of warnings that should occur on that line. |
|
51 | - * |
|
52 | - * @return array<int, int> |
|
53 | - */ |
|
54 | - public function getWarningList() |
|
55 | - { |
|
56 | - return []; |
|
57 | - |
|
58 | - }//end getWarningList() |
|
18 | + /** |
|
19 | + * Should this test be skipped for some reason. |
|
20 | + * |
|
21 | + * @return void |
|
22 | + */ |
|
23 | + protected function shouldSkipTest() |
|
24 | + { |
|
25 | + // This sniff cannot be tested as no SVN version control directory is available. |
|
26 | + return true; |
|
27 | + |
|
28 | + }//end shouldSkipTest() |
|
29 | + |
|
30 | + |
|
31 | + /** |
|
32 | + * Returns the lines where errors should occur. |
|
33 | + * |
|
34 | + * The key of the array should represent the line number and the value |
|
35 | + * should represent the number of errors that should occur on that line. |
|
36 | + * |
|
37 | + * @return array<int, int> |
|
38 | + */ |
|
39 | + public function getErrorList() |
|
40 | + { |
|
41 | + return []; |
|
42 | + |
|
43 | + }//end getErrorList() |
|
44 | + |
|
45 | + |
|
46 | + /** |
|
47 | + * Returns the lines where warnings should occur. |
|
48 | + * |
|
49 | + * The key of the array should represent the line number and the value |
|
50 | + * should represent the number of warnings that should occur on that line. |
|
51 | + * |
|
52 | + * @return array<int, int> |
|
53 | + */ |
|
54 | + public function getWarningList() |
|
55 | + { |
|
56 | + return []; |
|
57 | + |
|
58 | + }//end getWarningList() |
|
59 | 59 | |
60 | 60 | |
61 | 61 | }//end class |
@@ -20,9 +20,9 @@ discard block |
||
20 | 20 | */ |
21 | 21 | |
22 | 22 | function test() |
23 | - { |
|
24 | - $arr = array( |
|
25 | - 'a' => 'a' |
|
23 | + { |
|
24 | + $arr = array( |
|
25 | + 'a' => 'a' |
|
26 | 26 | <<<<<<< HEAD |
27 | 27 | 'b' => 'b' |
28 | 28 | ======= |
@@ -57,5 +57,4 @@ discard block |
||
57 | 57 | |
58 | 58 | // Test that stray boundaries, i.e. an opener without closer and such, are detected. |
59 | 59 | <<<<<<< HEAD |
60 | -$a = 1; |
|
61 | -======= |
|
60 | +$a |
|
62 | 61 | \ No newline at end of file |