@@ -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 | - * @param string $testFile The name of the file being tested. |
|
25 | - * |
|
26 | - * @return array<int, int> |
|
27 | - */ |
|
28 | - public function getErrorList($testFile='') |
|
29 | - { |
|
30 | - switch ($testFile) { |
|
31 | - case 'FileExtensionUnitTest.1.inc': |
|
32 | - return [1 => 1]; |
|
33 | - default: |
|
34 | - return []; |
|
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 | + * @param string $testFile The name of the file being tested. |
|
25 | + * |
|
26 | + * @return array<int, int> |
|
27 | + */ |
|
28 | + public function getErrorList($testFile='') |
|
29 | + { |
|
30 | + switch ($testFile) { |
|
31 | + case 'FileExtensionUnitTest.1.inc': |
|
32 | + return [1 => 1]; |
|
33 | + default: |
|
34 | + return []; |
|
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 |
@@ -28,10 +28,10 @@ |
||
28 | 28 | public function getErrorList($testFile='') |
29 | 29 | { |
30 | 30 | switch ($testFile) { |
31 | - case 'FileExtensionUnitTest.1.inc': |
|
32 | - return [1 => 1]; |
|
33 | - default: |
|
34 | - return []; |
|
31 | + case 'FileExtensionUnitTest.1.inc': |
|
32 | + return [1 => 1]; |
|
33 | + default: |
|
34 | + return []; |
|
35 | 35 | } |
36 | 36 | |
37 | 37 | }//end getErrorList() |
@@ -25,7 +25,7 @@ |
||
25 | 25 | * |
26 | 26 | * @return array<int, int> |
27 | 27 | */ |
28 | - public function getErrorList($testFile='') |
|
28 | + public function getErrorList($testFile = '') |
|
29 | 29 | { |
30 | 30 | switch ($testFile) { |
31 | 31 | case 'FileExtensionUnitTest.1.inc': |
@@ -157,8 +157,8 @@ |
||
157 | 157 | |
158 | 158 | switch($foo) { |
159 | 159 | |
160 | - case 'bar': |
|
161 | - break; |
|
160 | + case 'bar': |
|
161 | + break; |
|
162 | 162 | |
163 | 163 | } |
164 | 164 |
@@ -1,112 +1,112 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | $i = 0; |
3 | 3 | do { |
4 | - echo $i; |
|
4 | + echo $i; |
|
5 | 5 | } while ($i > 0); |
6 | 6 | |
7 | 7 | do |
8 | 8 | { |
9 | - echo $i; |
|
9 | + echo $i; |
|
10 | 10 | } while ($i > 0); |
11 | 11 | |
12 | 12 | do |
13 | 13 | { |
14 | - echo $i; |
|
14 | + echo $i; |
|
15 | 15 | } |
16 | 16 | while ($i > 0); |
17 | 17 | |
18 | 18 | do { echo $i; } while ($i > 0); |
19 | 19 | |
20 | 20 | do{ |
21 | - echo $i; |
|
21 | + echo $i; |
|
22 | 22 | }while($i > 0); |
23 | 23 | |
24 | 24 | while ($i < 1) { |
25 | - echo $i; |
|
25 | + echo $i; |
|
26 | 26 | } |
27 | 27 | |
28 | 28 | while($i < 1){ |
29 | - echo $i; |
|
29 | + echo $i; |
|
30 | 30 | } |
31 | 31 | |
32 | 32 | while ($i < 1) { echo $i; } |
33 | 33 | |
34 | 34 | for ($i = 1; $i < 1; $i++) { |
35 | - echo $i; |
|
35 | + echo $i; |
|
36 | 36 | } |
37 | 37 | |
38 | 38 | for($i = 1; $i < 1; $i++){ |
39 | - echo $i; |
|
39 | + echo $i; |
|
40 | 40 | } |
41 | 41 | |
42 | 42 | for ($i = 1; $i < 1; $i++) { echo $i; } |
43 | 43 | |
44 | 44 | if ($i == 0) { |
45 | - $i = 1; |
|
45 | + $i = 1; |
|
46 | 46 | } |
47 | 47 | |
48 | 48 | if($i == 0){ |
49 | - $i = 1; |
|
49 | + $i = 1; |
|
50 | 50 | } |
51 | 51 | |
52 | 52 | if ($i == 0) { $i = 1; } |
53 | 53 | |
54 | 54 | if ($i == 0) { |
55 | - $i = 1; |
|
55 | + $i = 1; |
|
56 | 56 | } else { |
57 | - $i = 0; |
|
57 | + $i = 0; |
|
58 | 58 | } |
59 | 59 | |
60 | 60 | if ($i == 0) { |
61 | - $i = 1; |
|
61 | + $i = 1; |
|
62 | 62 | }else{ |
63 | - $i = 0; |
|
63 | + $i = 0; |
|
64 | 64 | } |
65 | 65 | |
66 | 66 | if ($i == 0) { $i = 1; } else { $i = 0; } |
67 | 67 | |
68 | 68 | if ($i == 0) { |
69 | - $i = 1; |
|
69 | + $i = 1; |
|
70 | 70 | } else if ($i == 2) { |
71 | - $i = 0; |
|
71 | + $i = 0; |
|
72 | 72 | } |
73 | 73 | |
74 | 74 | if ($i == 0) { |
75 | - $i = 1; |
|
75 | + $i = 1; |
|
76 | 76 | }else if($i == 2){ |
77 | - $i = 0; |
|
77 | + $i = 0; |
|
78 | 78 | } |
79 | 79 | |
80 | 80 | if ($i == 0) { $i = 1; } else if ($i == 2) { $i = 0; } |
81 | 81 | |
82 | 82 | if ($i == 0) { // comments are allowed |
83 | - $i = 1; |
|
83 | + $i = 1; |
|
84 | 84 | } |
85 | 85 | |
86 | 86 | if ($i == 0) {// comments are allowed |
87 | - $i = 1; |
|
87 | + $i = 1; |
|
88 | 88 | } |
89 | 89 | |
90 | 90 | if ($i == 0) { /* comments are allowed*/ |
91 | - $i = 1; |
|
91 | + $i = 1; |
|
92 | 92 | } |
93 | 93 | |
94 | 94 | if ($i == 0) |
95 | 95 | { // this is ok |
96 | - $i = 1; |
|
96 | + $i = 1; |
|
97 | 97 | } |
98 | 98 | |
99 | 99 | if ($i == 0) /* this is ok */ { |
100 | 100 | } |
101 | 101 | |
102 | 102 | try { |
103 | - $code = 'this'; |
|
103 | + $code = 'this'; |
|
104 | 104 | } catch (Exception $e) { |
105 | - // Caught! |
|
105 | + // Caught! |
|
106 | 106 | } |
107 | 107 | |
108 | 108 | try { $code = 'this'; } catch (Exception $e) { |
109 | - // Caught! |
|
109 | + // Caught! |
|
110 | 110 | } |
111 | 111 | |
112 | 112 | do { echo $i; |
@@ -114,7 +114,7 @@ discard block |
||
114 | 114 | |
115 | 115 | if ($i === 0) { |
116 | 116 | |
117 | - $i = 1 |
|
117 | + $i = 1 |
|
118 | 118 | } |
119 | 119 | |
120 | 120 | if ($a) { |
@@ -124,11 +124,11 @@ discard block |
||
124 | 124 | } |
125 | 125 | |
126 | 126 | foreach ($items as $item) { |
127 | - echo $item; |
|
127 | + echo $item; |
|
128 | 128 | } |
129 | 129 | |
130 | 130 | foreach($items as $item){ |
131 | - echo $item; |
|
131 | + echo $item; |
|
132 | 132 | } |
133 | 133 | |
134 | 134 | if ($a && $b) // && $c) |
@@ -136,29 +136,29 @@ discard block |
||
136 | 136 | } |
137 | 137 | |
138 | 138 | if ($a == 5) : |
139 | - echo "a equals 5"; |
|
140 | - echo "..."; |
|
139 | + echo "a equals 5"; |
|
140 | + echo "..."; |
|
141 | 141 | elseif ($a == 6) : |
142 | - echo "a equals 6"; |
|
143 | - echo "!!!"; |
|
142 | + echo "a equals 6"; |
|
143 | + echo "!!!"; |
|
144 | 144 | else : |
145 | - echo "a is neither 5 nor 6"; |
|
145 | + echo "a is neither 5 nor 6"; |
|
146 | 146 | endif; |
147 | 147 | |
148 | 148 | try { |
149 | - // try body |
|
149 | + // try body |
|
150 | 150 | } |
151 | 151 | catch (FirstExceptionType $e) { |
152 | - // catch body |
|
152 | + // catch body |
|
153 | 153 | } |
154 | 154 | catch (OtherExceptionType $e) { |
155 | - // catch body |
|
155 | + // catch body |
|
156 | 156 | } |
157 | 157 | |
158 | 158 | switch($foo) { |
159 | 159 | |
160 | - case 'bar': |
|
161 | - break; |
|
160 | + case 'bar': |
|
161 | + break; |
|
162 | 162 | |
163 | 163 | } |
164 | 164 | |
@@ -173,17 +173,17 @@ discard block |
||
173 | 173 | |
174 | 174 | <?php |
175 | 175 | if ($foo === 1) { |
176 | - ?> |
|
176 | + ?> |
|
177 | 177 | <table><tr><td> |
178 | 178 | <?php |
179 | - echo '2'; |
|
180 | - ?> |
|
179 | + echo '2'; |
|
180 | + ?> |
|
181 | 181 | </td></tr></table> |
182 | 182 | <?php |
183 | 183 | } |
184 | 184 | |
185 | 185 | if ($test) { /*one space after the bracket*/ |
186 | - echo 'true'; |
|
186 | + echo 'true'; |
|
187 | 187 | } |
188 | 188 | |
189 | 189 | ?> |
@@ -196,38 +196,38 @@ discard block |
||
196 | 196 | <?php endforeach; ?> |
197 | 197 | |
198 | 198 | <?php foreach ($formset['Fieldset'] as $fieldset) : |
199 | - ?> |
|
199 | + ?> |
|
200 | 200 | hello |
201 | 201 | <?php endforeach; ?> |
202 | 202 | |
203 | 203 | <?php |
204 | 204 | $a = 1; $b = true; |
205 | 205 | if (1 === $a) : |
206 | - if ($b) { |
|
207 | - echo 'b'; |
|
208 | - } else { |
|
209 | - echo 'not b'; |
|
210 | - } |
|
206 | + if ($b) { |
|
207 | + echo 'b'; |
|
208 | + } else { |
|
209 | + echo 'not b'; |
|
210 | + } |
|
211 | 211 | else : |
212 | - echo 'not 1'; |
|
212 | + echo 'not 1'; |
|
213 | 213 | endif; |
214 | 214 | |
215 | 215 | // @codingStandardsChangeSetting Squiz.ControlStructures.ControlSignature requiredSpacesBeforeColon 0 |
216 | 216 | |
217 | 217 | if ($a == 5): |
218 | - echo "a equals 5"; |
|
219 | - echo "..."; |
|
218 | + echo "a equals 5"; |
|
219 | + echo "..."; |
|
220 | 220 | elseif ($a == 6): |
221 | - echo "a equals 6"; |
|
222 | - echo "!!!"; |
|
221 | + echo "a equals 6"; |
|
222 | + echo "!!!"; |
|
223 | 223 | else: |
224 | - echo "a is neither 5 nor 6"; |
|
224 | + echo "a is neither 5 nor 6"; |
|
225 | 225 | endif; |
226 | 226 | |
227 | 227 | switch($foo) { |
228 | 228 | |
229 | - case 'bar': |
|
230 | - break; |
|
229 | + case 'bar': |
|
230 | + break; |
|
231 | 231 | |
232 | 232 | } |
233 | 233 | |
@@ -249,7 +249,7 @@ discard block |
||
249 | 249 | <?php endforeach; ?> |
250 | 250 | |
251 | 251 | <?php foreach ($formset['Fieldset'] as $fieldset): |
252 | - ?> |
|
252 | + ?> |
|
253 | 253 | hello |
254 | 254 | <?php endforeach; ?> |
255 | 255 | <?php |
@@ -272,22 +272,22 @@ discard block |
||
272 | 272 | } |
273 | 273 | |
274 | 274 | try { |
275 | - $x = 1; |
|
275 | + $x = 1; |
|
276 | 276 | } // stray comment here |
277 | 277 | catch (CustomException $exception) { |
278 | - $x = 2; |
|
278 | + $x = 2; |
|
279 | 279 | } |
280 | 280 | // phpcs:ignore Standard.Category.Sniff |
281 | 281 | catch (Exception $exception) { |
282 | - $x = 2; |
|
282 | + $x = 2; |
|
283 | 283 | } |
284 | 284 | finally { |
285 | - $x = 3; |
|
285 | + $x = 3; |
|
286 | 286 | } |
287 | 287 | |
288 | 288 | if ($this) { |
289 | - if ($that) |
|
290 | - foo(${$a[$b]}); |
|
289 | + if ($that) |
|
290 | + foo(${$a[$b]}); |
|
291 | 291 | } |
292 | 292 | |
293 | 293 | while ( $level-- ) ob_end_clean(); |
@@ -300,7 +300,7 @@ discard block |
||
300 | 300 | endwhile; |
301 | 301 | |
302 | 302 | $r = match ($x) { |
303 | - 1 => 1, |
|
303 | + 1 => 1, |
|
304 | 304 | }; |
305 | 305 | |
306 | 306 | $r = match($x){1 => 1}; |
@@ -59,7 +59,7 @@ discard block |
||
59 | 59 | |
60 | 60 | if ($i == 0) { |
61 | 61 | $i = 1; |
62 | -}else{ |
|
62 | +} else{ |
|
63 | 63 | $i = 0; |
64 | 64 | } |
65 | 65 | |
@@ -73,7 +73,7 @@ discard block |
||
73 | 73 | |
74 | 74 | if ($i == 0) { |
75 | 75 | $i = 1; |
76 | -}else if($i == 2){ |
|
76 | +} else if($i == 2){ |
|
77 | 77 | $i = 0; |
78 | 78 | } |
79 | 79 | |
@@ -96,11 +96,13 @@ discard block |
||
96 | 96 | $i = 1; |
97 | 97 | } |
98 | 98 | |
99 | -if ($i == 0) /* this is ok */ { |
|
99 | +if ($i == 0) { |
|
100 | + /* this is ok */ { |
|
100 | 101 | } |
101 | 102 | |
102 | 103 | try { |
103 | 104 | $code = 'this'; |
105 | +} |
|
104 | 106 | } catch (Exception $e) { |
105 | 107 | // Caught! |
106 | 108 | } |
@@ -119,8 +121,7 @@ discard block |
||
119 | 121 | |
120 | 122 | if ($a) { |
121 | 123 | |
122 | -} |
|
123 | -elseif ($b) { |
|
124 | +} elseif ($b) { |
|
124 | 125 | } |
125 | 126 | |
126 | 127 | foreach ($items as $item) { |
@@ -131,27 +132,29 @@ discard block |
||
131 | 132 | echo $item; |
132 | 133 | } |
133 | 134 | |
134 | -if ($a && $b) // && $c) |
|
135 | +if ($a && $b) { |
|
136 | + // && $c) |
|
135 | 137 | { |
136 | 138 | } |
137 | 139 | |
138 | 140 | if ($a == 5) : |
139 | 141 | echo "a equals 5"; |
142 | +} |
|
140 | 143 | echo "..."; |
141 | 144 | elseif ($a == 6) : |
142 | 145 | echo "a equals 6"; |
143 | 146 | echo "!!!"; |
144 | -else : |
|
147 | +else { |
|
148 | + : |
|
145 | 149 | echo "a is neither 5 nor 6"; |
150 | +} |
|
146 | 151 | endif; |
147 | 152 | |
148 | 153 | try { |
149 | 154 | // try body |
150 | -} |
|
151 | -catch (FirstExceptionType $e) { |
|
155 | +} catch (FirstExceptionType $e) { |
|
152 | 156 | // catch body |
153 | -} |
|
154 | -catch (OtherExceptionType $e) { |
|
157 | +} catch (OtherExceptionType $e) { |
|
155 | 158 | // catch body |
156 | 159 | } |
157 | 160 | |
@@ -207,9 +210,10 @@ discard block |
||
207 | 210 | echo 'b'; |
208 | 211 | } else { |
209 | 212 | echo 'not b'; |
210 | - } |
|
211 | -else : |
|
213 | + } else { |
|
214 | + : |
|
212 | 215 | echo 'not 1'; |
216 | +} |
|
213 | 217 | endif; |
214 | 218 | |
215 | 219 | // @codingStandardsChangeSetting Squiz.ControlStructures.ControlSignature requiredSpacesBeforeColon 0 |
@@ -220,8 +224,10 @@ discard block |
||
220 | 224 | elseif ($a == 6): |
221 | 225 | echo "a equals 6"; |
222 | 226 | echo "!!!"; |
223 | -else: |
|
227 | +else { |
|
228 | + : |
|
224 | 229 | echo "a is neither 5 nor 6"; |
230 | +} |
|
225 | 231 | endif; |
226 | 232 | |
227 | 233 | switch($foo) { |
@@ -280,20 +286,23 @@ discard block |
||
280 | 286 | // phpcs:ignore Standard.Category.Sniff |
281 | 287 | catch (Exception $exception) { |
282 | 288 | $x = 2; |
283 | -} |
|
284 | -finally { |
|
289 | +} finally { |
|
285 | 290 | $x = 3; |
286 | 291 | } |
287 | 292 | |
288 | 293 | if ($this) { |
289 | - if ($that) |
|
290 | - foo(${$a[$b]}); |
|
291 | -} |
|
294 | + if ($that) { |
|
295 | + foo(${$a[$b]}); |
|
296 | + } |
|
297 | + } |
|
292 | 298 | |
293 | -while ( $level-- ) ob_end_clean(); |
|
299 | +while ( $level-- ) { |
|
300 | + ob_end_clean(); |
|
301 | +} |
|
294 | 302 | |
295 | -while ( $level-- ) |
|
303 | +while ( $level-- ) { |
|
296 | 304 | ob_end_clean(); |
305 | +} |
|
297 | 306 | |
298 | 307 | while ( $level-- ): |
299 | 308 | ob_end_clean(); |
@@ -2,12 +2,12 @@ discard block |
||
2 | 2 | $i = 0; |
3 | 3 | do { |
4 | 4 | echo $i; |
5 | -} while ($i > 0); |
|
5 | +}while ($i > 0); |
|
6 | 6 | |
7 | 7 | do |
8 | 8 | { |
9 | 9 | echo $i; |
10 | -} while ($i > 0); |
|
10 | +}while ($i > 0); |
|
11 | 11 | |
12 | 12 | do |
13 | 13 | { |
@@ -15,17 +15,17 @@ discard block |
||
15 | 15 | } |
16 | 16 | while ($i > 0); |
17 | 17 | |
18 | -do { echo $i; } while ($i > 0); |
|
18 | +do { echo $i; }while ($i > 0); |
|
19 | 19 | |
20 | -do{ |
|
20 | +do { |
|
21 | 21 | echo $i; |
22 | -}while($i > 0); |
|
22 | +}while ($i > 0); |
|
23 | 23 | |
24 | 24 | while ($i < 1) { |
25 | 25 | echo $i; |
26 | 26 | } |
27 | 27 | |
28 | -while($i < 1){ |
|
28 | +while ($i < 1) { |
|
29 | 29 | echo $i; |
30 | 30 | } |
31 | 31 | |
@@ -35,7 +35,7 @@ discard block |
||
35 | 35 | echo $i; |
36 | 36 | } |
37 | 37 | |
38 | -for($i = 1; $i < 1; $i++){ |
|
38 | +for ($i = 1; $i < 1; $i++) { |
|
39 | 39 | echo $i; |
40 | 40 | } |
41 | 41 | |
@@ -45,7 +45,7 @@ discard block |
||
45 | 45 | $i = 1; |
46 | 46 | } |
47 | 47 | |
48 | -if($i == 0){ |
|
48 | +if ($i == 0) { |
|
49 | 49 | $i = 1; |
50 | 50 | } |
51 | 51 | |
@@ -59,7 +59,7 @@ discard block |
||
59 | 59 | |
60 | 60 | if ($i == 0) { |
61 | 61 | $i = 1; |
62 | -}else{ |
|
62 | +} else { |
|
63 | 63 | $i = 0; |
64 | 64 | } |
65 | 65 | |
@@ -73,7 +73,7 @@ discard block |
||
73 | 73 | |
74 | 74 | if ($i == 0) { |
75 | 75 | $i = 1; |
76 | -}else if($i == 2){ |
|
76 | +} else if ($i == 2) { |
|
77 | 77 | $i = 0; |
78 | 78 | } |
79 | 79 | |
@@ -110,7 +110,7 @@ discard block |
||
110 | 110 | } |
111 | 111 | |
112 | 112 | do { echo $i; |
113 | -} while ($i > 0); |
|
113 | +}while ($i > 0); |
|
114 | 114 | |
115 | 115 | if ($i === 0) { |
116 | 116 | |
@@ -127,7 +127,7 @@ discard block |
||
127 | 127 | echo $item; |
128 | 128 | } |
129 | 129 | |
130 | -foreach($items as $item){ |
|
130 | +foreach ($items as $item) { |
|
131 | 131 | echo $item; |
132 | 132 | } |
133 | 133 | |
@@ -155,7 +155,7 @@ discard block |
||
155 | 155 | // catch body |
156 | 156 | } |
157 | 157 | |
158 | -switch($foo) { |
|
158 | +switch ($foo) { |
|
159 | 159 | |
160 | 160 | case 'bar': |
161 | 161 | break; |
@@ -167,7 +167,7 @@ discard block |
||
167 | 167 | |
168 | 168 | ?> |
169 | 169 | |
170 | -<?php while($row = $data->getRow()): ?> |
|
170 | +<?php while ($row = $data->getRow()): ?> |
|
171 | 171 | <p><?= $val ?></p> |
172 | 172 | <?php endwhile; ?> |
173 | 173 | |
@@ -182,13 +182,13 @@ discard block |
||
182 | 182 | <?php |
183 | 183 | } |
184 | 184 | |
185 | -if ($test) { /*one space after the bracket*/ |
|
185 | +if ($test) { /*one space after the bracket*/ |
|
186 | 186 | echo 'true'; |
187 | 187 | } |
188 | 188 | |
189 | 189 | ?> |
190 | -<?php foreach($formset['Fieldset'] as $fieldset): ?> |
|
191 | - <?php foreach($fieldset['Field'] as $field): ?> |
|
190 | +<?php foreach ($formset['Fieldset'] as $fieldset): ?> |
|
191 | + <?php foreach ($fieldset['Field'] as $field): ?> |
|
192 | 192 | <?php endforeach; ?> |
193 | 193 | <?php endforeach; ?> |
194 | 194 | |
@@ -224,7 +224,7 @@ discard block |
||
224 | 224 | echo "a is neither 5 nor 6"; |
225 | 225 | endif; |
226 | 226 | |
227 | -switch($foo) { |
|
227 | +switch ($foo) { |
|
228 | 228 | |
229 | 229 | case 'bar': |
230 | 230 | break; |
@@ -236,12 +236,12 @@ discard block |
||
236 | 236 | |
237 | 237 | ?> |
238 | 238 | |
239 | -<?php while($row = $data->getRow()) : ?> |
|
239 | +<?php while ($row = $data->getRow()) : ?> |
|
240 | 240 | <p><?= $val ?></p> |
241 | 241 | <?php endwhile; ?> |
242 | 242 | |
243 | -<?php foreach($formset['Fieldset'] as $fieldset) : ?> |
|
244 | - <?php foreach($fieldset['Field'] as $field) : ?> |
|
243 | +<?php foreach ($formset['Fieldset'] as $fieldset) : ?> |
|
244 | + <?php foreach ($fieldset['Field'] as $field) : ?> |
|
245 | 245 | <?php endforeach; ?> |
246 | 246 | <?php endforeach; ?> |
247 | 247 | |
@@ -290,12 +290,12 @@ discard block |
||
290 | 290 | foo(${$a[$b]}); |
291 | 291 | } |
292 | 292 | |
293 | -while ( $level-- ) ob_end_clean(); |
|
293 | +while ($level--) ob_end_clean(); |
|
294 | 294 | |
295 | -while ( $level-- ) |
|
295 | +while ($level--) |
|
296 | 296 | ob_end_clean(); |
297 | 297 | |
298 | -while ( $level-- ): |
|
298 | +while ($level--): |
|
299 | 299 | ob_end_clean(); |
300 | 300 | endwhile; |
301 | 301 |
@@ -15,42 +15,42 @@ |
||
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 | - 8 => 2, |
|
30 | - 11 => 2, |
|
31 | - 14 => 2, |
|
32 | - 17 => 5, |
|
33 | - 21 => 7, |
|
34 | - 26 => 2, |
|
35 | - 28 => 2, |
|
36 | - ]; |
|
37 | - |
|
38 | - }//end getErrorList() |
|
39 | - |
|
40 | - |
|
41 | - /** |
|
42 | - * Returns the lines where warnings should occur. |
|
43 | - * |
|
44 | - * The key of the array should represent the line number and the value |
|
45 | - * should represent the number of warnings that should occur on that line. |
|
46 | - * |
|
47 | - * @return array<int, int> |
|
48 | - */ |
|
49 | - public function getWarningList() |
|
50 | - { |
|
51 | - return []; |
|
52 | - |
|
53 | - }//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 | + 8 => 2, |
|
30 | + 11 => 2, |
|
31 | + 14 => 2, |
|
32 | + 17 => 5, |
|
33 | + 21 => 7, |
|
34 | + 26 => 2, |
|
35 | + 28 => 2, |
|
36 | + ]; |
|
37 | + |
|
38 | + }//end getErrorList() |
|
39 | + |
|
40 | + |
|
41 | + /** |
|
42 | + * Returns the lines where warnings should occur. |
|
43 | + * |
|
44 | + * The key of the array should represent the line number and the value |
|
45 | + * should represent the number of warnings that should occur on that line. |
|
46 | + * |
|
47 | + * @return array<int, int> |
|
48 | + */ |
|
49 | + public function getWarningList() |
|
50 | + { |
|
51 | + return []; |
|
52 | + |
|
53 | + }//end getWarningList() |
|
54 | 54 | |
55 | 55 | |
56 | 56 | }//end class |
@@ -25,7 +25,7 @@ |
||
25 | 25 | * |
26 | 26 | * @return array<int, int> |
27 | 27 | */ |
28 | - public function getErrorList($testFile='ControlSignatureUnitTest.inc') |
|
28 | + public function getErrorList($testFile = 'ControlSignatureUnitTest.inc') |
|
29 | 29 | { |
30 | 30 | $errors = [ |
31 | 31 | 7 => 1, |
@@ -15,88 +15,88 @@ |
||
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='ControlSignatureUnitTest.inc') |
|
29 | - { |
|
30 | - $errors = [ |
|
31 | - 7 => 1, |
|
32 | - 12 => 1, |
|
33 | - 15 => 1, |
|
34 | - 18 => 1, |
|
35 | - 20 => 1, |
|
36 | - 22 => 2, |
|
37 | - 28 => 2, |
|
38 | - 32 => 1, |
|
39 | - 38 => 2, |
|
40 | - 42 => 1, |
|
41 | - 48 => 2, |
|
42 | - 52 => 1, |
|
43 | - 62 => 2, |
|
44 | - 66 => 2, |
|
45 | - 76 => 4, |
|
46 | - 80 => 2, |
|
47 | - 94 => 1, |
|
48 | - 99 => 1, |
|
49 | - 108 => 1, |
|
50 | - 112 => 1, |
|
51 | - ]; |
|
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='ControlSignatureUnitTest.inc') |
|
29 | + { |
|
30 | + $errors = [ |
|
31 | + 7 => 1, |
|
32 | + 12 => 1, |
|
33 | + 15 => 1, |
|
34 | + 18 => 1, |
|
35 | + 20 => 1, |
|
36 | + 22 => 2, |
|
37 | + 28 => 2, |
|
38 | + 32 => 1, |
|
39 | + 38 => 2, |
|
40 | + 42 => 1, |
|
41 | + 48 => 2, |
|
42 | + 52 => 1, |
|
43 | + 62 => 2, |
|
44 | + 66 => 2, |
|
45 | + 76 => 4, |
|
46 | + 80 => 2, |
|
47 | + 94 => 1, |
|
48 | + 99 => 1, |
|
49 | + 108 => 1, |
|
50 | + 112 => 1, |
|
51 | + ]; |
|
52 | 52 | |
53 | - if ($testFile === 'ControlSignatureUnitTest.inc') { |
|
54 | - $errors[122] = 1; |
|
55 | - $errors[130] = 2; |
|
56 | - $errors[134] = 1; |
|
57 | - $errors[150] = 1; |
|
58 | - $errors[153] = 1; |
|
59 | - $errors[158] = 1; |
|
60 | - $errors[165] = 1; |
|
61 | - $errors[170] = 2; |
|
62 | - $errors[185] = 1; |
|
63 | - $errors[190] = 2; |
|
64 | - $errors[191] = 2; |
|
65 | - $errors[195] = 1; |
|
66 | - $errors[227] = 1; |
|
67 | - $errors[234] = 1; |
|
68 | - $errors[239] = 2; |
|
69 | - $errors[243] = 2; |
|
70 | - $errors[244] = 2; |
|
71 | - $errors[248] = 1; |
|
72 | - $errors[259] = 1; |
|
73 | - $errors[262] = 1; |
|
74 | - $errors[267] = 1; |
|
75 | - $errors[269] = 1; |
|
76 | - $errors[276] = 1; |
|
77 | - $errors[279] = 1; |
|
78 | - $errors[283] = 1; |
|
79 | - $errors[306] = 3; |
|
80 | - }//end if |
|
53 | + if ($testFile === 'ControlSignatureUnitTest.inc') { |
|
54 | + $errors[122] = 1; |
|
55 | + $errors[130] = 2; |
|
56 | + $errors[134] = 1; |
|
57 | + $errors[150] = 1; |
|
58 | + $errors[153] = 1; |
|
59 | + $errors[158] = 1; |
|
60 | + $errors[165] = 1; |
|
61 | + $errors[170] = 2; |
|
62 | + $errors[185] = 1; |
|
63 | + $errors[190] = 2; |
|
64 | + $errors[191] = 2; |
|
65 | + $errors[195] = 1; |
|
66 | + $errors[227] = 1; |
|
67 | + $errors[234] = 1; |
|
68 | + $errors[239] = 2; |
|
69 | + $errors[243] = 2; |
|
70 | + $errors[244] = 2; |
|
71 | + $errors[248] = 1; |
|
72 | + $errors[259] = 1; |
|
73 | + $errors[262] = 1; |
|
74 | + $errors[267] = 1; |
|
75 | + $errors[269] = 1; |
|
76 | + $errors[276] = 1; |
|
77 | + $errors[279] = 1; |
|
78 | + $errors[283] = 1; |
|
79 | + $errors[306] = 3; |
|
80 | + }//end if |
|
81 | 81 | |
82 | - return $errors; |
|
82 | + return $errors; |
|
83 | 83 | |
84 | - }//end getErrorList() |
|
84 | + }//end getErrorList() |
|
85 | 85 | |
86 | 86 | |
87 | - /** |
|
88 | - * Returns the lines where warnings should occur. |
|
89 | - * |
|
90 | - * The key of the array should represent the line number and the value |
|
91 | - * should represent the number of warnings that should occur on that line. |
|
92 | - * |
|
93 | - * @return array<int, int> |
|
94 | - */ |
|
95 | - public function getWarningList() |
|
96 | - { |
|
97 | - return []; |
|
87 | + /** |
|
88 | + * Returns the lines where warnings should occur. |
|
89 | + * |
|
90 | + * The key of the array should represent the line number and the value |
|
91 | + * should represent the number of warnings that should occur on that line. |
|
92 | + * |
|
93 | + * @return array<int, int> |
|
94 | + */ |
|
95 | + public function getWarningList() |
|
96 | + { |
|
97 | + return []; |
|
98 | 98 | |
99 | - }//end getWarningList() |
|
99 | + }//end getWarningList() |
|
100 | 100 | |
101 | 101 | |
102 | 102 | }//end class |
@@ -10,33 +10,33 @@ |
||
10 | 10 | echo 'var is '.(($var < 0) ? 'negative' : 'positive'); |
11 | 11 | |
12 | 12 | echo 'var is '.(($var < 0) |
13 | - ? 'negative' |
|
14 | - : 'positive'); |
|
13 | + ? 'negative' |
|
14 | + : 'positive'); |
|
15 | 15 | |
16 | 16 | $args = array( |
17 | - '"'.$this->id.'"', |
|
18 | - '"'.$this->stepInfo['title'].'"', |
|
19 | - '"'.((isset($this->stepInfo['description']) === TRUE) ? $this->stepInfo['description'] : '').'"', |
|
20 | - '"'.(isset($this->stepInfo['description']) === TRUE ? $this->stepInfo['description'] : '').'"', |
|
21 | - '"'.$this->stepInfo['title'].'"', |
|
22 | - ); |
|
17 | + '"'.$this->id.'"', |
|
18 | + '"'.$this->stepInfo['title'].'"', |
|
19 | + '"'.((isset($this->stepInfo['description']) === TRUE) ? $this->stepInfo['description'] : '').'"', |
|
20 | + '"'.(isset($this->stepInfo['description']) === TRUE ? $this->stepInfo['description'] : '').'"', |
|
21 | + '"'.$this->stepInfo['title'].'"', |
|
22 | + ); |
|
23 | 23 | |
24 | 24 | echo (TRUE)?'Hello':'Bye'; |
25 | 25 | |
26 | 26 | $array = array( |
27 | - 'one' => ($test == 1) ? true : false, |
|
28 | - 'two' => (($test == 1) ? true : false), |
|
29 | - 'three' => (($test == 1) ? true : false) |
|
27 | + 'one' => ($test == 1) ? true : false, |
|
28 | + 'two' => (($test == 1) ? true : false), |
|
29 | + 'three' => (($test == 1) ? true : false) |
|
30 | 30 | ); |
31 | 31 | $var = ($test == 1) ? true : false; |
32 | 32 | $var = (myFunc(1,2,3) == 1) ? true : false; |
33 | 33 | |
34 | 34 | set('config', function() { |
35 | - $foo = ($bar === "on") ? "1" : "2"; |
|
35 | + $foo = ($bar === "on") ? "1" : "2"; |
|
36 | 36 | }); |
37 | 37 | |
38 | 38 | $config = function() { |
39 | - $foo = ($bar === "on") ? "1" : "2"; |
|
39 | + $foo = ($bar === "on") ? "1" : "2"; |
|
40 | 40 | }; |
41 | 41 | |
42 | 42 | rand(0, 1) ? 'ěščřžýáí' : NULL; |
@@ -2,12 +2,12 @@ discard block |
||
2 | 2 | |
3 | 3 | echo 'var is '.(($var < 0) ? 'negative' : 'positive'); |
4 | 4 | echo 'var is '.($var < 0 ? 'negative' : 'positive'); |
5 | -echo 'var is '.(($var < 0) ? 'negative' :'positive'); |
|
6 | -echo 'var is '.(($var < 0) ? 'negative': 'positive'); |
|
7 | -echo 'var is '.(($var < 0) ? 'negative' : 'positive'); |
|
8 | -echo 'var is '.(($var < 0) ? 'negative' : 'positive'); |
|
9 | -echo 'var is '.(($var < 0) ? 'negative' : 'positive'); |
|
10 | -echo 'var is '.(($var < 0) ? 'negative' : 'positive'); |
|
5 | +echo 'var is '.(($var < 0) ? 'negative' : 'positive'); |
|
6 | +echo 'var is '.(($var < 0) ? 'negative' : 'positive'); |
|
7 | +echo 'var is '.(($var < 0) ? 'negative' : 'positive'); |
|
8 | +echo 'var is '.(($var < 0) ? 'negative' : 'positive'); |
|
9 | +echo 'var is '.(($var < 0) ? 'negative' : 'positive'); |
|
10 | +echo 'var is '.(($var < 0) ? 'negative' : 'positive'); |
|
11 | 11 | |
12 | 12 | echo 'var is '.(($var < 0) |
13 | 13 | ? 'negative' |
@@ -21,7 +21,7 @@ discard block |
||
21 | 21 | '"'.$this->stepInfo['title'].'"', |
22 | 22 | ); |
23 | 23 | |
24 | -echo (TRUE)?'Hello':'Bye'; |
|
24 | +echo (TRUE) ? 'Hello' : 'Bye'; |
|
25 | 25 | |
26 | 26 | $array = array( |
27 | 27 | 'one' => ($test == 1) ? true : false, |
@@ -29,7 +29,7 @@ discard block |
||
29 | 29 | 'three' => (($test == 1) ? true : false) |
30 | 30 | ); |
31 | 31 | $var = ($test == 1) ? true : false; |
32 | -$var = (myFunc(1,2,3) == 1) ? true : false; |
|
32 | +$var = (myFunc(1, 2, 3) == 1) ? true : false; |
|
33 | 33 | |
34 | 34 | set('config', function() { |
35 | 35 | $foo = ($bar === "on") ? "1" : "2"; |
@@ -41,8 +41,7 @@ discard block |
||
41 | 41 | |
42 | 42 | rand(0, 1) ? 'ěščřžýáí' : NULL; |
43 | 43 | |
44 | -$c = ($argv[1]) ? : ""; |
|
44 | +$c = ($argv[1]) ?: ""; |
|
45 | 45 | $filepath = realpath($argv[1]) ?: $argv[1]; |
46 | 46 | $c = ($argv[1]) ? /* comment */ : ""; |
47 | -$c = ($argv[1]) ? |
|
48 | -: ""; |
|
47 | +$c = ($argv[1]) ?: ""; |
@@ -7,7 +7,7 @@ |
||
7 | 7 | wHile ($i < 10) {} |
8 | 8 | |
9 | 9 | DO { |
10 | -} While ($1 < 10) |
|
10 | +}While ($1 < 10) |
|
11 | 11 | |
12 | 12 | Switch ($condition) {} |
13 | 13 |
@@ -7,7 +7,7 @@ discard block |
||
7 | 7 | wHile ($i < 10) {} |
8 | 8 | |
9 | 9 | DO { |
10 | -} While ($1 < 10) |
|
10 | +} While ($1 < 10) { |
|
11 | 11 | |
12 | 12 | Switch ($condition) {} |
13 | 13 | |
@@ -22,3 +22,4 @@ discard block |
||
22 | 22 | } |
23 | 23 | |
24 | 24 | $r = MATCH ($x) {}; |
25 | +} |
@@ -30,7 +30,7 @@ |
||
30 | 30 | // phpcs:set Squiz.ControlStructures.ForEachLoopDeclaration requiredSpacesBeforeClose 0 |
31 | 31 | |
32 | 32 | foreach ([ |
33 | - 'foo' => 'bar', |
|
34 | - 'foobaz' => 'bazzy', |
|
35 | - ] as $key => $value) { |
|
33 | + 'foo' => 'bar', |
|
34 | + 'foobaz' => 'bazzy', |
|
35 | + ] as $key => $value) { |
|
36 | 36 | } |
@@ -5,7 +5,7 @@ discard block |
||
5 | 5 | } |
6 | 6 | |
7 | 7 | // Invalid. |
8 | -foreach ( $something as $blah => $that ) { |
|
8 | +foreach ($something as $blah => $that) { |
|
9 | 9 | } |
10 | 10 | |
11 | 11 | foreach ($something as $blah => $that) { |
@@ -18,14 +18,14 @@ discard block |
||
18 | 18 | } |
19 | 19 | |
20 | 20 | // The works. |
21 | -foreach ( $something aS $blah => $that ) { |
|
21 | +foreach ($something aS $blah => $that) { |
|
22 | 22 | } |
23 | 23 | |
24 | 24 | // phpcs:set Squiz.ControlStructures.ForEachLoopDeclaration requiredSpacesAfterOpen 1 |
25 | 25 | // phpcs:set Squiz.ControlStructures.ForEachLoopDeclaration requiredSpacesBeforeClose 1 |
26 | 26 | foreach ($something as $blah => $that) {} |
27 | -foreach ( $something as $blah => $that ) {} |
|
28 | -foreach ( $something as $blah => $that ) {} |
|
27 | +foreach ($something as $blah => $that) {} |
|
28 | +foreach ($something as $blah => $that) {} |
|
29 | 29 | // phpcs:set Squiz.ControlStructures.ForEachLoopDeclaration requiredSpacesAfterOpen 0 |
30 | 30 | // phpcs:set Squiz.ControlStructures.ForEachLoopDeclaration requiredSpacesBeforeClose 0 |
31 | 31 |
@@ -15,37 +15,37 @@ |
||
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 | - 8 => 1, |
|
30 | - 13 => 1, |
|
31 | - ]; |
|
32 | - |
|
33 | - }//end getErrorList() |
|
34 | - |
|
35 | - |
|
36 | - /** |
|
37 | - * Returns the lines where warnings should occur. |
|
38 | - * |
|
39 | - * The key of the array should represent the line number and the value |
|
40 | - * should represent the number of warnings that should occur on that line. |
|
41 | - * |
|
42 | - * @return array<int, int> |
|
43 | - */ |
|
44 | - public function getWarningList() |
|
45 | - { |
|
46 | - return []; |
|
47 | - |
|
48 | - }//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 | + 8 => 1, |
|
30 | + 13 => 1, |
|
31 | + ]; |
|
32 | + |
|
33 | + }//end getErrorList() |
|
34 | + |
|
35 | + |
|
36 | + /** |
|
37 | + * Returns the lines where warnings should occur. |
|
38 | + * |
|
39 | + * The key of the array should represent the line number and the value |
|
40 | + * should represent the number of warnings that should occur on that line. |
|
41 | + * |
|
42 | + * @return array<int, int> |
|
43 | + */ |
|
44 | + public function getWarningList() |
|
45 | + { |
|
46 | + return []; |
|
47 | + |
|
48 | + }//end getWarningList() |
|
49 | 49 | |
50 | 50 | |
51 | 51 | }//end class |
@@ -2,5 +2,5 @@ |
||
2 | 2 | function myFunc($blah, $x, $blah) {} |
3 | 3 | function myFunc($a, $b, $c) {} |
4 | 4 | function myFunc($a, $a, $a) {} |
5 | -function myFunc($a='1', $b='1', $a='2') {} |
|
5 | +function myFunc($a = '1', $b = '1', $a = '2') {} |
|
6 | 6 | ?> |