@@ -25,7 +25,7 @@ |
||
25 | 25 | * |
26 | 26 | * @return array<int, int> |
27 | 27 | */ |
28 | - public function getErrorList($testFile='LowerCaseConstantUnitTest.inc') |
|
28 | + public function getErrorList($testFile = 'LowerCaseConstantUnitTest.inc') |
|
29 | 29 | { |
30 | 30 | switch ($testFile) { |
31 | 31 | case 'LowerCaseConstantUnitTest.inc': |
@@ -15,77 +15,77 @@ |
||
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='LowerCaseConstantUnitTest.inc') |
|
29 | - { |
|
30 | - switch ($testFile) { |
|
31 | - case 'LowerCaseConstantUnitTest.inc': |
|
32 | - return [ |
|
33 | - 7 => 1, |
|
34 | - 10 => 1, |
|
35 | - 15 => 1, |
|
36 | - 16 => 1, |
|
37 | - 23 => 1, |
|
38 | - 26 => 1, |
|
39 | - 31 => 1, |
|
40 | - 32 => 1, |
|
41 | - 39 => 1, |
|
42 | - 42 => 1, |
|
43 | - 47 => 1, |
|
44 | - 48 => 1, |
|
45 | - 70 => 1, |
|
46 | - 71 => 1, |
|
47 | - 87 => 1, |
|
48 | - 89 => 1, |
|
49 | - 90 => 1, |
|
50 | - 92 => 2, |
|
51 | - 94 => 2, |
|
52 | - 95 => 1, |
|
53 | - 100 => 2, |
|
54 | - ]; |
|
55 | - break; |
|
56 | - case 'LowerCaseConstantUnitTest.js': |
|
57 | - return [ |
|
58 | - 2 => 1, |
|
59 | - 3 => 1, |
|
60 | - 4 => 1, |
|
61 | - 7 => 1, |
|
62 | - 8 => 1, |
|
63 | - 12 => 1, |
|
64 | - 13 => 1, |
|
65 | - 14 => 1, |
|
66 | - ]; |
|
67 | - break; |
|
68 | - default: |
|
69 | - return []; |
|
70 | - break; |
|
71 | - }//end switch |
|
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='LowerCaseConstantUnitTest.inc') |
|
29 | + { |
|
30 | + switch ($testFile) { |
|
31 | + case 'LowerCaseConstantUnitTest.inc': |
|
32 | + return [ |
|
33 | + 7 => 1, |
|
34 | + 10 => 1, |
|
35 | + 15 => 1, |
|
36 | + 16 => 1, |
|
37 | + 23 => 1, |
|
38 | + 26 => 1, |
|
39 | + 31 => 1, |
|
40 | + 32 => 1, |
|
41 | + 39 => 1, |
|
42 | + 42 => 1, |
|
43 | + 47 => 1, |
|
44 | + 48 => 1, |
|
45 | + 70 => 1, |
|
46 | + 71 => 1, |
|
47 | + 87 => 1, |
|
48 | + 89 => 1, |
|
49 | + 90 => 1, |
|
50 | + 92 => 2, |
|
51 | + 94 => 2, |
|
52 | + 95 => 1, |
|
53 | + 100 => 2, |
|
54 | + ]; |
|
55 | + break; |
|
56 | + case 'LowerCaseConstantUnitTest.js': |
|
57 | + return [ |
|
58 | + 2 => 1, |
|
59 | + 3 => 1, |
|
60 | + 4 => 1, |
|
61 | + 7 => 1, |
|
62 | + 8 => 1, |
|
63 | + 12 => 1, |
|
64 | + 13 => 1, |
|
65 | + 14 => 1, |
|
66 | + ]; |
|
67 | + break; |
|
68 | + default: |
|
69 | + return []; |
|
70 | + break; |
|
71 | + }//end switch |
|
72 | 72 | |
73 | - }//end getErrorList() |
|
73 | + }//end getErrorList() |
|
74 | 74 | |
75 | 75 | |
76 | - /** |
|
77 | - * Returns the lines where warnings should occur. |
|
78 | - * |
|
79 | - * The key of the array should represent the line number and the value |
|
80 | - * should represent the number of warnings that should occur on that line. |
|
81 | - * |
|
82 | - * @return array<int, int> |
|
83 | - */ |
|
84 | - public function getWarningList() |
|
85 | - { |
|
86 | - return []; |
|
76 | + /** |
|
77 | + * Returns the lines where warnings should occur. |
|
78 | + * |
|
79 | + * The key of the array should represent the line number and the value |
|
80 | + * should represent the number of warnings that should occur on that line. |
|
81 | + * |
|
82 | + * @return array<int, int> |
|
83 | + */ |
|
84 | + public function getWarningList() |
|
85 | + { |
|
86 | + return []; |
|
87 | 87 | |
88 | - }//end getWarningList() |
|
88 | + }//end getWarningList() |
|
89 | 89 | |
90 | 90 | |
91 | 91 | }//end class |
@@ -28,46 +28,46 @@ |
||
28 | 28 | public function getErrorList($testFile='LowerCaseConstantUnitTest.inc') |
29 | 29 | { |
30 | 30 | switch ($testFile) { |
31 | - case 'LowerCaseConstantUnitTest.inc': |
|
32 | - return [ |
|
33 | - 7 => 1, |
|
34 | - 10 => 1, |
|
35 | - 15 => 1, |
|
36 | - 16 => 1, |
|
37 | - 23 => 1, |
|
38 | - 26 => 1, |
|
39 | - 31 => 1, |
|
40 | - 32 => 1, |
|
41 | - 39 => 1, |
|
42 | - 42 => 1, |
|
43 | - 47 => 1, |
|
44 | - 48 => 1, |
|
45 | - 70 => 1, |
|
46 | - 71 => 1, |
|
47 | - 87 => 1, |
|
48 | - 89 => 1, |
|
49 | - 90 => 1, |
|
50 | - 92 => 2, |
|
51 | - 94 => 2, |
|
52 | - 95 => 1, |
|
53 | - 100 => 2, |
|
54 | - ]; |
|
55 | - break; |
|
56 | - case 'LowerCaseConstantUnitTest.js': |
|
57 | - return [ |
|
58 | - 2 => 1, |
|
59 | - 3 => 1, |
|
60 | - 4 => 1, |
|
61 | - 7 => 1, |
|
62 | - 8 => 1, |
|
63 | - 12 => 1, |
|
64 | - 13 => 1, |
|
65 | - 14 => 1, |
|
66 | - ]; |
|
67 | - break; |
|
68 | - default: |
|
69 | - return []; |
|
70 | - break; |
|
31 | + case 'LowerCaseConstantUnitTest.inc': |
|
32 | + return [ |
|
33 | + 7 => 1, |
|
34 | + 10 => 1, |
|
35 | + 15 => 1, |
|
36 | + 16 => 1, |
|
37 | + 23 => 1, |
|
38 | + 26 => 1, |
|
39 | + 31 => 1, |
|
40 | + 32 => 1, |
|
41 | + 39 => 1, |
|
42 | + 42 => 1, |
|
43 | + 47 => 1, |
|
44 | + 48 => 1, |
|
45 | + 70 => 1, |
|
46 | + 71 => 1, |
|
47 | + 87 => 1, |
|
48 | + 89 => 1, |
|
49 | + 90 => 1, |
|
50 | + 92 => 2, |
|
51 | + 94 => 2, |
|
52 | + 95 => 1, |
|
53 | + 100 => 2, |
|
54 | + ]; |
|
55 | + break; |
|
56 | + case 'LowerCaseConstantUnitTest.js': |
|
57 | + return [ |
|
58 | + 2 => 1, |
|
59 | + 3 => 1, |
|
60 | + 4 => 1, |
|
61 | + 7 => 1, |
|
62 | + 8 => 1, |
|
63 | + 12 => 1, |
|
64 | + 13 => 1, |
|
65 | + 14 => 1, |
|
66 | + ]; |
|
67 | + break; |
|
68 | + default: |
|
69 | + return []; |
|
70 | + break; |
|
71 | 71 | }//end switch |
72 | 72 | |
73 | 73 | }//end getErrorList() |
@@ -48,7 +48,7 @@ discard block |
||
48 | 48 | * |
49 | 49 | * @return array<int, int> |
50 | 50 | */ |
51 | - public function getErrorList($testFile='') |
|
51 | + public function getErrorList($testFile = '') |
|
52 | 52 | { |
53 | 53 | switch ($testFile) { |
54 | 54 | case 'DisallowShortOpenTagUnitTest.1.inc': |
@@ -89,7 +89,7 @@ discard block |
||
89 | 89 | * |
90 | 90 | * @return array<int, int> |
91 | 91 | */ |
92 | - public function getWarningList($testFile='') |
|
92 | + public function getWarningList($testFile = '') |
|
93 | 93 | { |
94 | 94 | switch ($testFile) { |
95 | 95 | case 'DisallowShortOpenTagUnitTest.1.inc': |
@@ -15,89 +15,89 @@ |
||
15 | 15 | { |
16 | 16 | |
17 | 17 | |
18 | - /** |
|
19 | - * Get a list of all test files to check. |
|
20 | - * |
|
21 | - * @param string $testFileBase The base path that the unit tests files will have. |
|
22 | - * |
|
23 | - * @return string[] |
|
24 | - */ |
|
25 | - protected function getTestFiles($testFileBase) |
|
26 | - { |
|
27 | - $testFiles = [$testFileBase.'1.inc']; |
|
28 | - |
|
29 | - $option = (bool) ini_get('short_open_tag'); |
|
30 | - if ($option === true) { |
|
31 | - $testFiles[] = $testFileBase.'2.inc'; |
|
32 | - } else { |
|
33 | - $testFiles[] = $testFileBase.'3.inc'; |
|
34 | - } |
|
35 | - |
|
36 | - return $testFiles; |
|
37 | - |
|
38 | - }//end getTestFiles() |
|
39 | - |
|
40 | - |
|
41 | - /** |
|
42 | - * Returns the lines where errors should occur. |
|
43 | - * |
|
44 | - * The key of the array should represent the line number and the value |
|
45 | - * should represent the number of errors that should occur on that line. |
|
46 | - * |
|
47 | - * @param string $testFile The name of the file being tested. |
|
48 | - * |
|
49 | - * @return array<int, int> |
|
50 | - */ |
|
51 | - public function getErrorList($testFile='') |
|
52 | - { |
|
53 | - switch ($testFile) { |
|
54 | - case 'DisallowShortOpenTagUnitTest.1.inc': |
|
55 | - return [ |
|
56 | - 5 => 1, |
|
57 | - 6 => 1, |
|
58 | - 7 => 1, |
|
59 | - 10 => 1, |
|
60 | - ]; |
|
61 | - case 'DisallowShortOpenTagUnitTest.2.inc': |
|
62 | - return [ |
|
63 | - 2 => 1, |
|
64 | - 3 => 1, |
|
65 | - 4 => 1, |
|
66 | - 7 => 1, |
|
67 | - ]; |
|
68 | - default: |
|
69 | - return []; |
|
70 | - }//end switch |
|
71 | - |
|
72 | - }//end getErrorList() |
|
73 | - |
|
74 | - |
|
75 | - /** |
|
76 | - * Returns the lines where warnings should occur. |
|
77 | - * |
|
78 | - * The key of the array should represent the line number and the value |
|
79 | - * should represent the number of warnings that should occur on that line. |
|
80 | - * |
|
81 | - * @param string $testFile The name of the file being tested. |
|
82 | - * |
|
83 | - * @return array<int, int> |
|
84 | - */ |
|
85 | - public function getWarningList($testFile='') |
|
86 | - { |
|
87 | - switch ($testFile) { |
|
88 | - case 'DisallowShortOpenTagUnitTest.1.inc': |
|
89 | - return []; |
|
90 | - case 'DisallowShortOpenTagUnitTest.3.inc': |
|
91 | - return [ |
|
92 | - 3 => 1, |
|
93 | - 6 => 1, |
|
94 | - 11 => 1, |
|
95 | - ]; |
|
96 | - default: |
|
97 | - return []; |
|
98 | - }//end switch |
|
99 | - |
|
100 | - }//end getWarningList() |
|
18 | + /** |
|
19 | + * Get a list of all test files to check. |
|
20 | + * |
|
21 | + * @param string $testFileBase The base path that the unit tests files will have. |
|
22 | + * |
|
23 | + * @return string[] |
|
24 | + */ |
|
25 | + protected function getTestFiles($testFileBase) |
|
26 | + { |
|
27 | + $testFiles = [$testFileBase.'1.inc']; |
|
28 | + |
|
29 | + $option = (bool) ini_get('short_open_tag'); |
|
30 | + if ($option === true) { |
|
31 | + $testFiles[] = $testFileBase.'2.inc'; |
|
32 | + } else { |
|
33 | + $testFiles[] = $testFileBase.'3.inc'; |
|
34 | + } |
|
35 | + |
|
36 | + return $testFiles; |
|
37 | + |
|
38 | + }//end getTestFiles() |
|
39 | + |
|
40 | + |
|
41 | + /** |
|
42 | + * Returns the lines where errors should occur. |
|
43 | + * |
|
44 | + * The key of the array should represent the line number and the value |
|
45 | + * should represent the number of errors that should occur on that line. |
|
46 | + * |
|
47 | + * @param string $testFile The name of the file being tested. |
|
48 | + * |
|
49 | + * @return array<int, int> |
|
50 | + */ |
|
51 | + public function getErrorList($testFile='') |
|
52 | + { |
|
53 | + switch ($testFile) { |
|
54 | + case 'DisallowShortOpenTagUnitTest.1.inc': |
|
55 | + return [ |
|
56 | + 5 => 1, |
|
57 | + 6 => 1, |
|
58 | + 7 => 1, |
|
59 | + 10 => 1, |
|
60 | + ]; |
|
61 | + case 'DisallowShortOpenTagUnitTest.2.inc': |
|
62 | + return [ |
|
63 | + 2 => 1, |
|
64 | + 3 => 1, |
|
65 | + 4 => 1, |
|
66 | + 7 => 1, |
|
67 | + ]; |
|
68 | + default: |
|
69 | + return []; |
|
70 | + }//end switch |
|
71 | + |
|
72 | + }//end getErrorList() |
|
73 | + |
|
74 | + |
|
75 | + /** |
|
76 | + * Returns the lines where warnings should occur. |
|
77 | + * |
|
78 | + * The key of the array should represent the line number and the value |
|
79 | + * should represent the number of warnings that should occur on that line. |
|
80 | + * |
|
81 | + * @param string $testFile The name of the file being tested. |
|
82 | + * |
|
83 | + * @return array<int, int> |
|
84 | + */ |
|
85 | + public function getWarningList($testFile='') |
|
86 | + { |
|
87 | + switch ($testFile) { |
|
88 | + case 'DisallowShortOpenTagUnitTest.1.inc': |
|
89 | + return []; |
|
90 | + case 'DisallowShortOpenTagUnitTest.3.inc': |
|
91 | + return [ |
|
92 | + 3 => 1, |
|
93 | + 6 => 1, |
|
94 | + 11 => 1, |
|
95 | + ]; |
|
96 | + default: |
|
97 | + return []; |
|
98 | + }//end switch |
|
99 | + |
|
100 | + }//end getWarningList() |
|
101 | 101 | |
102 | 102 | |
103 | 103 | }//end class |
@@ -51,22 +51,22 @@ discard block |
||
51 | 51 | public function getErrorList($testFile='') |
52 | 52 | { |
53 | 53 | switch ($testFile) { |
54 | - case 'DisallowShortOpenTagUnitTest.1.inc': |
|
55 | - return [ |
|
56 | - 5 => 1, |
|
57 | - 6 => 1, |
|
58 | - 7 => 1, |
|
59 | - 10 => 1, |
|
60 | - ]; |
|
61 | - case 'DisallowShortOpenTagUnitTest.2.inc': |
|
62 | - return [ |
|
63 | - 2 => 1, |
|
64 | - 3 => 1, |
|
65 | - 4 => 1, |
|
66 | - 7 => 1, |
|
67 | - ]; |
|
68 | - default: |
|
69 | - return []; |
|
54 | + case 'DisallowShortOpenTagUnitTest.1.inc': |
|
55 | + return [ |
|
56 | + 5 => 1, |
|
57 | + 6 => 1, |
|
58 | + 7 => 1, |
|
59 | + 10 => 1, |
|
60 | + ]; |
|
61 | + case 'DisallowShortOpenTagUnitTest.2.inc': |
|
62 | + return [ |
|
63 | + 2 => 1, |
|
64 | + 3 => 1, |
|
65 | + 4 => 1, |
|
66 | + 7 => 1, |
|
67 | + ]; |
|
68 | + default: |
|
69 | + return []; |
|
70 | 70 | }//end switch |
71 | 71 | |
72 | 72 | }//end getErrorList() |
@@ -85,16 +85,16 @@ discard block |
||
85 | 85 | public function getWarningList($testFile='') |
86 | 86 | { |
87 | 87 | switch ($testFile) { |
88 | - case 'DisallowShortOpenTagUnitTest.1.inc': |
|
89 | - return []; |
|
90 | - case 'DisallowShortOpenTagUnitTest.3.inc': |
|
91 | - return [ |
|
92 | - 3 => 1, |
|
93 | - 6 => 1, |
|
94 | - 11 => 1, |
|
95 | - ]; |
|
96 | - default: |
|
97 | - return []; |
|
88 | + case 'DisallowShortOpenTagUnitTest.1.inc': |
|
89 | + return []; |
|
90 | + case 'DisallowShortOpenTagUnitTest.3.inc': |
|
91 | + return [ |
|
92 | + 3 => 1, |
|
93 | + 6 => 1, |
|
94 | + 11 => 1, |
|
95 | + ]; |
|
96 | + default: |
|
97 | + return []; |
|
98 | 98 | }//end switch |
99 | 99 | |
100 | 100 | }//end getWarningList() |
@@ -4,7 +4,7 @@ |
||
4 | 4 | delete($filepath); |
5 | 5 | unset($filepath); |
6 | 6 | $size = \sizeof($array); |
7 | -$size = \my\ns\sizeof('abc');($array); |
|
7 | +$size = \my\ns\sizeof('abc'); ($array); |
|
8 | 8 | |
9 | 9 | // No errors thrown for class methods. |
10 | 10 | $size = MyClass::sizeof($array); |
@@ -24,27 +24,27 @@ |
||
24 | 24 | |
25 | 25 | trait DelProvider { |
26 | 26 | public function delete() { |
27 | - //irrelevant |
|
27 | + //irrelevant |
|
28 | 28 | } |
29 | 29 | } |
30 | 30 | |
31 | 31 | class LeftSideTest { |
32 | - use DelProvider { |
|
33 | - delete as protected unsetter; |
|
34 | - } |
|
32 | + use DelProvider { |
|
33 | + delete as protected unsetter; |
|
34 | + } |
|
35 | 35 | } |
36 | 36 | |
37 | 37 | class RightSideTest { |
38 | - use DelProvider { |
|
39 | - delete as delete; |
|
40 | - } |
|
38 | + use DelProvider { |
|
39 | + delete as delete; |
|
40 | + } |
|
41 | 41 | } |
42 | 42 | |
43 | 43 | class RightSideVisTest { |
44 | - use DelProvider { |
|
45 | - delete as protected delete; |
|
46 | - DelProvider::delete insteadof delete; |
|
47 | - } |
|
44 | + use DelProvider { |
|
45 | + delete as protected delete; |
|
46 | + DelProvider::delete insteadof delete; |
|
47 | + } |
|
48 | 48 | } |
49 | 49 | |
50 | 50 | namespace Something\sizeof; |
@@ -67,22 +67,22 @@ |
||
67 | 67 | public function getErrorList($testFile='') |
68 | 68 | { |
69 | 69 | switch ($testFile) { |
70 | - case 'DisallowAlternativePHPTagsUnitTest.1.inc': |
|
71 | - return [ |
|
72 | - 4 => 1, |
|
73 | - 7 => 1, |
|
74 | - 8 => 1, |
|
75 | - 11 => 1, |
|
76 | - ]; |
|
77 | - case 'DisallowAlternativePHPTagsUnitTest.2.inc': |
|
78 | - return [ |
|
79 | - 2 => 1, |
|
80 | - 3 => 1, |
|
81 | - 4 => 1, |
|
82 | - 5 => 1, |
|
83 | - ]; |
|
84 | - default: |
|
85 | - return []; |
|
70 | + case 'DisallowAlternativePHPTagsUnitTest.1.inc': |
|
71 | + return [ |
|
72 | + 4 => 1, |
|
73 | + 7 => 1, |
|
74 | + 8 => 1, |
|
75 | + 11 => 1, |
|
76 | + ]; |
|
77 | + case 'DisallowAlternativePHPTagsUnitTest.2.inc': |
|
78 | + return [ |
|
79 | + 2 => 1, |
|
80 | + 3 => 1, |
|
81 | + 4 => 1, |
|
82 | + 5 => 1, |
|
83 | + ]; |
|
84 | + default: |
|
85 | + return []; |
|
86 | 86 | }//end switch |
87 | 87 | |
88 | 88 | }//end getErrorList() |
@@ -64,7 +64,7 @@ discard block |
||
64 | 64 | * |
65 | 65 | * @return array<int, int> |
66 | 66 | */ |
67 | - public function getErrorList($testFile='') |
|
67 | + public function getErrorList($testFile = '') |
|
68 | 68 | { |
69 | 69 | switch ($testFile) { |
70 | 70 | case 'DisallowAlternativePHPTagsUnitTest.1.inc': |
@@ -98,7 +98,7 @@ discard block |
||
98 | 98 | * |
99 | 99 | * @return array<int, int> |
100 | 100 | */ |
101 | - public function getWarningList($testFile='') |
|
101 | + public function getWarningList($testFile = '') |
|
102 | 102 | { |
103 | 103 | if ($testFile === 'DisallowAlternativePHPTagsUnitTest.3.inc') { |
104 | 104 | return [ |
@@ -15,91 +15,91 @@ |
||
15 | 15 | { |
16 | 16 | |
17 | 17 | |
18 | - /** |
|
19 | - * Get a list of all test files to check. |
|
20 | - * |
|
21 | - * @param string $testFileBase The base path that the unit tests files will have. |
|
22 | - * |
|
23 | - * @return string[] |
|
24 | - */ |
|
25 | - protected function getTestFiles($testFileBase) |
|
26 | - { |
|
27 | - $testFiles = [$testFileBase.'1.inc']; |
|
28 | - |
|
29 | - $aspTags = false; |
|
30 | - if (PHP_VERSION_ID < 70000) { |
|
31 | - $aspTags = (bool) ini_get('asp_tags'); |
|
32 | - } |
|
33 | - |
|
34 | - if ($aspTags === true) { |
|
35 | - $testFiles[] = $testFileBase.'2.inc'; |
|
36 | - } else { |
|
37 | - $testFiles[] = $testFileBase.'3.inc'; |
|
38 | - } |
|
39 | - |
|
40 | - return $testFiles; |
|
41 | - |
|
42 | - }//end getTestFiles() |
|
43 | - |
|
44 | - |
|
45 | - /** |
|
46 | - * Returns the lines where errors should occur. |
|
47 | - * |
|
48 | - * The key of the array should represent the line number and the value |
|
49 | - * should represent the number of errors that should occur on that line. |
|
50 | - * |
|
51 | - * @param string $testFile The name of the file being tested. |
|
52 | - * |
|
53 | - * @return array<int, int> |
|
54 | - */ |
|
55 | - public function getErrorList($testFile='') |
|
56 | - { |
|
57 | - switch ($testFile) { |
|
58 | - case 'DisallowAlternativePHPTagsUnitTest.1.inc': |
|
59 | - return [ |
|
60 | - 4 => 1, |
|
61 | - 7 => 1, |
|
62 | - 8 => 1, |
|
63 | - 11 => 1, |
|
64 | - ]; |
|
65 | - case 'DisallowAlternativePHPTagsUnitTest.2.inc': |
|
66 | - return [ |
|
67 | - 2 => 1, |
|
68 | - 3 => 1, |
|
69 | - 4 => 1, |
|
70 | - 5 => 1, |
|
71 | - ]; |
|
72 | - default: |
|
73 | - return []; |
|
74 | - }//end switch |
|
75 | - |
|
76 | - }//end getErrorList() |
|
77 | - |
|
78 | - |
|
79 | - /** |
|
80 | - * Returns the lines where warnings should occur. |
|
81 | - * |
|
82 | - * The key of the array should represent the line number and the value |
|
83 | - * should represent the number of warnings that should occur on that line. |
|
84 | - * |
|
85 | - * @param string $testFile The name of the file being tested. |
|
86 | - * |
|
87 | - * @return array<int, int> |
|
88 | - */ |
|
89 | - public function getWarningList($testFile='') |
|
90 | - { |
|
91 | - if ($testFile === 'DisallowAlternativePHPTagsUnitTest.3.inc') { |
|
92 | - return [ |
|
93 | - 3 => 1, |
|
94 | - 4 => 1, |
|
95 | - 5 => 1, |
|
96 | - 6 => 1, |
|
97 | - ]; |
|
98 | - } |
|
99 | - |
|
100 | - return []; |
|
101 | - |
|
102 | - }//end getWarningList() |
|
18 | + /** |
|
19 | + * Get a list of all test files to check. |
|
20 | + * |
|
21 | + * @param string $testFileBase The base path that the unit tests files will have. |
|
22 | + * |
|
23 | + * @return string[] |
|
24 | + */ |
|
25 | + protected function getTestFiles($testFileBase) |
|
26 | + { |
|
27 | + $testFiles = [$testFileBase.'1.inc']; |
|
28 | + |
|
29 | + $aspTags = false; |
|
30 | + if (PHP_VERSION_ID < 70000) { |
|
31 | + $aspTags = (bool) ini_get('asp_tags'); |
|
32 | + } |
|
33 | + |
|
34 | + if ($aspTags === true) { |
|
35 | + $testFiles[] = $testFileBase.'2.inc'; |
|
36 | + } else { |
|
37 | + $testFiles[] = $testFileBase.'3.inc'; |
|
38 | + } |
|
39 | + |
|
40 | + return $testFiles; |
|
41 | + |
|
42 | + }//end getTestFiles() |
|
43 | + |
|
44 | + |
|
45 | + /** |
|
46 | + * Returns the lines where errors should occur. |
|
47 | + * |
|
48 | + * The key of the array should represent the line number and the value |
|
49 | + * should represent the number of errors that should occur on that line. |
|
50 | + * |
|
51 | + * @param string $testFile The name of the file being tested. |
|
52 | + * |
|
53 | + * @return array<int, int> |
|
54 | + */ |
|
55 | + public function getErrorList($testFile='') |
|
56 | + { |
|
57 | + switch ($testFile) { |
|
58 | + case 'DisallowAlternativePHPTagsUnitTest.1.inc': |
|
59 | + return [ |
|
60 | + 4 => 1, |
|
61 | + 7 => 1, |
|
62 | + 8 => 1, |
|
63 | + 11 => 1, |
|
64 | + ]; |
|
65 | + case 'DisallowAlternativePHPTagsUnitTest.2.inc': |
|
66 | + return [ |
|
67 | + 2 => 1, |
|
68 | + 3 => 1, |
|
69 | + 4 => 1, |
|
70 | + 5 => 1, |
|
71 | + ]; |
|
72 | + default: |
|
73 | + return []; |
|
74 | + }//end switch |
|
75 | + |
|
76 | + }//end getErrorList() |
|
77 | + |
|
78 | + |
|
79 | + /** |
|
80 | + * Returns the lines where warnings should occur. |
|
81 | + * |
|
82 | + * The key of the array should represent the line number and the value |
|
83 | + * should represent the number of warnings that should occur on that line. |
|
84 | + * |
|
85 | + * @param string $testFile The name of the file being tested. |
|
86 | + * |
|
87 | + * @return array<int, int> |
|
88 | + */ |
|
89 | + public function getWarningList($testFile='') |
|
90 | + { |
|
91 | + if ($testFile === 'DisallowAlternativePHPTagsUnitTest.3.inc') { |
|
92 | + return [ |
|
93 | + 3 => 1, |
|
94 | + 4 => 1, |
|
95 | + 5 => 1, |
|
96 | + 6 => 1, |
|
97 | + ]; |
|
98 | + } |
|
99 | + |
|
100 | + return []; |
|
101 | + |
|
102 | + }//end getWarningList() |
|
103 | 103 | |
104 | 104 | |
105 | 105 | }//end class |
@@ -15,39 +15,39 @@ |
||
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 | - * @return array<int, int> |
|
25 | - */ |
|
26 | - public function getErrorList() |
|
27 | - { |
|
28 | - return []; |
|
29 | - |
|
30 | - }//end getErrorList() |
|
31 | - |
|
32 | - |
|
33 | - /** |
|
34 | - * Returns the lines where warnings should occur. |
|
35 | - * |
|
36 | - * The key of the array should represent the line number and the value |
|
37 | - * should represent the number of warnings that should occur on that line. |
|
38 | - * |
|
39 | - * @return array<int, int> |
|
40 | - */ |
|
41 | - public function getWarningList() |
|
42 | - { |
|
43 | - return [ |
|
44 | - 3 => 1, |
|
45 | - 6 => 1, |
|
46 | - 11 => 1, |
|
47 | - 16 => 1, |
|
48 | - ]; |
|
49 | - |
|
50 | - }//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 | + * @return array<int, int> |
|
25 | + */ |
|
26 | + public function getErrorList() |
|
27 | + { |
|
28 | + return []; |
|
29 | + |
|
30 | + }//end getErrorList() |
|
31 | + |
|
32 | + |
|
33 | + /** |
|
34 | + * Returns the lines where warnings should occur. |
|
35 | + * |
|
36 | + * The key of the array should represent the line number and the value |
|
37 | + * should represent the number of warnings that should occur on that line. |
|
38 | + * |
|
39 | + * @return array<int, int> |
|
40 | + */ |
|
41 | + public function getWarningList() |
|
42 | + { |
|
43 | + return [ |
|
44 | + 3 => 1, |
|
45 | + 6 => 1, |
|
46 | + 11 => 1, |
|
47 | + 16 => 1, |
|
48 | + ]; |
|
49 | + |
|
50 | + }//end getWarningList() |
|
51 | 51 | |
52 | 52 | |
53 | 53 | }//end class |
@@ -15,34 +15,34 @@ |
||
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 | - * @return array<int, int> |
|
25 | - */ |
|
26 | - public function getErrorList() |
|
27 | - { |
|
28 | - return [2 => 1]; |
|
29 | - |
|
30 | - }//end getErrorList() |
|
31 | - |
|
32 | - |
|
33 | - /** |
|
34 | - * Returns the lines where warnings should occur. |
|
35 | - * |
|
36 | - * The key of the array should represent the line number and the value |
|
37 | - * should represent the number of warnings that should occur on that line. |
|
38 | - * |
|
39 | - * @return array<int, int> |
|
40 | - */ |
|
41 | - public function getWarningList() |
|
42 | - { |
|
43 | - return []; |
|
44 | - |
|
45 | - }//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 | + * @return array<int, int> |
|
25 | + */ |
|
26 | + public function getErrorList() |
|
27 | + { |
|
28 | + return [2 => 1]; |
|
29 | + |
|
30 | + }//end getErrorList() |
|
31 | + |
|
32 | + |
|
33 | + /** |
|
34 | + * Returns the lines where warnings should occur. |
|
35 | + * |
|
36 | + * The key of the array should represent the line number and the value |
|
37 | + * should represent the number of warnings that should occur on that line. |
|
38 | + * |
|
39 | + * @return array<int, int> |
|
40 | + */ |
|
41 | + public function getWarningList() |
|
42 | + { |
|
43 | + return []; |
|
44 | + |
|
45 | + }//end getWarningList() |
|
46 | 46 | |
47 | 47 | |
48 | 48 | }//end class |
@@ -15,40 +15,40 @@ |
||
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 | - * @return array<int, int> |
|
25 | - */ |
|
26 | - public function getErrorList() |
|
27 | - { |
|
28 | - $errors = [ |
|
29 | - 2 => 1, |
|
30 | - 4 => 1, |
|
31 | - 6 => 1, |
|
32 | - ]; |
|
33 | - |
|
34 | - return $errors; |
|
35 | - |
|
36 | - }//end getErrorList() |
|
37 | - |
|
38 | - |
|
39 | - /** |
|
40 | - * Returns the lines where warnings should occur. |
|
41 | - * |
|
42 | - * The key of the array should represent the line number and the value |
|
43 | - * should represent the number of warnings that should occur on that line. |
|
44 | - * |
|
45 | - * @return array<int, int> |
|
46 | - */ |
|
47 | - public function getWarningList() |
|
48 | - { |
|
49 | - return []; |
|
50 | - |
|
51 | - }//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 | + * @return array<int, int> |
|
25 | + */ |
|
26 | + public function getErrorList() |
|
27 | + { |
|
28 | + $errors = [ |
|
29 | + 2 => 1, |
|
30 | + 4 => 1, |
|
31 | + 6 => 1, |
|
32 | + ]; |
|
33 | + |
|
34 | + return $errors; |
|
35 | + |
|
36 | + }//end getErrorList() |
|
37 | + |
|
38 | + |
|
39 | + /** |
|
40 | + * Returns the lines where warnings should occur. |
|
41 | + * |
|
42 | + * The key of the array should represent the line number and the value |
|
43 | + * should represent the number of warnings that should occur on that line. |
|
44 | + * |
|
45 | + * @return array<int, int> |
|
46 | + */ |
|
47 | + public function getWarningList() |
|
48 | + { |
|
49 | + return []; |
|
50 | + |
|
51 | + }//end getWarningList() |
|
52 | 52 | |
53 | 53 | |
54 | 54 | }//end class |
@@ -15,34 +15,34 @@ |
||
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 | - * @return array<int, int> |
|
25 | - */ |
|
26 | - public function getErrorList() |
|
27 | - { |
|
28 | - return [2 => 2]; |
|
29 | - |
|
30 | - }//end getErrorList() |
|
31 | - |
|
32 | - |
|
33 | - /** |
|
34 | - * Returns the lines where warnings should occur. |
|
35 | - * |
|
36 | - * The key of the array should represent the line number and the value |
|
37 | - * should represent the number of warnings that should occur on that line. |
|
38 | - * |
|
39 | - * @return array<int, int> |
|
40 | - */ |
|
41 | - public function getWarningList() |
|
42 | - { |
|
43 | - return []; |
|
44 | - |
|
45 | - }//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 | + * @return array<int, int> |
|
25 | + */ |
|
26 | + public function getErrorList() |
|
27 | + { |
|
28 | + return [2 => 2]; |
|
29 | + |
|
30 | + }//end getErrorList() |
|
31 | + |
|
32 | + |
|
33 | + /** |
|
34 | + * Returns the lines where warnings should occur. |
|
35 | + * |
|
36 | + * The key of the array should represent the line number and the value |
|
37 | + * should represent the number of warnings that should occur on that line. |
|
38 | + * |
|
39 | + * @return array<int, int> |
|
40 | + */ |
|
41 | + public function getWarningList() |
|
42 | + { |
|
43 | + return []; |
|
44 | + |
|
45 | + }//end getWarningList() |
|
46 | 46 | |
47 | 47 | |
48 | 48 | }//end class |
@@ -7,9 +7,9 @@ |
||
7 | 7 | echo 'Bar'; |
8 | 8 | |
9 | 9 | for($i=0,$j=50; $i<100; $i++) { |
10 | - while($j--) { |
|
11 | - if($j==17) goto end; |
|
12 | - } |
|
10 | + while($j--) { |
|
11 | + if($j==17) goto end; |
|
12 | + } |
|
13 | 13 | } |
14 | 14 | echo "i = $i"; |
15 | 15 |
@@ -6,9 +6,9 @@ |
||
6 | 6 | a: |
7 | 7 | echo 'Bar'; |
8 | 8 | |
9 | -for($i=0,$j=50; $i<100; $i++) { |
|
10 | - while($j--) { |
|
11 | - if($j==17) goto end; |
|
9 | +for ($i = 0, $j = 50; $i < 100; $i++) { |
|
10 | + while ($j--) { |
|
11 | + if ($j == 17) goto end; |
|
12 | 12 | } |
13 | 13 | } |
14 | 14 | echo "i = $i"; |
@@ -8,7 +8,9 @@ |
||
8 | 8 | |
9 | 9 | for($i=0,$j=50; $i<100; $i++) { |
10 | 10 | while($j--) { |
11 | - if($j==17) goto end; |
|
11 | + if($j==17) { |
|
12 | + goto end; |
|
13 | + } |
|
12 | 14 | } |
13 | 15 | } |
14 | 16 | echo "i = $i"; |