Skip to content

Commit 2cb08fd

Browse files
authored
Merge pull request #550 from biinari/chore/143-PEAR_ValidDefaultValue_separate_parse_error
PEAR/ValidDefaultValue: move syntax error to its own file
2 parents 071344b + 5ef1105 commit 2cb08fd

File tree

3 files changed

+29
-17
lines changed

3 files changed

+29
-17
lines changed

src/Standards/PEAR/Tests/Functions/ValidDefaultValueUnitTest.inc renamed to src/Standards/PEAR/Tests/Functions/ValidDefaultValueUnitTest.1.inc

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,3 @@ class ConstructorPropertyPromotionMixedWithNormalParams {
114114
mixed $requiredParam,
115115
) {}
116116
}
117-
118-
// Intentional syntax error. Must be last thing in the file.
119-
function
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
<?php
2+
3+
// Intentional syntax error.
4+
// This should be the only test in this file.
5+
// Testing that the sniff is *not* triggered.
6+
7+
function

src/Standards/PEAR/Tests/Functions/ValidDefaultValueUnitTest.php

Lines changed: 22 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -26,23 +26,31 @@ final class ValidDefaultValueUnitTest extends AbstractSniffUnitTest
2626
* The key of the array should represent the line number and the value
2727
* should represent the number of errors that should occur on that line.
2828
*
29+
* @param string $testFile The name of the file being tested.
30+
*
2931
* @return array<int, int>
3032
*/
31-
public function getErrorList()
33+
public function getErrorList($testFile='')
3234
{
33-
return [
34-
29 => 1,
35-
34 => 1,
36-
39 => 1,
37-
71 => 1,
38-
76 => 1,
39-
81 => 1,
40-
91 => 1,
41-
99 => 1,
42-
101 => 1,
43-
106 => 1,
44-
114 => 1,
45-
];
35+
switch ($testFile) {
36+
case 'ValidDefaultValueUnitTest.1.inc':
37+
return [
38+
29 => 1,
39+
34 => 1,
40+
39 => 1,
41+
71 => 1,
42+
76 => 1,
43+
81 => 1,
44+
91 => 1,
45+
99 => 1,
46+
101 => 1,
47+
106 => 1,
48+
114 => 1,
49+
];
50+
51+
default:
52+
return [];
53+
}
4654

4755
}//end getErrorList()
4856

0 commit comments

Comments
 (0)