@@ -15,53 +15,53 @@ |
||
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 | - 4 => 1, |
|
30 | - 5 => 1, |
|
31 | - 11 => 1, |
|
32 | - 12 => 1, |
|
33 | - 16 => 1, |
|
34 | - 17 => 1, |
|
35 | - 33 => 1, |
|
36 | - 34 => 1, |
|
37 | - 47 => 1, |
|
38 | - 48 => 1, |
|
39 | - 64 => 1, |
|
40 | - 65 => 1, |
|
41 | - 73 => 1, |
|
42 | - 74 => 1, |
|
43 | - 85 => 1, |
|
44 | - 86 => 1, |
|
45 | - 98 => 1, |
|
46 | - 99 => 2, |
|
47 | - ]; |
|
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 | + 4 => 1, |
|
30 | + 5 => 1, |
|
31 | + 11 => 1, |
|
32 | + 12 => 1, |
|
33 | + 16 => 1, |
|
34 | + 17 => 1, |
|
35 | + 33 => 1, |
|
36 | + 34 => 1, |
|
37 | + 47 => 1, |
|
38 | + 48 => 1, |
|
39 | + 64 => 1, |
|
40 | + 65 => 1, |
|
41 | + 73 => 1, |
|
42 | + 74 => 1, |
|
43 | + 85 => 1, |
|
44 | + 86 => 1, |
|
45 | + 98 => 1, |
|
46 | + 99 => 2, |
|
47 | + ]; |
|
48 | 48 | |
49 | - }//end getErrorList() |
|
49 | + }//end getErrorList() |
|
50 | 50 | |
51 | 51 | |
52 | - /** |
|
53 | - * Returns the lines where warnings should occur. |
|
54 | - * |
|
55 | - * The key of the array should represent the line number and the value |
|
56 | - * should represent the number of warnings that should occur on that line. |
|
57 | - * |
|
58 | - * @return array<int, int> |
|
59 | - */ |
|
60 | - public function getWarningList() |
|
61 | - { |
|
62 | - return []; |
|
52 | + /** |
|
53 | + * Returns the lines where warnings should occur. |
|
54 | + * |
|
55 | + * The key of the array should represent the line number and the value |
|
56 | + * should represent the number of warnings that should occur on that line. |
|
57 | + * |
|
58 | + * @return array<int, int> |
|
59 | + */ |
|
60 | + public function getWarningList() |
|
61 | + { |
|
62 | + return []; |
|
63 | 63 | |
64 | - }//end getWarningList() |
|
64 | + }//end getWarningList() |
|
65 | 65 | |
66 | 66 | |
67 | 67 | }//end class |
@@ -8,8 +8,8 @@ discard block |
||
8 | 8 | |
9 | 9 | // Conditionally including a class file: use include_once |
10 | 10 | if ($test) { |
11 | - require_once 'blank.inc'; |
|
12 | - require 'blank.inc'; |
|
11 | + require_once 'blank.inc'; |
|
12 | + require 'blank.inc'; |
|
13 | 13 | } |
14 | 14 | |
15 | 15 | // Unconditionally including a class file: use require_once |
@@ -19,8 +19,8 @@ discard block |
||
19 | 19 | |
20 | 20 | // These are ok |
21 | 21 | if ($test) { |
22 | - include_once 'blank.inc'; |
|
23 | - include 'blank.inc'; |
|
22 | + include_once 'blank.inc'; |
|
23 | + include 'blank.inc'; |
|
24 | 24 | } |
25 | 25 | |
26 | 26 | require_once 'blank.inc'; |
@@ -39,54 +39,54 @@ discard block |
||
39 | 39 | <?php |
40 | 40 | |
41 | 41 | if (include_once 'blank.inc') { |
42 | - $var = include_once 'blank.inc'; |
|
43 | - if ($var === true) { |
|
44 | - } |
|
42 | + $var = include_once 'blank.inc'; |
|
43 | + if ($var === true) { |
|
44 | + } |
|
45 | 45 | } |
46 | 46 | |
47 | 47 | if (require_once 'blank.inc') { |
48 | - $var = require_once 'blank.inc'; |
|
49 | - if ($var === true) { |
|
50 | - } |
|
48 | + $var = require_once 'blank.inc'; |
|
49 | + if ($var === true) { |
|
50 | + } |
|
51 | 51 | } |
52 | 52 | |
53 | 53 | function get_some_value() |
54 | 54 | { |
55 | - include_once 'blank.inc'; |
|
56 | - include 'blank.inc'; |
|
55 | + include_once 'blank.inc'; |
|
56 | + include 'blank.inc'; |
|
57 | 57 | |
58 | - // These are ok |
|
59 | - if ($test) { |
|
60 | - include_once 'blank.inc'; |
|
61 | - include 'blank.inc'; |
|
62 | - } |
|
58 | + // These are ok |
|
59 | + if ($test) { |
|
60 | + include_once 'blank.inc'; |
|
61 | + include 'blank.inc'; |
|
62 | + } |
|
63 | 63 | |
64 | - require_once 'blank.inc'; |
|
65 | - require 'blank.inc'; |
|
64 | + require_once 'blank.inc'; |
|
65 | + require 'blank.inc'; |
|
66 | 66 | |
67 | - ?> |
|
67 | + ?> |
|
68 | 68 | <pre> |
69 | 69 | Some content goes here. |
70 | 70 | <?php |
71 | - include_once 'blank.inc'; |
|
72 | - include 'blank.inc'; |
|
73 | - require_once 'blank.inc'; |
|
74 | - require 'blank.inc'; |
|
75 | - ?> |
|
71 | + include_once 'blank.inc'; |
|
72 | + include 'blank.inc'; |
|
73 | + require_once 'blank.inc'; |
|
74 | + require 'blank.inc'; |
|
75 | + ?> |
|
76 | 76 | </pre> |
77 | 77 | <?php |
78 | 78 | |
79 | - if (include_once 'blank.inc') { |
|
80 | - $var = include_once 'blank.inc'; |
|
81 | - if ($var === true) { |
|
82 | - } |
|
83 | - } |
|
79 | + if (include_once 'blank.inc') { |
|
80 | + $var = include_once 'blank.inc'; |
|
81 | + if ($var === true) { |
|
82 | + } |
|
83 | + } |
|
84 | 84 | |
85 | - if (require_once 'blank.inc') { |
|
86 | - $var = require_once 'blank.inc'; |
|
87 | - if ($var === true) { |
|
88 | - } |
|
89 | - } |
|
85 | + if (require_once 'blank.inc') { |
|
86 | + $var = require_once 'blank.inc'; |
|
87 | + if ($var === true) { |
|
88 | + } |
|
89 | + } |
|
90 | 90 | } |
91 | 91 | |
92 | 92 |
@@ -3,10 +3,10 @@ discard block |
||
3 | 3 | <?php } |
4 | 4 | |
5 | 5 | if (($condition1 |
6 | - || $condition2) |
|
7 | - && $condition3 |
|
8 | - && $condition4 |
|
9 | - && $condition5 |
|
6 | + || $condition2) |
|
7 | + && $condition3 |
|
8 | + && $condition4 |
|
9 | + && $condition5 |
|
10 | 10 | ) { |
11 | 11 | } |
12 | 12 | |
@@ -14,238 +14,238 @@ discard block |
||
14 | 14 | } |
15 | 15 | |
16 | 16 | if (($condition1 || $condition2) |
17 | - && $condition3 |
|
17 | + && $condition3 |
|
18 | 18 | ) { |
19 | 19 | } |
20 | 20 | |
21 | 21 | if ( |
22 | - ($condition1 || $condition2) |
|
23 | - && $condition3 |
|
22 | + ($condition1 || $condition2) |
|
23 | + && $condition3 |
|
24 | 24 | ) { |
25 | 25 | } |
26 | 26 | |
27 | 27 | if (($condition1 |
28 | - || $condition2) |
|
28 | + || $condition2) |
|
29 | 29 | ) { |
30 | 30 | } |
31 | 31 | |
32 | 32 | if (($condition1 |
33 | - || $condition2) |
|
34 | - && $condition3 && |
|
35 | - $condition4 |
|
33 | + || $condition2) |
|
34 | + && $condition3 && |
|
35 | + $condition4 |
|
36 | 36 | ) { |
37 | 37 | } |
38 | 38 | |
39 | 39 | if (($condition1 |
40 | 40 | || $condition2) |
41 | - && $condition3 |
|
41 | + && $condition3 |
|
42 | 42 | && $condition4 |
43 | 43 | && $condition5 |
44 | 44 | ) { |
45 | 45 | } |
46 | 46 | |
47 | 47 | if (($condition1 |
48 | - || $condition2) |
|
48 | + || $condition2) |
|
49 | 49 | ) { |
50 | 50 | } |
51 | 51 | |
52 | 52 | if (($condition1 |
53 | - || $condition2) |
|
53 | + || $condition2) |
|
54 | 54 | ) { |
55 | 55 | } |
56 | 56 | |
57 | 57 | if ( |
58 | - ( |
|
59 | - $condition1 |
|
60 | - || $condition2 |
|
61 | - ) |
|
62 | - && $condition3 |
|
58 | + ( |
|
59 | + $condition1 |
|
60 | + || $condition2 |
|
61 | + ) |
|
62 | + && $condition3 |
|
63 | 63 | ) { |
64 | 64 | } |
65 | 65 | |
66 | 66 | |
67 | 67 | if ( $condition1 |
68 | - || $condition2 |
|
69 | - || $condition3 |
|
68 | + || $condition2 |
|
69 | + || $condition3 |
|
70 | 70 | ) { |
71 | 71 | } |
72 | 72 | |
73 | 73 | if ($condition1 |
74 | - || $condition2 |
|
75 | - || $condition3 |
|
74 | + || $condition2 |
|
75 | + || $condition3 |
|
76 | 76 | ) { |
77 | 77 | } else if ($condition1 |
78 | - || $condition2 |
|
79 | - || $condition3 |
|
78 | + || $condition2 |
|
79 | + || $condition3 |
|
80 | 80 | ) { |
81 | 81 | } |
82 | 82 | |
83 | 83 | if ($condition1 |
84 | - || $condition2 |
|
85 | - || $condition3 |
|
84 | + || $condition2 |
|
85 | + || $condition3 |
|
86 | 86 | ) { |
87 | 87 | } elseif ( |
88 | - $condition1 |
|
88 | + $condition1 |
|
89 | 89 | || $condition2 && |
90 | - $condition3 |
|
90 | + $condition3 |
|
91 | 91 | ) { |
92 | 92 | } |
93 | 93 | |
94 | 94 | if ($condition1 |
95 | - || $condition2 |
|
95 | + || $condition2 |
|
96 | 96 | || $condition3) { |
97 | 97 | } |
98 | 98 | |
99 | 99 | if ($condition1 |
100 | - || $condition2 || $condition3 |
|
100 | + || $condition2 || $condition3 |
|
101 | 101 | ){ |
102 | 102 | } |
103 | 103 | |
104 | 104 | if ($condition1) |
105 | - echo 'bar'; |
|
105 | + echo 'bar'; |
|
106 | 106 | |
107 | 107 | if ($condition1 |
108 | - || $condition2 |
|
108 | + || $condition2 |
|
109 | 109 | || $condition3) |
110 | - echo 'bar'; |
|
110 | + echo 'bar'; |
|
111 | 111 | |
112 | 112 | |
113 | 113 | if ($condition1 |
114 | - || $condition2 || $condition3 |
|
114 | + || $condition2 || $condition3 |
|
115 | 115 | ) |
116 | - echo 'bar'; |
|
116 | + echo 'bar'; |
|
117 | 117 | |
118 | 118 | if (!empty($post) |
119 | - && (!empty($context['header']) |
|
120 | - xor stripos($context['header'], 'Content-Type')) |
|
119 | + && (!empty($context['header']) |
|
120 | + xor stripos($context['header'], 'Content-Type')) |
|
121 | 121 | ) { |
122 | 122 | // ... |
123 | 123 | } |
124 | 124 | |
125 | 125 | if ($foo) |
126 | 126 | { |
127 | - echo 'bar'; |
|
127 | + echo 'bar'; |
|
128 | 128 | } |
129 | 129 | |
130 | 130 | // Should be no errors even though lines are |
131 | 131 | // not exactly aligned together. Multi-line function |
132 | 132 | // call takes precedence. |
133 | 133 | if (array_key_exists($key, $value) |
134 | - && array_key_exists( |
|
135 | - $key, $value2 |
|
136 | - ) |
|
134 | + && array_key_exists( |
|
135 | + $key, $value2 |
|
136 | + ) |
|
137 | 137 | ) { |
138 | 138 | } |
139 | 139 | |
140 | 140 | if (true) : |
141 | - $foo = true; |
|
141 | + $foo = true; |
|
142 | 142 | endif; |
143 | 143 | |
144 | 144 | if ($IPP->errorCode() == 401 || // comment |
145 | - $IPP->errorCode() == 3200) /* long comment |
|
145 | + $IPP->errorCode() == 3200) /* long comment |
|
146 | 146 | here |
147 | 147 | */ |
148 | 148 | { |
149 | - return false; |
|
149 | + return false; |
|
150 | 150 | } |
151 | 151 | |
152 | 152 | if ($IPP->errorCode() == 401 || // comment |
153 | - $IPP->errorCode() == 3200) // long comment here |
|
153 | + $IPP->errorCode() == 3200) // long comment here |
|
154 | 154 | { |
155 | - return false; |
|
155 | + return false; |
|
156 | 156 | } |
157 | 157 | |
158 | 158 | if ($IPP->errorCode() == 401 |
159 | - // Comment explaining the next condition here. |
|
160 | - || $IPP->errorCode() == 3200 |
|
159 | + // Comment explaining the next condition here. |
|
160 | + || $IPP->errorCode() == 3200 |
|
161 | 161 | ) { |
162 | - return false; |
|
162 | + return false; |
|
163 | 163 | } |
164 | 164 | |
165 | 165 | function bar() { |
166 | - if ($a |
|
167 | - && $b |
|
166 | + if ($a |
|
167 | + && $b |
|
168 | 168 | ) { |
169 | - return false; |
|
170 | - } |
|
169 | + return false; |
|
170 | + } |
|
171 | 171 | } |
172 | 172 | |
173 | 173 | if ($a |
174 | - && foo( |
|
175 | - 'a', |
|
176 | - 'b' |
|
177 | - )) { |
|
178 | - return false; |
|
174 | + && foo( |
|
175 | + 'a', |
|
176 | + 'b' |
|
177 | + )) { |
|
178 | + return false; |
|
179 | 179 | } |
180 | 180 | |
181 | 181 | ?> |
182 | 182 | <?php foreach ($blah as $boo) : ?> |
183 | 183 | <?php if ($foo): ?> |
184 | 184 | <?php |
185 | - if ($bar) { |
|
186 | - } else { |
|
187 | - } |
|
188 | - ?> |
|
185 | + if ($bar) { |
|
186 | + } else { |
|
187 | + } |
|
188 | + ?> |
|
189 | 189 | <?php endif; ?> |
190 | 190 | <?php endforeach; ?> |
191 | 191 | <?php |
192 | 192 | |
193 | 193 | if ($IPP->errorCode() == 401 || // phpcs:ignore Standard.Category.Sniff -- for reasons. |
194 | - $IPP->errorCode() == 3200) /* |
|
194 | + $IPP->errorCode() == 3200) /* |
|
195 | 195 | phpcs:ignore Standard.Category.Sniff -- for reasons. |
196 | 196 | */ |
197 | 197 | { |
198 | - return false; |
|
198 | + return false; |
|
199 | 199 | } |
200 | 200 | |
201 | 201 | if ($IPP->errorCode() == 401 || // phpcs:disable Standard.Category.Sniff -- for reasons. |
202 | - $IPP->errorCode() == 3200) // phpcs:enable |
|
202 | + $IPP->errorCode() == 3200) // phpcs:enable |
|
203 | 203 | { |
204 | - return false; |
|
204 | + return false; |
|
205 | 205 | } |
206 | 206 | |
207 | 207 | if ($IPP->errorCode() == 401 |
208 | - // phpcs:ignore Standard.Category.Sniff -- for reasons. |
|
209 | - || $IPP->errorCode() == 3200 |
|
208 | + // phpcs:ignore Standard.Category.Sniff -- for reasons. |
|
209 | + || $IPP->errorCode() == 3200 |
|
210 | 210 | ) { |
211 | - return false; |
|
211 | + return false; |
|
212 | 212 | } |
213 | 213 | |
214 | - if ($IPP->errorCode() == 401 || |
|
215 | - /* |
|
214 | + if ($IPP->errorCode() == 401 || |
|
215 | + /* |
|
216 | 216 | * phpcs:disable Standard.Category.Sniff -- for reasons. |
217 | 217 | */ |
218 | - $IPP->errorCode() == 3200 |
|
219 | - ) { |
|
220 | - return false; |
|
221 | - } |
|
218 | + $IPP->errorCode() == 3200 |
|
219 | + ) { |
|
220 | + return false; |
|
221 | + } |
|
222 | 222 | |
223 | 223 | if ($IPP->errorCode() == 401 |
224 | - || $IPP->errorCode() == 3200 |
|
225 | - // phpcs:ignore Standard.Category.Sniff -- for reasons. |
|
224 | + || $IPP->errorCode() == 3200 |
|
225 | + // phpcs:ignore Standard.Category.Sniff -- for reasons. |
|
226 | 226 | ) { |
227 | - return false; |
|
227 | + return false; |
|
228 | 228 | } |
229 | 229 | |
230 | 230 | if ($IPP->errorCode() == 401 |
231 | - || $IPP->errorCode() |
|
232 | - === 'someverylongexpectedoutput' |
|
231 | + || $IPP->errorCode() |
|
232 | + === 'someverylongexpectedoutput' |
|
233 | 233 | ) { |
234 | - return false; |
|
234 | + return false; |
|
235 | 235 | } |
236 | 236 | |
237 | 237 | if ($IPP->errorCode() == 401 |
238 | - || $IPP->errorCode() |
|
239 | - // A comment. |
|
240 | - === 'someverylongexpectedoutput' |
|
238 | + || $IPP->errorCode() |
|
239 | + // A comment. |
|
240 | + === 'someverylongexpectedoutput' |
|
241 | 241 | ) { |
242 | - return false; |
|
242 | + return false; |
|
243 | 243 | } |
244 | 244 | |
245 | 245 | if ($IPP->errorCode() == 401 |
246 | - || $IPP->errorCode() |
|
247 | - // phpcs:ignore Standard.Category.Sniff -- for reasons. |
|
248 | - === 'someverylongexpectedoutput' |
|
246 | + || $IPP->errorCode() |
|
247 | + // phpcs:ignore Standard.Category.Sniff -- for reasons. |
|
248 | + === 'someverylongexpectedoutput' |
|
249 | 249 | ) { |
250 | - return false; |
|
250 | + return false; |
|
251 | 251 | } |
@@ -46,7 +46,7 @@ discard block |
||
46 | 46 | |
47 | 47 | if (($condition1 |
48 | 48 | || $condition2) |
49 | -) { |
|
49 | +) { |
|
50 | 50 | } |
51 | 51 | |
52 | 52 | if (($condition1 |
@@ -64,7 +64,7 @@ discard block |
||
64 | 64 | } |
65 | 65 | |
66 | 66 | |
67 | -if ( $condition1 |
|
67 | +if ($condition1 |
|
68 | 68 | || $condition2 |
69 | 69 | || $condition3 |
70 | 70 | ) { |
@@ -98,7 +98,7 @@ discard block |
||
98 | 98 | |
99 | 99 | if ($condition1 |
100 | 100 | || $condition2 || $condition3 |
101 | -){ |
|
101 | +) { |
|
102 | 102 | } |
103 | 103 | |
104 | 104 | if ($condition1) |
@@ -115,8 +115,8 @@ discard block |
||
115 | 115 | ) |
116 | 116 | echo 'bar'; |
117 | 117 | |
118 | -if (!empty($post) |
|
119 | - && (!empty($context['header']) |
|
118 | +if ( ! empty($post) |
|
119 | + && ( ! empty($context['header']) |
|
120 | 120 | xor stripos($context['header'], 'Content-Type')) |
121 | 121 | ) { |
122 | 122 | // ... |
@@ -101,19 +101,22 @@ discard block |
||
101 | 101 | ){ |
102 | 102 | } |
103 | 103 | |
104 | -if ($condition1) |
|
104 | +if ($condition1) { |
|
105 | 105 | echo 'bar'; |
106 | +} |
|
106 | 107 | |
107 | 108 | if ($condition1 |
108 | 109 | || $condition2 |
109 | -|| $condition3) |
|
110 | +|| $condition3) { |
|
110 | 111 | echo 'bar'; |
112 | +} |
|
111 | 113 | |
112 | 114 | |
113 | 115 | if ($condition1 |
114 | 116 | || $condition2 || $condition3 |
115 | -) |
|
117 | +) { |
|
116 | 118 | echo 'bar'; |
119 | +} |
|
117 | 120 | |
118 | 121 | if (!empty($post) |
119 | 122 | && (!empty($context['header']) |
@@ -142,18 +145,22 @@ discard block |
||
142 | 145 | endif; |
143 | 146 | |
144 | 147 | if ($IPP->errorCode() == 401 || // comment |
145 | - $IPP->errorCode() == 3200) /* long comment |
|
148 | + $IPP->errorCode() == 3200) { |
|
149 | + /* long comment |
|
146 | 150 | here |
147 | 151 | */ |
148 | 152 | { |
149 | 153 | return false; |
150 | 154 | } |
155 | +} |
|
151 | 156 | |
152 | 157 | if ($IPP->errorCode() == 401 || // comment |
153 | - $IPP->errorCode() == 3200) // long comment here |
|
158 | + $IPP->errorCode() == 3200) { |
|
159 | + // long comment here |
|
154 | 160 | { |
155 | 161 | return false; |
156 | 162 | } |
163 | +} |
|
157 | 164 | |
158 | 165 | if ($IPP->errorCode() == 401 |
159 | 166 | // Comment explaining the next condition here. |
@@ -191,18 +198,22 @@ discard block |
||
191 | 198 | <?php |
192 | 199 | |
193 | 200 | if ($IPP->errorCode() == 401 || // phpcs:ignore Standard.Category.Sniff -- for reasons. |
194 | - $IPP->errorCode() == 3200) /* |
|
201 | + $IPP->errorCode() == 3200) { |
|
202 | + /* |
|
195 | 203 | phpcs:ignore Standard.Category.Sniff -- for reasons. |
196 | 204 | */ |
197 | 205 | { |
198 | 206 | return false; |
199 | 207 | } |
208 | +} |
|
200 | 209 | |
201 | 210 | if ($IPP->errorCode() == 401 || // phpcs:disable Standard.Category.Sniff -- for reasons. |
202 | - $IPP->errorCode() == 3200) // phpcs:enable |
|
211 | + $IPP->errorCode() == 3200) { |
|
212 | + // phpcs:enable |
|
203 | 213 | { |
204 | 214 | return false; |
205 | 215 | } |
216 | +} |
|
206 | 217 | |
207 | 218 | if ($IPP->errorCode() == 401 |
208 | 219 | // phpcs:ignore Standard.Category.Sniff -- for reasons. |
@@ -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='MultiLineConditionUnitTest.inc') |
|
29 | - { |
|
30 | - $errors = [ |
|
31 | - 21 => 1, |
|
32 | - 22 => 1, |
|
33 | - 35 => 1, |
|
34 | - 40 => 1, |
|
35 | - 41 => 1, |
|
36 | - 42 => 1, |
|
37 | - 43 => 1, |
|
38 | - 49 => 1, |
|
39 | - 54 => 1, |
|
40 | - 57 => 1, |
|
41 | - 58 => 1, |
|
42 | - 59 => 1, |
|
43 | - 61 => 1, |
|
44 | - 67 => 1, |
|
45 | - 87 => 1, |
|
46 | - 88 => 1, |
|
47 | - 89 => 1, |
|
48 | - 90 => 1, |
|
49 | - 96 => 2, |
|
50 | - 101 => 1, |
|
51 | - 109 => 2, |
|
52 | - 125 => 1, |
|
53 | - 145 => 2, |
|
54 | - 153 => 2, |
|
55 | - 168 => 1, |
|
56 | - 177 => 1, |
|
57 | - 194 => 2, |
|
58 | - 202 => 2, |
|
59 | - 215 => 1, |
|
60 | - 218 => 2, |
|
61 | - 232 => 2, |
|
62 | - 239 => 1, |
|
63 | - 240 => 2, |
|
64 | - 248 => 2, |
|
65 | - ]; |
|
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='MultiLineConditionUnitTest.inc') |
|
29 | + { |
|
30 | + $errors = [ |
|
31 | + 21 => 1, |
|
32 | + 22 => 1, |
|
33 | + 35 => 1, |
|
34 | + 40 => 1, |
|
35 | + 41 => 1, |
|
36 | + 42 => 1, |
|
37 | + 43 => 1, |
|
38 | + 49 => 1, |
|
39 | + 54 => 1, |
|
40 | + 57 => 1, |
|
41 | + 58 => 1, |
|
42 | + 59 => 1, |
|
43 | + 61 => 1, |
|
44 | + 67 => 1, |
|
45 | + 87 => 1, |
|
46 | + 88 => 1, |
|
47 | + 89 => 1, |
|
48 | + 90 => 1, |
|
49 | + 96 => 2, |
|
50 | + 101 => 1, |
|
51 | + 109 => 2, |
|
52 | + 125 => 1, |
|
53 | + 145 => 2, |
|
54 | + 153 => 2, |
|
55 | + 168 => 1, |
|
56 | + 177 => 1, |
|
57 | + 194 => 2, |
|
58 | + 202 => 2, |
|
59 | + 215 => 1, |
|
60 | + 218 => 2, |
|
61 | + 232 => 2, |
|
62 | + 239 => 1, |
|
63 | + 240 => 2, |
|
64 | + 248 => 2, |
|
65 | + ]; |
|
66 | 66 | |
67 | - if ($testFile === 'MultiLineConditionUnitTest.inc') { |
|
68 | - $errors[183] = 1; |
|
69 | - } |
|
67 | + if ($testFile === 'MultiLineConditionUnitTest.inc') { |
|
68 | + $errors[183] = 1; |
|
69 | + } |
|
70 | 70 | |
71 | - return $errors; |
|
71 | + return $errors; |
|
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 |
@@ -25,7 +25,7 @@ |
||
25 | 25 | * |
26 | 26 | * @return array<int, int> |
27 | 27 | */ |
28 | - public function getErrorList($testFile='MultiLineConditionUnitTest.inc') |
|
28 | + public function getErrorList($testFile = 'MultiLineConditionUnitTest.inc') |
|
29 | 29 | { |
30 | 30 | $errors = [ |
31 | 31 | 21 => 1, |
@@ -25,7 +25,7 @@ |
||
25 | 25 | * |
26 | 26 | * @return array<int, int> |
27 | 27 | */ |
28 | - public function getErrorList($testFile='FunctionDeclarationUnitTest.inc') |
|
28 | + public function getErrorList($testFile = 'FunctionDeclarationUnitTest.inc') |
|
29 | 29 | { |
30 | 30 | if ($testFile === 'FunctionDeclarationUnitTest.inc') { |
31 | 31 | $errors = [ |
@@ -15,124 +15,124 @@ |
||
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='FunctionDeclarationUnitTest.inc') |
|
29 | - { |
|
30 | - if ($testFile === 'FunctionDeclarationUnitTest.inc') { |
|
31 | - $errors = [ |
|
32 | - 3 => 1, |
|
33 | - 4 => 1, |
|
34 | - 5 => 1, |
|
35 | - 9 => 1, |
|
36 | - 10 => 1, |
|
37 | - 11 => 1, |
|
38 | - 14 => 1, |
|
39 | - 17 => 1, |
|
40 | - 44 => 1, |
|
41 | - 52 => 1, |
|
42 | - 61 => 2, |
|
43 | - 98 => 1, |
|
44 | - 110 => 2, |
|
45 | - 120 => 3, |
|
46 | - 121 => 1, |
|
47 | - 140 => 1, |
|
48 | - 145 => 1, |
|
49 | - 161 => 2, |
|
50 | - 162 => 2, |
|
51 | - 164 => 2, |
|
52 | - 167 => 2, |
|
53 | - 171 => 1, |
|
54 | - 173 => 1, |
|
55 | - 201 => 1, |
|
56 | - 206 => 1, |
|
57 | - 208 => 1, |
|
58 | - 216 => 1, |
|
59 | - 223 => 1, |
|
60 | - 230 => 1, |
|
61 | - 237 => 1, |
|
62 | - 243 => 1, |
|
63 | - 247 => 1, |
|
64 | - 251 => 2, |
|
65 | - 253 => 2, |
|
66 | - 257 => 2, |
|
67 | - 259 => 1, |
|
68 | - 263 => 1, |
|
69 | - 265 => 1, |
|
70 | - 269 => 1, |
|
71 | - 273 => 1, |
|
72 | - 277 => 1, |
|
73 | - 278 => 1, |
|
74 | - 283 => 1, |
|
75 | - 287 => 2, |
|
76 | - 289 => 2, |
|
77 | - 293 => 2, |
|
78 | - 295 => 1, |
|
79 | - 299 => 1, |
|
80 | - 301 => 1, |
|
81 | - 305 => 1, |
|
82 | - 309 => 1, |
|
83 | - 313 => 1, |
|
84 | - 314 => 1, |
|
85 | - 350 => 1, |
|
86 | - 351 => 1, |
|
87 | - 352 => 1, |
|
88 | - 353 => 1, |
|
89 | - 361 => 1, |
|
90 | - 362 => 1, |
|
91 | - 363 => 1, |
|
92 | - 364 => 1, |
|
93 | - 365 => 1, |
|
94 | - 366 => 1, |
|
95 | - 367 => 1, |
|
96 | - 368 => 1, |
|
97 | - 369 => 1, |
|
98 | - 370 => 1, |
|
99 | - 371 => 1, |
|
100 | - 402 => 1, |
|
101 | - 406 => 1, |
|
102 | - ]; |
|
103 | - } else { |
|
104 | - $errors = [ |
|
105 | - 3 => 1, |
|
106 | - 4 => 1, |
|
107 | - 5 => 1, |
|
108 | - 9 => 1, |
|
109 | - 10 => 1, |
|
110 | - 11 => 1, |
|
111 | - 14 => 1, |
|
112 | - 17 => 1, |
|
113 | - 41 => 1, |
|
114 | - 48 => 1, |
|
115 | - ]; |
|
116 | - }//end if |
|
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='FunctionDeclarationUnitTest.inc') |
|
29 | + { |
|
30 | + if ($testFile === 'FunctionDeclarationUnitTest.inc') { |
|
31 | + $errors = [ |
|
32 | + 3 => 1, |
|
33 | + 4 => 1, |
|
34 | + 5 => 1, |
|
35 | + 9 => 1, |
|
36 | + 10 => 1, |
|
37 | + 11 => 1, |
|
38 | + 14 => 1, |
|
39 | + 17 => 1, |
|
40 | + 44 => 1, |
|
41 | + 52 => 1, |
|
42 | + 61 => 2, |
|
43 | + 98 => 1, |
|
44 | + 110 => 2, |
|
45 | + 120 => 3, |
|
46 | + 121 => 1, |
|
47 | + 140 => 1, |
|
48 | + 145 => 1, |
|
49 | + 161 => 2, |
|
50 | + 162 => 2, |
|
51 | + 164 => 2, |
|
52 | + 167 => 2, |
|
53 | + 171 => 1, |
|
54 | + 173 => 1, |
|
55 | + 201 => 1, |
|
56 | + 206 => 1, |
|
57 | + 208 => 1, |
|
58 | + 216 => 1, |
|
59 | + 223 => 1, |
|
60 | + 230 => 1, |
|
61 | + 237 => 1, |
|
62 | + 243 => 1, |
|
63 | + 247 => 1, |
|
64 | + 251 => 2, |
|
65 | + 253 => 2, |
|
66 | + 257 => 2, |
|
67 | + 259 => 1, |
|
68 | + 263 => 1, |
|
69 | + 265 => 1, |
|
70 | + 269 => 1, |
|
71 | + 273 => 1, |
|
72 | + 277 => 1, |
|
73 | + 278 => 1, |
|
74 | + 283 => 1, |
|
75 | + 287 => 2, |
|
76 | + 289 => 2, |
|
77 | + 293 => 2, |
|
78 | + 295 => 1, |
|
79 | + 299 => 1, |
|
80 | + 301 => 1, |
|
81 | + 305 => 1, |
|
82 | + 309 => 1, |
|
83 | + 313 => 1, |
|
84 | + 314 => 1, |
|
85 | + 350 => 1, |
|
86 | + 351 => 1, |
|
87 | + 352 => 1, |
|
88 | + 353 => 1, |
|
89 | + 361 => 1, |
|
90 | + 362 => 1, |
|
91 | + 363 => 1, |
|
92 | + 364 => 1, |
|
93 | + 365 => 1, |
|
94 | + 366 => 1, |
|
95 | + 367 => 1, |
|
96 | + 368 => 1, |
|
97 | + 369 => 1, |
|
98 | + 370 => 1, |
|
99 | + 371 => 1, |
|
100 | + 402 => 1, |
|
101 | + 406 => 1, |
|
102 | + ]; |
|
103 | + } else { |
|
104 | + $errors = [ |
|
105 | + 3 => 1, |
|
106 | + 4 => 1, |
|
107 | + 5 => 1, |
|
108 | + 9 => 1, |
|
109 | + 10 => 1, |
|
110 | + 11 => 1, |
|
111 | + 14 => 1, |
|
112 | + 17 => 1, |
|
113 | + 41 => 1, |
|
114 | + 48 => 1, |
|
115 | + ]; |
|
116 | + }//end if |
|
117 | 117 | |
118 | - return $errors; |
|
118 | + return $errors; |
|
119 | 119 | |
120 | - }//end getErrorList() |
|
120 | + }//end getErrorList() |
|
121 | 121 | |
122 | 122 | |
123 | - /** |
|
124 | - * Returns the lines where warnings should occur. |
|
125 | - * |
|
126 | - * The key of the array should represent the line number and the value |
|
127 | - * should represent the number of warnings that should occur on that line. |
|
128 | - * |
|
129 | - * @return array<int, int> |
|
130 | - */ |
|
131 | - public function getWarningList() |
|
132 | - { |
|
133 | - return []; |
|
123 | + /** |
|
124 | + * Returns the lines where warnings should occur. |
|
125 | + * |
|
126 | + * The key of the array should represent the line number and the value |
|
127 | + * should represent the number of warnings that should occur on that line. |
|
128 | + * |
|
129 | + * @return array<int, int> |
|
130 | + */ |
|
131 | + public function getWarningList() |
|
132 | + { |
|
133 | + return []; |
|
134 | 134 | |
135 | - }//end getWarningList() |
|
135 | + }//end getWarningList() |
|
136 | 136 | |
137 | 137 | |
138 | 138 | }//end class |
@@ -25,7 +25,7 @@ |
||
25 | 25 | * |
26 | 26 | * @return array<int, int> |
27 | 27 | */ |
28 | - public function getErrorList($testFile='FunctionCallSignatureUnitTest.inc') |
|
28 | + public function getErrorList($testFile = 'FunctionCallSignatureUnitTest.inc') |
|
29 | 29 | { |
30 | 30 | if ($testFile === 'FunctionCallSignatureUnitTest.js') { |
31 | 31 | return [ |
@@ -15,140 +15,140 @@ |
||
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='FunctionCallSignatureUnitTest.inc') |
|
29 | - { |
|
30 | - if ($testFile === 'FunctionCallSignatureUnitTest.js') { |
|
31 | - return [ |
|
32 | - 5 => 1, |
|
33 | - 6 => 2, |
|
34 | - 7 => 1, |
|
35 | - 8 => 1, |
|
36 | - 9 => 2, |
|
37 | - 10 => 3, |
|
38 | - 17 => 1, |
|
39 | - 18 => 1, |
|
40 | - 21 => 1, |
|
41 | - 24 => 1, |
|
42 | - 28 => 2, |
|
43 | - 30 => 2, |
|
44 | - 35 => 1, |
|
45 | - 49 => 1, |
|
46 | - 51 => 1, |
|
47 | - 54 => 1, |
|
48 | - 70 => 1, |
|
49 | - 71 => 1, |
|
50 | - ]; |
|
51 | - }//end if |
|
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='FunctionCallSignatureUnitTest.inc') |
|
29 | + { |
|
30 | + if ($testFile === 'FunctionCallSignatureUnitTest.js') { |
|
31 | + return [ |
|
32 | + 5 => 1, |
|
33 | + 6 => 2, |
|
34 | + 7 => 1, |
|
35 | + 8 => 1, |
|
36 | + 9 => 2, |
|
37 | + 10 => 3, |
|
38 | + 17 => 1, |
|
39 | + 18 => 1, |
|
40 | + 21 => 1, |
|
41 | + 24 => 1, |
|
42 | + 28 => 2, |
|
43 | + 30 => 2, |
|
44 | + 35 => 1, |
|
45 | + 49 => 1, |
|
46 | + 51 => 1, |
|
47 | + 54 => 1, |
|
48 | + 70 => 1, |
|
49 | + 71 => 1, |
|
50 | + ]; |
|
51 | + }//end if |
|
52 | 52 | |
53 | - return [ |
|
54 | - 5 => 1, |
|
55 | - 6 => 2, |
|
56 | - 7 => 1, |
|
57 | - 8 => 1, |
|
58 | - 9 => 2, |
|
59 | - 10 => 3, |
|
60 | - 17 => 1, |
|
61 | - 18 => 1, |
|
62 | - 31 => 1, |
|
63 | - 34 => 1, |
|
64 | - 43 => 2, |
|
65 | - 57 => 1, |
|
66 | - 59 => 1, |
|
67 | - 63 => 1, |
|
68 | - 64 => 1, |
|
69 | - 82 => 1, |
|
70 | - 93 => 1, |
|
71 | - 100 => 1, |
|
72 | - 106 => 2, |
|
73 | - 119 => 1, |
|
74 | - 120 => 1, |
|
75 | - 129 => 1, |
|
76 | - 137 => 1, |
|
77 | - 142 => 2, |
|
78 | - 171 => 1, |
|
79 | - 180 => 1, |
|
80 | - 181 => 1, |
|
81 | - 194 => 1, |
|
82 | - 213 => 2, |
|
83 | - 215 => 2, |
|
84 | - 217 => 2, |
|
85 | - 218 => 2, |
|
86 | - 277 => 1, |
|
87 | - 278 => 1, |
|
88 | - 303 => 1, |
|
89 | - 308 => 1, |
|
90 | - 321 => 1, |
|
91 | - 322 => 1, |
|
92 | - 329 => 1, |
|
93 | - 330 => 1, |
|
94 | - 337 => 1, |
|
95 | - 342 => 1, |
|
96 | - 343 => 1, |
|
97 | - 345 => 1, |
|
98 | - 346 => 2, |
|
99 | - 353 => 1, |
|
100 | - 354 => 1, |
|
101 | - 355 => 2, |
|
102 | - 377 => 1, |
|
103 | - 378 => 1, |
|
104 | - 379 => 1, |
|
105 | - 380 => 1, |
|
106 | - 385 => 1, |
|
107 | - 386 => 1, |
|
108 | - 387 => 1, |
|
109 | - 388 => 1, |
|
110 | - 393 => 1, |
|
111 | - 394 => 1, |
|
112 | - 395 => 1, |
|
113 | - 396 => 1, |
|
114 | - 411 => 1, |
|
115 | - 422 => 1, |
|
116 | - 424 => 1, |
|
117 | - 429 => 1, |
|
118 | - 432 => 1, |
|
119 | - 440 => 1, |
|
120 | - 441 => 1, |
|
121 | - 442 => 1, |
|
122 | - 464 => 1, |
|
123 | - 510 => 1, |
|
124 | - 513 => 1, |
|
125 | - 514 => 1, |
|
126 | - 523 => 1, |
|
127 | - 524 => 3, |
|
128 | - 527 => 2, |
|
129 | - 539 => 1, |
|
130 | - 540 => 1, |
|
131 | - 546 => 1, |
|
132 | - 547 => 1, |
|
133 | - 548 => 1, |
|
134 | - ]; |
|
53 | + return [ |
|
54 | + 5 => 1, |
|
55 | + 6 => 2, |
|
56 | + 7 => 1, |
|
57 | + 8 => 1, |
|
58 | + 9 => 2, |
|
59 | + 10 => 3, |
|
60 | + 17 => 1, |
|
61 | + 18 => 1, |
|
62 | + 31 => 1, |
|
63 | + 34 => 1, |
|
64 | + 43 => 2, |
|
65 | + 57 => 1, |
|
66 | + 59 => 1, |
|
67 | + 63 => 1, |
|
68 | + 64 => 1, |
|
69 | + 82 => 1, |
|
70 | + 93 => 1, |
|
71 | + 100 => 1, |
|
72 | + 106 => 2, |
|
73 | + 119 => 1, |
|
74 | + 120 => 1, |
|
75 | + 129 => 1, |
|
76 | + 137 => 1, |
|
77 | + 142 => 2, |
|
78 | + 171 => 1, |
|
79 | + 180 => 1, |
|
80 | + 181 => 1, |
|
81 | + 194 => 1, |
|
82 | + 213 => 2, |
|
83 | + 215 => 2, |
|
84 | + 217 => 2, |
|
85 | + 218 => 2, |
|
86 | + 277 => 1, |
|
87 | + 278 => 1, |
|
88 | + 303 => 1, |
|
89 | + 308 => 1, |
|
90 | + 321 => 1, |
|
91 | + 322 => 1, |
|
92 | + 329 => 1, |
|
93 | + 330 => 1, |
|
94 | + 337 => 1, |
|
95 | + 342 => 1, |
|
96 | + 343 => 1, |
|
97 | + 345 => 1, |
|
98 | + 346 => 2, |
|
99 | + 353 => 1, |
|
100 | + 354 => 1, |
|
101 | + 355 => 2, |
|
102 | + 377 => 1, |
|
103 | + 378 => 1, |
|
104 | + 379 => 1, |
|
105 | + 380 => 1, |
|
106 | + 385 => 1, |
|
107 | + 386 => 1, |
|
108 | + 387 => 1, |
|
109 | + 388 => 1, |
|
110 | + 393 => 1, |
|
111 | + 394 => 1, |
|
112 | + 395 => 1, |
|
113 | + 396 => 1, |
|
114 | + 411 => 1, |
|
115 | + 422 => 1, |
|
116 | + 424 => 1, |
|
117 | + 429 => 1, |
|
118 | + 432 => 1, |
|
119 | + 440 => 1, |
|
120 | + 441 => 1, |
|
121 | + 442 => 1, |
|
122 | + 464 => 1, |
|
123 | + 510 => 1, |
|
124 | + 513 => 1, |
|
125 | + 514 => 1, |
|
126 | + 523 => 1, |
|
127 | + 524 => 3, |
|
128 | + 527 => 2, |
|
129 | + 539 => 1, |
|
130 | + 540 => 1, |
|
131 | + 546 => 1, |
|
132 | + 547 => 1, |
|
133 | + 548 => 1, |
|
134 | + ]; |
|
135 | 135 | |
136 | - }//end getErrorList() |
|
136 | + }//end getErrorList() |
|
137 | 137 | |
138 | 138 | |
139 | - /** |
|
140 | - * Returns the lines where warnings should occur. |
|
141 | - * |
|
142 | - * The key of the array should represent the line number and the value |
|
143 | - * should represent the number of warnings that should occur on that line. |
|
144 | - * |
|
145 | - * @return array<int, int> |
|
146 | - */ |
|
147 | - public function getWarningList() |
|
148 | - { |
|
149 | - return []; |
|
139 | + /** |
|
140 | + * Returns the lines where warnings should occur. |
|
141 | + * |
|
142 | + * The key of the array should represent the line number and the value |
|
143 | + * should represent the number of warnings that should occur on that line. |
|
144 | + * |
|
145 | + * @return array<int, int> |
|
146 | + */ |
|
147 | + public function getWarningList() |
|
148 | + { |
|
149 | + return []; |
|
150 | 150 | |
151 | - }//end getWarningList() |
|
151 | + }//end getWarningList() |
|
152 | 152 | |
153 | 153 | |
154 | 154 | }//end class |
@@ -10,9 +10,9 @@ |
||
10 | 10 | */ |
11 | 11 | function test() |
12 | 12 | { |
13 | - // Some code goes here. |
|
13 | + // Some code goes here. |
|
14 | 14 | |
15 | - # This comment is banned. |
|
15 | + # This comment is banned. |
|
16 | 16 | |
17 | 17 | }//end test() |
18 | 18 |
@@ -15,41 +15,41 @@ |
||
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 | - 15 => 1, |
|
30 | - 24 => 1, |
|
31 | - 25 => 1, |
|
32 | - 27 => 1, |
|
33 | - 28 => 1, |
|
34 | - 29 => 1, |
|
35 | - ]; |
|
36 | - |
|
37 | - }//end getErrorList() |
|
38 | - |
|
39 | - |
|
40 | - /** |
|
41 | - * Returns the lines where warnings should occur. |
|
42 | - * |
|
43 | - * The key of the array should represent the line number and the value |
|
44 | - * should represent the number of warnings that should occur on that line. |
|
45 | - * |
|
46 | - * @return array<int, int> |
|
47 | - */ |
|
48 | - public function getWarningList() |
|
49 | - { |
|
50 | - return []; |
|
51 | - |
|
52 | - }//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 | + 15 => 1, |
|
30 | + 24 => 1, |
|
31 | + 25 => 1, |
|
32 | + 27 => 1, |
|
33 | + 28 => 1, |
|
34 | + 29 => 1, |
|
35 | + ]; |
|
36 | + |
|
37 | + }//end getErrorList() |
|
38 | + |
|
39 | + |
|
40 | + /** |
|
41 | + * Returns the lines where warnings should occur. |
|
42 | + * |
|
43 | + * The key of the array should represent the line number and the value |
|
44 | + * should represent the number of warnings that should occur on that line. |
|
45 | + * |
|
46 | + * @return array<int, int> |
|
47 | + */ |
|
48 | + public function getWarningList() |
|
49 | + { |
|
50 | + return []; |
|
51 | + |
|
52 | + }//end getWarningList() |
|
53 | 53 | |
54 | 54 | |
55 | 55 | }//end class |
@@ -14,7 +14,7 @@ |
||
14 | 14 | * @return |
15 | 15 | * @throws |
16 | 16 | */ |
17 | - private function _functionCall($stackPtr, $depth=1, $index) |
|
17 | + private function _functionCall($stackPtr, $depth = 1, $index) |
|
18 | 18 | { |
19 | 19 | return $stackPtr; |
20 | 20 |
@@ -2,148 +2,148 @@ discard block |
||
2 | 2 | class PHP_CodeSniffer_File |
3 | 3 | { |
4 | 4 | |
5 | - /** |
|
6 | - * A simple function comment. |
|
7 | - * |
|
8 | - * long desc here |
|
9 | - * |
|
10 | - * @param int $stackPtr The position in @ @unknown the stack of the token |
|
11 | - * that opened the scope |
|
12 | - * @param int $detph How many scope levels down we are. |
|
13 | - * @param int $index The index |
|
14 | - * @return |
|
15 | - * @throws |
|
16 | - */ |
|
17 | - private function _functionCall($stackPtr, $depth=1, $index) |
|
18 | - { |
|
19 | - return $stackPtr; |
|
20 | - |
|
21 | - }//end _functionCall() |
|
22 | - |
|
23 | - // |
|
24 | - // Sample function comment |
|
25 | - // |
|
26 | - // |
|
27 | - // |
|
28 | - public function invalidCommentStyle() |
|
29 | - { |
|
30 | - |
|
31 | - }//end invalidCommentStyle() |
|
32 | - |
|
33 | - |
|
34 | - /** |
|
35 | - * |
|
36 | - * |
|
37 | - * A simple function comment |
|
38 | - * |
|
39 | - * |
|
40 | - * Long description with extra blank line before and after |
|
41 | - * |
|
42 | - * |
|
43 | - * @return void |
|
44 | - */ |
|
45 | - public function extraDescriptionNewlines() |
|
46 | - { |
|
47 | - |
|
48 | - }//end extraDescriptionNewlines() |
|
49 | - |
|
50 | - |
|
51 | - /** |
|
52 | - * A simple function comment |
|
53 | - * @return void |
|
54 | - */ |
|
55 | - public function missingNewlinesBeforeTags() |
|
56 | - { |
|
57 | - |
|
58 | - }//end missingNewlinesBeforeTags() |
|
59 | - |
|
60 | - |
|
61 | - /** |
|
62 | - * Access tag should not be treated as a long description |
|
63 | - * |
|
64 | - * @access public |
|
65 | - * @return void |
|
66 | - */ |
|
67 | - public function accessTag() |
|
68 | - { |
|
69 | - |
|
70 | - }//end accessTag() |
|
71 | - |
|
72 | - /** |
|
73 | - * Constructor |
|
74 | - * |
|
75 | - * No return tag |
|
76 | - */ |
|
77 | - function PHP_CodeSniffer_File() |
|
78 | - { |
|
79 | - return; |
|
80 | - } |
|
81 | - |
|
82 | - |
|
83 | - /** |
|
84 | - * Destructor |
|
85 | - * |
|
86 | - * No return tag too |
|
87 | - */ |
|
88 | - function _PHP_CodeSniffer_File() |
|
89 | - { |
|
90 | - return; |
|
91 | - } |
|
92 | - |
|
93 | - |
|
94 | - /** |
|
95 | - * Destructor PHP5 |
|
96 | - */ |
|
97 | - function __destruct() |
|
98 | - { |
|
99 | - return; |
|
100 | - } |
|
101 | - |
|
102 | - |
|
103 | - function missingComment() |
|
104 | - { |
|
105 | - return; |
|
106 | - } |
|
107 | - |
|
108 | - |
|
109 | - /** |
|
110 | - * no return tag |
|
111 | - * |
|
112 | - */ |
|
113 | - public function noReturn($one) |
|
114 | - { |
|
115 | - |
|
116 | - }//end noReturn() |
|
117 | - |
|
118 | - |
|
119 | - /** |
|
120 | - * Param not immediate |
|
121 | - * |
|
122 | - * @return |
|
123 | - * @param int $threeSpaces |
|
124 | - * @param int $superfluous |
|
125 | - * @param missing |
|
126 | - * @param |
|
127 | - */ |
|
128 | - public function missingDescription($threeSpaces) |
|
129 | - { |
|
130 | - |
|
131 | - }//end missingDescription() |
|
132 | - |
|
133 | - |
|
134 | - /** |
|
135 | - * Param not immediate |
|
136 | - * |
|
137 | - * @param int $one comment |
|
138 | - * @param int $two comment |
|
139 | - * @param string $three comment |
|
140 | - * |
|
141 | - * @return void |
|
142 | - */ |
|
143 | - public function oneSpaceAfterLongestVar($one, $two, $three) |
|
144 | - { |
|
145 | - |
|
146 | - }//end oneSpaceAfterLongestVar() |
|
5 | + /** |
|
6 | + * A simple function comment. |
|
7 | + * |
|
8 | + * long desc here |
|
9 | + * |
|
10 | + * @param int $stackPtr The position in @ @unknown the stack of the token |
|
11 | + * that opened the scope |
|
12 | + * @param int $detph How many scope levels down we are. |
|
13 | + * @param int $index The index |
|
14 | + * @return |
|
15 | + * @throws |
|
16 | + */ |
|
17 | + private function _functionCall($stackPtr, $depth=1, $index) |
|
18 | + { |
|
19 | + return $stackPtr; |
|
20 | + |
|
21 | + }//end _functionCall() |
|
22 | + |
|
23 | + // |
|
24 | + // Sample function comment |
|
25 | + // |
|
26 | + // |
|
27 | + // |
|
28 | + public function invalidCommentStyle() |
|
29 | + { |
|
30 | + |
|
31 | + }//end invalidCommentStyle() |
|
32 | + |
|
33 | + |
|
34 | + /** |
|
35 | + * |
|
36 | + * |
|
37 | + * A simple function comment |
|
38 | + * |
|
39 | + * |
|
40 | + * Long description with extra blank line before and after |
|
41 | + * |
|
42 | + * |
|
43 | + * @return void |
|
44 | + */ |
|
45 | + public function extraDescriptionNewlines() |
|
46 | + { |
|
47 | + |
|
48 | + }//end extraDescriptionNewlines() |
|
49 | + |
|
50 | + |
|
51 | + /** |
|
52 | + * A simple function comment |
|
53 | + * @return void |
|
54 | + */ |
|
55 | + public function missingNewlinesBeforeTags() |
|
56 | + { |
|
57 | + |
|
58 | + }//end missingNewlinesBeforeTags() |
|
59 | + |
|
60 | + |
|
61 | + /** |
|
62 | + * Access tag should not be treated as a long description |
|
63 | + * |
|
64 | + * @access public |
|
65 | + * @return void |
|
66 | + */ |
|
67 | + public function accessTag() |
|
68 | + { |
|
69 | + |
|
70 | + }//end accessTag() |
|
71 | + |
|
72 | + /** |
|
73 | + * Constructor |
|
74 | + * |
|
75 | + * No return tag |
|
76 | + */ |
|
77 | + function PHP_CodeSniffer_File() |
|
78 | + { |
|
79 | + return; |
|
80 | + } |
|
81 | + |
|
82 | + |
|
83 | + /** |
|
84 | + * Destructor |
|
85 | + * |
|
86 | + * No return tag too |
|
87 | + */ |
|
88 | + function _PHP_CodeSniffer_File() |
|
89 | + { |
|
90 | + return; |
|
91 | + } |
|
92 | + |
|
93 | + |
|
94 | + /** |
|
95 | + * Destructor PHP5 |
|
96 | + */ |
|
97 | + function __destruct() |
|
98 | + { |
|
99 | + return; |
|
100 | + } |
|
101 | + |
|
102 | + |
|
103 | + function missingComment() |
|
104 | + { |
|
105 | + return; |
|
106 | + } |
|
107 | + |
|
108 | + |
|
109 | + /** |
|
110 | + * no return tag |
|
111 | + * |
|
112 | + */ |
|
113 | + public function noReturn($one) |
|
114 | + { |
|
115 | + |
|
116 | + }//end noReturn() |
|
117 | + |
|
118 | + |
|
119 | + /** |
|
120 | + * Param not immediate |
|
121 | + * |
|
122 | + * @return |
|
123 | + * @param int $threeSpaces |
|
124 | + * @param int $superfluous |
|
125 | + * @param missing |
|
126 | + * @param |
|
127 | + */ |
|
128 | + public function missingDescription($threeSpaces) |
|
129 | + { |
|
130 | + |
|
131 | + }//end missingDescription() |
|
132 | + |
|
133 | + |
|
134 | + /** |
|
135 | + * Param not immediate |
|
136 | + * |
|
137 | + * @param int $one comment |
|
138 | + * @param int $two comment |
|
139 | + * @param string $three comment |
|
140 | + * |
|
141 | + * @return void |
|
142 | + */ |
|
143 | + public function oneSpaceAfterLongestVar($one, $two, $three) |
|
144 | + { |
|
145 | + |
|
146 | + }//end oneSpaceAfterLongestVar() |
|
147 | 147 | |
148 | 148 | |
149 | 149 | }//end class |
@@ -159,19 +159,19 @@ discard block |
||
159 | 159 | */ |
160 | 160 | function functionOutsideClass(&$str, &$foo) |
161 | 161 | { |
162 | - return; |
|
162 | + return; |
|
163 | 163 | }//end functionOutsideClass() |
164 | 164 | |
165 | 165 | function missingCommentOutsideClass() |
166 | 166 | { |
167 | - return; |
|
167 | + return; |
|
168 | 168 | }//end missingCommentOutsideClass() |
169 | 169 | |
170 | 170 | |
171 | 171 | ?><?php |
172 | 172 | function tagBeforeComment() |
173 | 173 | { |
174 | - return; |
|
174 | + return; |
|
175 | 175 | }//end tagBeforeComment() |
176 | 176 | |
177 | 177 | |
@@ -244,12 +244,12 @@ discard block |
||
244 | 244 | function myFunction() {} |
245 | 245 | |
246 | 246 | abstract class MyClass { |
247 | - /** |
|
248 | - * An abstract function. |
|
249 | - * |
|
250 | - * @return string[] |
|
251 | - */ |
|
252 | - abstract protected function myFunction(); |
|
247 | + /** |
|
248 | + * An abstract function. |
|
249 | + * |
|
250 | + * @return string[] |
|
251 | + */ |
|
252 | + abstract protected function myFunction(); |
|
253 | 253 | } |
254 | 254 | |
255 | 255 | /** |
@@ -271,18 +271,18 @@ discard block |
||
271 | 271 | * |
272 | 272 | */ |
273 | 273 | function _() { |
274 | - return $foo; |
|
274 | + return $foo; |
|
275 | 275 | } |
276 | 276 | |
277 | 277 | class Baz { |
278 | - /** |
|
279 | - * The PHP5 constructor |
|
280 | - * |
|
281 | - * No return tag |
|
282 | - */ |
|
283 | - public function __construct() { |
|
284 | - |
|
285 | - } |
|
278 | + /** |
|
279 | + * The PHP5 constructor |
|
280 | + * |
|
281 | + * No return tag |
|
282 | + */ |
|
283 | + public function __construct() { |
|
284 | + |
|
285 | + } |
|
286 | 286 | } |
287 | 287 | |
288 | 288 | /** |
@@ -295,7 +295,7 @@ discard block |
||
295 | 295 | * @return void |
296 | 296 | */ |
297 | 297 | function completeStep($status, array $array = [Class1::class, 'test'], $note = '') { |
298 | - echo 'foo'; |
|
298 | + echo 'foo'; |
|
299 | 299 | } |
300 | 300 | |
301 | 301 | /** |
@@ -379,45 +379,45 @@ discard block |
||
379 | 379 | */ |
380 | 380 | public function setTranslator($a, &$b): void |
381 | 381 | { |
382 | - $this->translator = $translator; |
|
382 | + $this->translator = $translator; |
|
383 | 383 | } |
384 | 384 | |
385 | 385 | // phpcs:set PEAR.Commenting.FunctionComment minimumVisibility protected |
386 | 386 | private function setTranslator2($a, &$b): void |
387 | 387 | { |
388 | - $this->translator = $translator; |
|
388 | + $this->translator = $translator; |
|
389 | 389 | } |
390 | 390 | |
391 | 391 | // phpcs:set PEAR.Commenting.FunctionComment minimumVisibility public |
392 | 392 | protected function setTranslator3($a, &$b): void |
393 | 393 | { |
394 | - $this->translator = $translator; |
|
394 | + $this->translator = $translator; |
|
395 | 395 | } |
396 | 396 | |
397 | 397 | private function setTranslator4($a, &$b): void |
398 | 398 | { |
399 | - $this->translator = $translator; |
|
399 | + $this->translator = $translator; |
|
400 | 400 | } |
401 | 401 | |
402 | 402 | class Bar { |
403 | - /** |
|
404 | - * The PHP5 constructor |
|
405 | - * |
|
406 | - * @return |
|
407 | - */ |
|
408 | - public function __construct() { |
|
409 | - |
|
410 | - } |
|
403 | + /** |
|
404 | + * The PHP5 constructor |
|
405 | + * |
|
406 | + * @return |
|
407 | + */ |
|
408 | + public function __construct() { |
|
409 | + |
|
410 | + } |
|
411 | 411 | } |
412 | 412 | |
413 | 413 | // phpcs:set PEAR.Commenting.FunctionComment specialMethods[] |
414 | 414 | class Bar { |
415 | - /** |
|
416 | - * The PHP5 constructor |
|
417 | - */ |
|
418 | - public function __construct() { |
|
415 | + /** |
|
416 | + * The PHP5 constructor |
|
417 | + */ |
|
418 | + public function __construct() { |
|
419 | 419 | |
420 | - } |
|
420 | + } |
|
421 | 421 | } |
422 | 422 | |
423 | 423 | // phpcs:set PEAR.Commenting.FunctionComment specialMethods[] ignored |
@@ -431,48 +431,48 @@ discard block |
||
431 | 431 | // phpcs:set PEAR.Commenting.FunctionComment specialMethods[] __construct,__destruct |
432 | 432 | |
433 | 433 | class Something implements JsonSerializable { |
434 | - /** |
|
435 | - * Single attribute. |
|
436 | - * |
|
437 | - * @return mixed |
|
438 | - */ |
|
439 | - #[ReturnTypeWillChange] |
|
440 | - public function jsonSerialize() {} |
|
441 | - |
|
442 | - /** |
|
443 | - * Multiple attributes. |
|
444 | - * |
|
445 | - * @return Something |
|
446 | - */ |
|
447 | - #[AttributeA] |
|
448 | - #[AttributeB] |
|
449 | - public function methodName() {} |
|
450 | - |
|
451 | - /** |
|
452 | - * Blank line between docblock and attribute. |
|
453 | - * |
|
454 | - * @return mixed |
|
455 | - */ |
|
456 | - |
|
457 | - #[ReturnTypeWillChange] |
|
458 | - public function blankLineDetectionA() {} |
|
459 | - |
|
460 | - /** |
|
461 | - * Blank line between attribute and function declaration. |
|
462 | - * |
|
463 | - * @return mixed |
|
464 | - */ |
|
465 | - #[ReturnTypeWillChange] |
|
466 | - |
|
467 | - public function blankLineDetectionB() {} |
|
468 | - |
|
469 | - /** |
|
470 | - * Blank line between both docblock and attribute and attribute and function declaration. |
|
471 | - * |
|
472 | - * @return mixed |
|
473 | - */ |
|
474 | - |
|
475 | - #[ReturnTypeWillChange] |
|
476 | - |
|
477 | - public function blankLineDetectionC() {} |
|
434 | + /** |
|
435 | + * Single attribute. |
|
436 | + * |
|
437 | + * @return mixed |
|
438 | + */ |
|
439 | + #[ReturnTypeWillChange] |
|
440 | + public function jsonSerialize() {} |
|
441 | + |
|
442 | + /** |
|
443 | + * Multiple attributes. |
|
444 | + * |
|
445 | + * @return Something |
|
446 | + */ |
|
447 | + #[AttributeA] |
|
448 | + #[AttributeB] |
|
449 | + public function methodName() {} |
|
450 | + |
|
451 | + /** |
|
452 | + * Blank line between docblock and attribute. |
|
453 | + * |
|
454 | + * @return mixed |
|
455 | + */ |
|
456 | + |
|
457 | + #[ReturnTypeWillChange] |
|
458 | + public function blankLineDetectionA() {} |
|
459 | + |
|
460 | + /** |
|
461 | + * Blank line between attribute and function declaration. |
|
462 | + * |
|
463 | + * @return mixed |
|
464 | + */ |
|
465 | + #[ReturnTypeWillChange] |
|
466 | + |
|
467 | + public function blankLineDetectionB() {} |
|
468 | + |
|
469 | + /** |
|
470 | + * Blank line between both docblock and attribute and attribute and function declaration. |
|
471 | + * |
|
472 | + * @return mixed |
|
473 | + */ |
|
474 | + |
|
475 | + #[ReturnTypeWillChange] |
|
476 | + |
|
477 | + public function blankLineDetectionC() {} |
|
478 | 478 | } |