@@ -16,47 +16,47 @@ |
||
16 | 16 | { |
17 | 17 | |
18 | 18 | |
19 | - /** |
|
20 | - * Returns the lines where errors should occur. |
|
21 | - * |
|
22 | - * The key of the array should represent the line number and the value |
|
23 | - * should represent the number of errors that should occur on that line. |
|
24 | - * |
|
25 | - * @param string $testFile The name of the file being tested. |
|
26 | - * |
|
27 | - * @return array<int, int> |
|
28 | - */ |
|
29 | - public function getErrorList($testFile='FixmeUnitTest.inc') |
|
30 | - { |
|
31 | - return [ |
|
32 | - 3 => 1, |
|
33 | - 4 => 1, |
|
34 | - 7 => 1, |
|
35 | - 10 => 1, |
|
36 | - 13 => 1, |
|
37 | - 16 => 1, |
|
38 | - 18 => 1, |
|
39 | - 21 => 1, |
|
40 | - ]; |
|
41 | - |
|
42 | - }//end getErrorList() |
|
43 | - |
|
44 | - |
|
45 | - /** |
|
46 | - * Returns the lines where warnings should occur. |
|
47 | - * |
|
48 | - * The key of the array should represent the line number and the value |
|
49 | - * should represent the number of warnings 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 getWarningList($testFile='FixmeUnitTest.inc') |
|
56 | - { |
|
57 | - return []; |
|
58 | - |
|
59 | - }//end getWarningList() |
|
19 | + /** |
|
20 | + * Returns the lines where errors should occur. |
|
21 | + * |
|
22 | + * The key of the array should represent the line number and the value |
|
23 | + * should represent the number of errors that should occur on that line. |
|
24 | + * |
|
25 | + * @param string $testFile The name of the file being tested. |
|
26 | + * |
|
27 | + * @return array<int, int> |
|
28 | + */ |
|
29 | + public function getErrorList($testFile='FixmeUnitTest.inc') |
|
30 | + { |
|
31 | + return [ |
|
32 | + 3 => 1, |
|
33 | + 4 => 1, |
|
34 | + 7 => 1, |
|
35 | + 10 => 1, |
|
36 | + 13 => 1, |
|
37 | + 16 => 1, |
|
38 | + 18 => 1, |
|
39 | + 21 => 1, |
|
40 | + ]; |
|
41 | + |
|
42 | + }//end getErrorList() |
|
43 | + |
|
44 | + |
|
45 | + /** |
|
46 | + * Returns the lines where warnings should occur. |
|
47 | + * |
|
48 | + * The key of the array should represent the line number and the value |
|
49 | + * should represent the number of warnings 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 getWarningList($testFile='FixmeUnitTest.inc') |
|
56 | + { |
|
57 | + return []; |
|
58 | + |
|
59 | + }//end getWarningList() |
|
60 | 60 | |
61 | 61 | |
62 | 62 | }//end class |
@@ -26,7 +26,7 @@ discard block |
||
26 | 26 | * |
27 | 27 | * @return array<int, int> |
28 | 28 | */ |
29 | - public function getErrorList($testFile='FixmeUnitTest.inc') |
|
29 | + public function getErrorList( $testFile = 'FixmeUnitTest.inc' ) |
|
30 | 30 | { |
31 | 31 | return [ |
32 | 32 | 3 => 1, |
@@ -52,9 +52,9 @@ discard block |
||
52 | 52 | * |
53 | 53 | * @return array<int, int> |
54 | 54 | */ |
55 | - public function getWarningList($testFile='FixmeUnitTest.inc') |
|
55 | + public function getWarningList( $testFile = 'FixmeUnitTest.inc' ) |
|
56 | 56 | { |
57 | - return []; |
|
57 | + return [ ]; |
|
58 | 58 | |
59 | 59 | }//end getWarningList() |
60 | 60 |
@@ -12,8 +12,7 @@ discard block |
||
12 | 12 | |
13 | 13 | use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; |
14 | 14 | |
15 | -class FixmeUnitTest extends AbstractSniffUnitTest |
|
16 | -{ |
|
15 | +class FixmeUnitTest extends AbstractSniffUnitTest { |
|
17 | 16 | |
18 | 17 | |
19 | 18 | /** |
@@ -26,8 +25,7 @@ discard block |
||
26 | 25 | * |
27 | 26 | * @return array<int, int> |
28 | 27 | */ |
29 | - public function getErrorList($testFile='FixmeUnitTest.inc') |
|
30 | - { |
|
28 | + public function getErrorList($testFile='FixmeUnitTest.inc') { |
|
31 | 29 | return [ |
32 | 30 | 3 => 1, |
33 | 31 | 4 => 1, |
@@ -52,8 +50,7 @@ discard block |
||
52 | 50 | * |
53 | 51 | * @return array<int, int> |
54 | 52 | */ |
55 | - public function getWarningList($testFile='FixmeUnitTest.inc') |
|
56 | - { |
|
53 | + public function getWarningList($testFile='FixmeUnitTest.inc') { |
|
57 | 54 | return []; |
58 | 55 | |
59 | 56 | }//end getWarningList() |
@@ -213,15 +213,15 @@ discard block |
||
213 | 213 | |
214 | 214 | /**doc comment */ |
215 | 215 | |
216 | - /** |
|
217 | - * Document behaviour with missing blank lines with indented docblocks. |
|
218 | - * @param |
|
219 | - * @param |
|
220 | - * @tag one |
|
221 | - * |
|
222 | - */ |
|
216 | + /** |
|
217 | + * Document behaviour with missing blank lines with indented docblocks. |
|
218 | + * @param |
|
219 | + * @param |
|
220 | + * @tag one |
|
221 | + * |
|
222 | + */ |
|
223 | 223 | |
224 | - /** Indented doc comment */ |
|
224 | + /** Indented doc comment */ |
|
225 | 225 | |
226 | 226 | /** |
227 | 227 | * Verify and document sniff behaviour when the "tag value" is indented with a mix of tabs and spaces. |
@@ -249,4 +249,3 @@ discard block |
||
249 | 249 | * @link http://pear.php.net/package/PHP_CodeSniffer |
250 | 250 | */ |
251 | 251 | |
252 | -/** No docblock close tag. Must be last test without new line. |
|
253 | 252 | \ No newline at end of file |
@@ -249,4 +249,3 @@ |
||
249 | 249 | * @link http://pear.php.net/package/PHP_CodeSniffer |
250 | 250 | */ |
251 | 251 | |
252 | -/** No docblock close tag. Must be last test without new line. |
|
253 | 252 | \ No newline at end of file |
@@ -249,4 +249,3 @@ |
||
249 | 249 | * @link http://pear.php.net/package/PHP_CodeSniffer |
250 | 250 | */ |
251 | 251 | |
252 | -/** No docblock close tag. Must be last test without new line. |
|
253 | 252 | \ No newline at end of file |
@@ -249,4 +249,3 @@ |
||
249 | 249 | * @link http://pear.php.net/package/PHP_CodeSniffer |
250 | 250 | */ |
251 | 251 | |
252 | -/** No docblock close tag. Must be last test without new line. |
|
253 | 252 | \ No newline at end of file |
@@ -249,4 +249,3 @@ |
||
249 | 249 | * @link http://pear.php.net/package/PHP_CodeSniffer |
250 | 250 | */ |
251 | 251 | |
252 | -/** No docblock close tag. Must be last test without new line. |
|
253 | 252 | \ No newline at end of file |
@@ -15,97 +15,97 @@ |
||
15 | 15 | { |
16 | 16 | |
17 | 17 | |
18 | - /** |
|
19 | - * Get a list of CLI values to set before the file is tested. |
|
20 | - * |
|
21 | - * @param string $testFile The name of the file being tested. |
|
22 | - * @param \PHP_CodeSniffer\Config $config The config data for the test run. |
|
23 | - * |
|
24 | - * @return void |
|
25 | - */ |
|
26 | - public function setCliValues($testFile, $config) |
|
27 | - { |
|
28 | - $config->tabWidth = 4; |
|
18 | + /** |
|
19 | + * Get a list of CLI values to set before the file is tested. |
|
20 | + * |
|
21 | + * @param string $testFile The name of the file being tested. |
|
22 | + * @param \PHP_CodeSniffer\Config $config The config data for the test run. |
|
23 | + * |
|
24 | + * @return void |
|
25 | + */ |
|
26 | + public function setCliValues($testFile, $config) |
|
27 | + { |
|
28 | + $config->tabWidth = 4; |
|
29 | 29 | |
30 | - }//end setCliValues() |
|
30 | + }//end setCliValues() |
|
31 | 31 | |
32 | 32 | |
33 | - /** |
|
34 | - * Returns the lines where errors should occur. |
|
35 | - * |
|
36 | - * The key of the array should represent the line number and the value |
|
37 | - * should represent the number of errors that should occur on that line. |
|
38 | - * |
|
39 | - * @return array(int => int) |
|
40 | - */ |
|
41 | - public function getErrorList() |
|
42 | - { |
|
43 | - return [ |
|
44 | - 14 => 1, |
|
45 | - 16 => 1, |
|
46 | - 18 => 1, |
|
47 | - 23 => 1, |
|
48 | - 26 => 1, |
|
49 | - 30 => 1, |
|
50 | - 32 => 1, |
|
51 | - 38 => 2, |
|
52 | - 40 => 1, |
|
53 | - 41 => 1, |
|
54 | - 51 => 1, |
|
55 | - 54 => 1, |
|
56 | - 58 => 1, |
|
57 | - 60 => 2, |
|
58 | - 67 => 1, |
|
59 | - 69 => 2, |
|
60 | - 80 => 1, |
|
61 | - 81 => 2, |
|
62 | - 88 => 1, |
|
63 | - 91 => 1, |
|
64 | - 95 => 1, |
|
65 | - 156 => 1, |
|
66 | - 158 => 1, |
|
67 | - 170 => 3, |
|
68 | - 171 => 3, |
|
69 | - 179 => 1, |
|
70 | - 183 => 1, |
|
71 | - 184 => 2, |
|
72 | - 185 => 1, |
|
73 | - 186 => 1, |
|
74 | - 187 => 2, |
|
75 | - 193 => 1, |
|
76 | - 196 => 1, |
|
77 | - 199 => 1, |
|
78 | - 203 => 1, |
|
79 | - 206 => 1, |
|
80 | - 211 => 1, |
|
81 | - 214 => 4, |
|
82 | - 218 => 1, |
|
83 | - 220 => 2, |
|
84 | - 222 => 1, |
|
85 | - 224 => 3, |
|
86 | - 243 => 1, |
|
87 | - 244 => 1, |
|
88 | - 246 => 1, |
|
89 | - 248 => 1, |
|
90 | - 249 => 1, |
|
91 | - ]; |
|
33 | + /** |
|
34 | + * Returns the lines where errors should occur. |
|
35 | + * |
|
36 | + * The key of the array should represent the line number and the value |
|
37 | + * should represent the number of errors that should occur on that line. |
|
38 | + * |
|
39 | + * @return array(int => int) |
|
40 | + */ |
|
41 | + public function getErrorList() |
|
42 | + { |
|
43 | + return [ |
|
44 | + 14 => 1, |
|
45 | + 16 => 1, |
|
46 | + 18 => 1, |
|
47 | + 23 => 1, |
|
48 | + 26 => 1, |
|
49 | + 30 => 1, |
|
50 | + 32 => 1, |
|
51 | + 38 => 2, |
|
52 | + 40 => 1, |
|
53 | + 41 => 1, |
|
54 | + 51 => 1, |
|
55 | + 54 => 1, |
|
56 | + 58 => 1, |
|
57 | + 60 => 2, |
|
58 | + 67 => 1, |
|
59 | + 69 => 2, |
|
60 | + 80 => 1, |
|
61 | + 81 => 2, |
|
62 | + 88 => 1, |
|
63 | + 91 => 1, |
|
64 | + 95 => 1, |
|
65 | + 156 => 1, |
|
66 | + 158 => 1, |
|
67 | + 170 => 3, |
|
68 | + 171 => 3, |
|
69 | + 179 => 1, |
|
70 | + 183 => 1, |
|
71 | + 184 => 2, |
|
72 | + 185 => 1, |
|
73 | + 186 => 1, |
|
74 | + 187 => 2, |
|
75 | + 193 => 1, |
|
76 | + 196 => 1, |
|
77 | + 199 => 1, |
|
78 | + 203 => 1, |
|
79 | + 206 => 1, |
|
80 | + 211 => 1, |
|
81 | + 214 => 4, |
|
82 | + 218 => 1, |
|
83 | + 220 => 2, |
|
84 | + 222 => 1, |
|
85 | + 224 => 3, |
|
86 | + 243 => 1, |
|
87 | + 244 => 1, |
|
88 | + 246 => 1, |
|
89 | + 248 => 1, |
|
90 | + 249 => 1, |
|
91 | + ]; |
|
92 | 92 | |
93 | - }//end getErrorList() |
|
93 | + }//end getErrorList() |
|
94 | 94 | |
95 | 95 | |
96 | - /** |
|
97 | - * Returns the lines where warnings should occur. |
|
98 | - * |
|
99 | - * The key of the array should represent the line number and the value |
|
100 | - * should represent the number of warnings that should occur on that line. |
|
101 | - * |
|
102 | - * @return array(int => int) |
|
103 | - */ |
|
104 | - public function getWarningList() |
|
105 | - { |
|
106 | - return []; |
|
96 | + /** |
|
97 | + * Returns the lines where warnings should occur. |
|
98 | + * |
|
99 | + * The key of the array should represent the line number and the value |
|
100 | + * should represent the number of warnings that should occur on that line. |
|
101 | + * |
|
102 | + * @return array(int => int) |
|
103 | + */ |
|
104 | + public function getWarningList() |
|
105 | + { |
|
106 | + return []; |
|
107 | 107 | |
108 | - }//end getWarningList() |
|
108 | + }//end getWarningList() |
|
109 | 109 | |
110 | 110 | |
111 | 111 | }//end class |
@@ -23,7 +23,7 @@ discard block |
||
23 | 23 | * |
24 | 24 | * @return void |
25 | 25 | */ |
26 | - public function setCliValues($testFile, $config) |
|
26 | + public function setCliValues( $testFile, $config ) |
|
27 | 27 | { |
28 | 28 | $config->tabWidth = 4; |
29 | 29 | |
@@ -103,7 +103,7 @@ discard block |
||
103 | 103 | */ |
104 | 104 | public function getWarningList() |
105 | 105 | { |
106 | - return []; |
|
106 | + return [ ]; |
|
107 | 107 | |
108 | 108 | }//end getWarningList() |
109 | 109 |
@@ -11,8 +11,7 @@ discard block |
||
11 | 11 | |
12 | 12 | use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; |
13 | 13 | |
14 | -class DocCommentUnitTest extends AbstractSniffUnitTest |
|
15 | -{ |
|
14 | +class DocCommentUnitTest extends AbstractSniffUnitTest { |
|
16 | 15 | |
17 | 16 | |
18 | 17 | /** |
@@ -23,8 +22,7 @@ discard block |
||
23 | 22 | * |
24 | 23 | * @return void |
25 | 24 | */ |
26 | - public function setCliValues($testFile, $config) |
|
27 | - { |
|
25 | + public function setCliValues($testFile, $config) { |
|
28 | 26 | $config->tabWidth = 4; |
29 | 27 | |
30 | 28 | }//end setCliValues() |
@@ -38,8 +36,7 @@ discard block |
||
38 | 36 | * |
39 | 37 | * @return array(int => int) |
40 | 38 | */ |
41 | - public function getErrorList() |
|
42 | - { |
|
39 | + public function getErrorList() { |
|
43 | 40 | return [ |
44 | 41 | 14 => 1, |
45 | 42 | 16 => 1, |
@@ -101,8 +98,7 @@ discard block |
||
101 | 98 | * |
102 | 99 | * @return array(int => int) |
103 | 100 | */ |
104 | - public function getWarningList() |
|
105 | - { |
|
101 | + public function getWarningList() { |
|
106 | 102 | return []; |
107 | 103 | |
108 | 104 | }//end getWarningList() |
@@ -5,10 +5,10 @@ |
||
5 | 5 | */ |
6 | 6 | |
7 | 7 | // TODO: remove this. |
8 | -error_log('test'); |
|
8 | +error_log( 'test' ); |
|
9 | 9 | |
10 | 10 | // TODO remove this. |
11 | -Debug::bam('test'); |
|
11 | +Debug::bam( 'test' ); |
|
12 | 12 | |
13 | 13 | // todo - remove this. |
14 | 14 |
@@ -15,47 +15,47 @@ |
||
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='TodoUnitTest.inc') |
|
29 | - { |
|
30 | - return []; |
|
31 | - |
|
32 | - }//end getErrorList() |
|
33 | - |
|
34 | - |
|
35 | - /** |
|
36 | - * Returns the lines where warnings should occur. |
|
37 | - * |
|
38 | - * The key of the array should represent the line number and the value |
|
39 | - * should represent the number of warnings that should occur on that line. |
|
40 | - * |
|
41 | - * @param string $testFile The name of the file being tested. |
|
42 | - * |
|
43 | - * @return array<int, int> |
|
44 | - */ |
|
45 | - public function getWarningList($testFile='TodoUnitTest.inc') |
|
46 | - { |
|
47 | - return [ |
|
48 | - 3 => 1, |
|
49 | - 4 => 1, |
|
50 | - 7 => 1, |
|
51 | - 10 => 1, |
|
52 | - 13 => 1, |
|
53 | - 16 => 1, |
|
54 | - 18 => 1, |
|
55 | - 21 => 1, |
|
56 | - ]; |
|
57 | - |
|
58 | - }//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='TodoUnitTest.inc') |
|
29 | + { |
|
30 | + return []; |
|
31 | + |
|
32 | + }//end getErrorList() |
|
33 | + |
|
34 | + |
|
35 | + /** |
|
36 | + * Returns the lines where warnings should occur. |
|
37 | + * |
|
38 | + * The key of the array should represent the line number and the value |
|
39 | + * should represent the number of warnings that should occur on that line. |
|
40 | + * |
|
41 | + * @param string $testFile The name of the file being tested. |
|
42 | + * |
|
43 | + * @return array<int, int> |
|
44 | + */ |
|
45 | + public function getWarningList($testFile='TodoUnitTest.inc') |
|
46 | + { |
|
47 | + return [ |
|
48 | + 3 => 1, |
|
49 | + 4 => 1, |
|
50 | + 7 => 1, |
|
51 | + 10 => 1, |
|
52 | + 13 => 1, |
|
53 | + 16 => 1, |
|
54 | + 18 => 1, |
|
55 | + 21 => 1, |
|
56 | + ]; |
|
57 | + |
|
58 | + }//end getWarningList() |
|
59 | 59 | |
60 | 60 | |
61 | 61 | }//end class |
@@ -25,9 +25,9 @@ discard block |
||
25 | 25 | * |
26 | 26 | * @return array<int, int> |
27 | 27 | */ |
28 | - public function getErrorList($testFile='TodoUnitTest.inc') |
|
28 | + public function getErrorList( $testFile = 'TodoUnitTest.inc' ) |
|
29 | 29 | { |
30 | - return []; |
|
30 | + return [ ]; |
|
31 | 31 | |
32 | 32 | }//end getErrorList() |
33 | 33 | |
@@ -42,7 +42,7 @@ discard block |
||
42 | 42 | * |
43 | 43 | * @return array<int, int> |
44 | 44 | */ |
45 | - public function getWarningList($testFile='TodoUnitTest.inc') |
|
45 | + public function getWarningList( $testFile = 'TodoUnitTest.inc' ) |
|
46 | 46 | { |
47 | 47 | return [ |
48 | 48 | 3 => 1, |
@@ -11,8 +11,7 @@ discard block |
||
11 | 11 | |
12 | 12 | use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; |
13 | 13 | |
14 | -class TodoUnitTest extends AbstractSniffUnitTest |
|
15 | -{ |
|
14 | +class TodoUnitTest extends AbstractSniffUnitTest { |
|
16 | 15 | |
17 | 16 | |
18 | 17 | /** |
@@ -25,8 +24,7 @@ discard block |
||
25 | 24 | * |
26 | 25 | * @return array<int, int> |
27 | 26 | */ |
28 | - public function getErrorList($testFile='TodoUnitTest.inc') |
|
29 | - { |
|
27 | + public function getErrorList($testFile='TodoUnitTest.inc') { |
|
30 | 28 | return []; |
31 | 29 | |
32 | 30 | }//end getErrorList() |
@@ -42,8 +40,7 @@ discard block |
||
42 | 40 | * |
43 | 41 | * @return array<int, int> |
44 | 42 | */ |
45 | - public function getWarningList($testFile='TodoUnitTest.inc') |
|
46 | - { |
|
43 | + public function getWarningList($testFile='TodoUnitTest.inc') { |
|
47 | 44 | return [ |
48 | 45 | 3 => 1, |
49 | 46 | 4 => 1, |
@@ -5,10 +5,10 @@ |
||
5 | 5 | */ |
6 | 6 | |
7 | 7 | // FIXME: this is broken, don't forget to fix it |
8 | -error_log('test'); |
|
8 | +error_log( 'test' ); |
|
9 | 9 | |
10 | 10 | // FIXME remove this. |
11 | -Debug::bam('test'); |
|
11 | +Debug::bam( 'test' ); |
|
12 | 12 | |
13 | 13 | // fixme - fix this. |
14 | 14 |
@@ -1,4 +1,4 @@ |
||
1 | 1 | <?php |
2 | 2 | |
3 | 3 | // Intentional parse error. Testing that the sniff is *not* triggered in this case. |
4 | -if ($bar) |
|
4 | +if ( $bar ) |
@@ -1,6 +1,6 @@ |
||
1 | 1 | <?php |
2 | 2 | |
3 | 3 | // Intentional parse error. Testing that the sniff is *not* triggered in this case. |
4 | -if ($bar |
|
4 | +if ( $bar |
|
5 | 5 | |
6 | 6 | function parensDifferentOwner() {} |
@@ -3,11 +3,11 @@ discard block |
||
3 | 3 | if ($something) echo 'hello'; |
4 | 4 | |
5 | 5 | if ($something) { |
6 | - echo 'hello'; |
|
6 | + echo 'hello'; |
|
7 | 7 | } else echo 'hi'; |
8 | 8 | |
9 | 9 | if ($something) { |
10 | - echo 'hello'; |
|
10 | + echo 'hello'; |
|
11 | 11 | } else if ($else) echo 'hi'; |
12 | 12 | |
13 | 13 | foreach ($something as $thing) echo 'hello'; |
@@ -17,61 +17,61 @@ discard block |
||
17 | 17 | while ($something) echo 'hello'; |
18 | 18 | |
19 | 19 | do { |
20 | - $i--; |
|
20 | + $i--; |
|
21 | 21 | } while ($something); |
22 | 22 | |
23 | 23 | if(true) |
24 | 24 | $someObject->{$name}; |
25 | 25 | |
26 | 26 | if (true) : |
27 | - $foo = true; |
|
27 | + $foo = true; |
|
28 | 28 | endif; |
29 | 29 | |
30 | 30 | while (true) : |
31 | - $foo = true; |
|
31 | + $foo = true; |
|
32 | 32 | endwhile; |
33 | 33 | |
34 | 34 | for ($i; $i > 0; $i--) : |
35 | - echo 'hello'; |
|
35 | + echo 'hello'; |
|
36 | 36 | endfor; |
37 | 37 | |
38 | 38 | foreach ($array as $element) : |
39 | - echo 'hello'; |
|
39 | + echo 'hello'; |
|
40 | 40 | endforeach; |
41 | 41 | |
42 | 42 | while (!$this->readLine($tokens, $tag)); |
43 | 43 | while (!$this->readLine($tokens, $tag)); //skip to end of file |
44 | 44 | |
45 | 45 | foreach ($cookies as $cookie) |
46 | - if ($cookie->match($uri, $matchSessionCookies, $now)) |
|
47 | - $ret[] = $cookie; |
|
46 | + if ($cookie->match($uri, $matchSessionCookies, $now)) |
|
47 | + $ret[] = $cookie; |
|
48 | 48 | |
49 | 49 | foreach ($stringParade as $hit) |
50 | - $hitParade[] = $hit + 0; //cast to integer |
|
50 | + $hitParade[] = $hit + 0; //cast to integer |
|
51 | 51 | |
52 | 52 | if ($foo) : |
53 | - echo 'true'; |
|
53 | + echo 'true'; |
|
54 | 54 | elseif ($something) : |
55 | - echo 'foo'; |
|
55 | + echo 'foo'; |
|
56 | 56 | else: |
57 | - echo 'false'; |
|
57 | + echo 'false'; |
|
58 | 58 | endif; |
59 | 59 | |
60 | 60 | function test() |
61 | 61 | { |
62 | - if ($a) |
|
63 | - $a.=' '.($b ? 'b' : ($c ? ($d ? 'd' : 'c') : '')); |
|
62 | + if ($a) |
|
63 | + $a.=' '.($b ? 'b' : ($c ? ($d ? 'd' : 'c') : '')); |
|
64 | 64 | } |
65 | 65 | |
66 | 66 | if ($a) |
67 | - foreach ($b as $c) { |
|
68 | - if ($d) { |
|
69 | - $e=$f; |
|
70 | - $g=$h; |
|
71 | - } elseif ($i==0) { |
|
72 | - $j=$k; |
|
73 | - } |
|
74 | - } |
|
67 | + foreach ($b as $c) { |
|
68 | + if ($d) { |
|
69 | + $e=$f; |
|
70 | + $g=$h; |
|
71 | + } elseif ($i==0) { |
|
72 | + $j=$k; |
|
73 | + } |
|
74 | + } |
|
75 | 75 | |
76 | 76 | ?> |
77 | 77 | <div style="text-align: right;"> |
@@ -80,136 +80,136 @@ discard block |
||
80 | 80 | |
81 | 81 | <?php |
82 | 82 | switch ($this->error): |
83 | - case Shop_Customer :: ERROR_INVALID_GENDER: ?> |
|
83 | + case Shop_Customer :: ERROR_INVALID_GENDER: ?> |
|
84 | 84 | Ungültiges Geschlecht! |
85 | 85 | <?php break; |
86 | - case Shop_Customer :: ERROR_EMAIL_IN_USE: ?> |
|
86 | + case Shop_Customer :: ERROR_EMAIL_IN_USE: ?> |
|
87 | 87 | Die eingetragene E-Mail-Adresse ist bereits registriert. |
88 | 88 | <?php break; |
89 | 89 | endswitch; |
90 | 90 | |
91 | 91 | if ($this->allowShopping !== true): |
92 | - if ($this->status != Shop_Cart :: OK): |
|
93 | - switch ($this->status): |
|
94 | - case Shop_Cart :: NOT_FOUND: |
|
95 | - echo 'foo'; |
|
96 | - endswitch; |
|
97 | - endif; |
|
92 | + if ($this->status != Shop_Cart :: OK): |
|
93 | + switch ($this->status): |
|
94 | + case Shop_Cart :: NOT_FOUND: |
|
95 | + echo 'foo'; |
|
96 | + endswitch; |
|
97 | + endif; |
|
98 | 98 | else: |
99 | - echo 'foo'; |
|
99 | + echo 'foo'; |
|
100 | 100 | endif; |
101 | 101 | |
102 | 102 | // ELSE IF split over multiple lines (not inline) |
103 | 103 | if ($test) { |
104 | 104 | } else |
105 | - if ($test) { |
|
106 | - } else { |
|
107 | - } |
|
105 | + if ($test) { |
|
106 | + } else { |
|
107 | + } |
|
108 | 108 | |
109 | 109 | switch($response = \Bar::baz('bat', function ($foo) { |
110 | - return 'bar'; |
|
110 | + return 'bar'; |
|
111 | 111 | })) { |
112 | - case 1: |
|
113 | - return 'test'; |
|
112 | + case 1: |
|
113 | + return 'test'; |
|
114 | 114 | |
115 | - case 2: |
|
116 | - return 'other'; |
|
115 | + case 2: |
|
116 | + return 'other'; |
|
117 | 117 | } |
118 | 118 | |
119 | 119 | $stuff = [1,2,3]; |
120 | 120 | foreach($stuff as $num) |
121 | - if ($num %2 ) { |
|
122 | - echo "even"; |
|
123 | - } else { |
|
124 | - echo "odd"; |
|
125 | - } |
|
121 | + if ($num %2 ) { |
|
122 | + echo "even"; |
|
123 | + } else { |
|
124 | + echo "odd"; |
|
125 | + } |
|
126 | 126 | |
127 | 127 | $i = 0; |
128 | 128 | foreach($stuff as $num) |
129 | - do { |
|
130 | - echo $i; |
|
131 | - $i++; |
|
132 | - } while ($i < 5); |
|
129 | + do { |
|
130 | + echo $i; |
|
131 | + $i++; |
|
132 | + } while ($i < 5); |
|
133 | 133 | |
134 | 134 | foreach($stuff as $num) |
135 | - if (true) { |
|
136 | - echo "true1\n"; |
|
137 | - } |
|
138 | - if (true) { |
|
139 | - echo "true2\n"; |
|
140 | - } |
|
135 | + if (true) { |
|
136 | + echo "true1\n"; |
|
137 | + } |
|
138 | + if (true) { |
|
139 | + echo "true2\n"; |
|
140 | + } |
|
141 | 141 | |
142 | 142 | if ($foo) echo 'foo'; |
143 | 143 | elseif ($bar) echo 'bar'; |
144 | 144 | else echo 'baz'; |
145 | 145 | |
146 | 146 | switch ($type) { |
147 | - case 1: |
|
148 | - if ($foo) { |
|
149 | - return true; |
|
150 | - } elseif ($baz) |
|
151 | - return true; |
|
152 | - else { |
|
153 | - echo 'else'; |
|
154 | - } |
|
155 | - break; |
|
147 | + case 1: |
|
148 | + if ($foo) { |
|
149 | + return true; |
|
150 | + } elseif ($baz) |
|
151 | + return true; |
|
152 | + else { |
|
153 | + echo 'else'; |
|
154 | + } |
|
155 | + break; |
|
156 | 156 | } |
157 | 157 | |
158 | 158 | foreach ($sql as $s) |
159 | - if (!$this->execute) echo "<pre>",$s.";\n</pre>"; |
|
160 | - else { |
|
161 | - $ok = $this->connDest->Execute($s); |
|
162 | - if (!$ok) |
|
163 | - if ($this->neverAbort) $ret = false; |
|
164 | - else return false; |
|
165 | - } |
|
159 | + if (!$this->execute) echo "<pre>",$s.";\n</pre>"; |
|
160 | + else { |
|
161 | + $ok = $this->connDest->Execute($s); |
|
162 | + if (!$ok) |
|
163 | + if ($this->neverAbort) $ret = false; |
|
164 | + else return false; |
|
165 | + } |
|
166 | 166 | |
167 | 167 | if ($bar) |
168 | - if ($foo) echo 'hi'; // lol |
|
168 | + if ($foo) echo 'hi'; // lol |
|
169 | 169 | |
170 | 170 | if ($level == 'district') |
171 | - \DB::update(<<<EOD |
|
171 | + \DB::update(<<<EOD |
|
172 | 172 | some |
173 | 173 | text |
174 | 174 | here |
175 | 175 | EOD |
176 | - ); |
|
176 | + ); |
|
177 | 177 | |
178 | 178 | if ($level == 'district') |
179 | - $var = <<<EOD |
|
179 | + $var = <<<EOD |
|
180 | 180 | some |
181 | 181 | text |
182 | 182 | here |
183 | 183 | EOD; |
184 | 184 | |
185 | 185 | if ($a && $a === Foo::VARIABLE && ($a === Foo::METHOD || $a === Foo::FUNCTION)) |
186 | - echo 'hi'; |
|
186 | + echo 'hi'; |
|
187 | 187 | |
188 | 188 | $out = array_map(function ($test) { if ($test) return 1; else return 2; }, $input); // comment |
189 | 189 | |
190 | 190 | for ($x=0;$x<5;$x++): |
191 | - if ($x) continue; |
|
191 | + if ($x) continue; |
|
192 | 192 | endfor; |
193 | 193 | |
194 | 194 | for ($x=0;$x<5;$x++): |
195 | - if ($x) continue ?> <?php |
|
195 | + if ($x) continue ?> <?php |
|
196 | 196 | endfor; |
197 | 197 | |
198 | 198 | if (true) |
199 | - try { |
|
200 | - } |
|
201 | - catch(Exception $e) { |
|
202 | - } |
|
199 | + try { |
|
200 | + } |
|
201 | + catch(Exception $e) { |
|
202 | + } |
|
203 | 203 | |
204 | 204 | switch ($num) { |
205 | - case 0: |
|
206 | - if (1 > $num) |
|
207 | - return bar( |
|
208 | - baz( |
|
209 | - "foobarbaz" |
|
210 | - ) |
|
211 | - ); |
|
212 | - break; |
|
205 | + case 0: |
|
206 | + if (1 > $num) |
|
207 | + return bar( |
|
208 | + baz( |
|
209 | + "foobarbaz" |
|
210 | + ) |
|
211 | + ); |
|
212 | + break; |
|
213 | 213 | } |
214 | 214 | |
215 | 215 | do { |
@@ -219,8 +219,8 @@ discard block |
||
219 | 219 | while ($i < 10); |
220 | 220 | |
221 | 221 | if ($this) { |
222 | - if ($that) |
|
223 | - foo(${$a[$b]}); |
|
222 | + if ($that) |
|
223 | + foo(${$a[$b]}); |
|
224 | 224 | } |
225 | 225 | |
226 | 226 | while (!$this->readLine($tokens, $tag)); //phpcs:ignore Standard.Category.Sniff |
@@ -230,11 +230,11 @@ discard block |
||
230 | 230 | while (!$this->readLine($tokens, $tag)); /* comment */ |
231 | 231 | |
232 | 232 | foreach ($stringParade as $hit) |
233 | - $hitParade[] = $hit + 0; // phpcs:ignore Standard.Category.Sniff |
|
233 | + $hitParade[] = $hit + 0; // phpcs:ignore Standard.Category.Sniff |
|
234 | 234 | |
235 | 235 | if ($bar) |
236 | - if ($foo) echo 'hi'; /* @phpcs:ignore Standard.Category.Sniff */ |
|
236 | + if ($foo) echo 'hi'; /* @phpcs:ignore Standard.Category.Sniff */ |
|
237 | 237 | |
238 | 238 | if (true) $callable = function () { |
239 | - return true; |
|
239 | + return true; |
|
240 | 240 | }; |
@@ -109,11 +109,11 @@ discard block |
||
109 | 109 | switch($response = \Bar::baz('bat', function ($foo) { |
110 | 110 | return 'bar'; |
111 | 111 | })) { |
112 | - case 1: |
|
113 | - return 'test'; |
|
112 | + case 1: |
|
113 | + return 'test'; |
|
114 | 114 | |
115 | - case 2: |
|
116 | - return 'other'; |
|
115 | + case 2: |
|
116 | + return 'other'; |
|
117 | 117 | } |
118 | 118 | |
119 | 119 | $stuff = [1,2,3]; |
@@ -202,14 +202,14 @@ discard block |
||
202 | 202 | } |
203 | 203 | |
204 | 204 | switch ($num) { |
205 | - case 0: |
|
206 | - if (1 > $num) |
|
207 | - return bar( |
|
208 | - baz( |
|
209 | - "foobarbaz" |
|
210 | - ) |
|
211 | - ); |
|
212 | - break; |
|
205 | + case 0: |
|
206 | + if (1 > $num) |
|
207 | + return bar( |
|
208 | + baz( |
|
209 | + "foobarbaz" |
|
210 | + ) |
|
211 | + ); |
|
212 | + break; |
|
213 | 213 | } |
214 | 214 | |
215 | 215 | do { |
@@ -1,57 +1,57 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | |
3 | -if ($something) echo 'hello'; |
|
3 | +if ( $something ) echo 'hello'; |
|
4 | 4 | |
5 | -if ($something) { |
|
5 | +if ( $something ) { |
|
6 | 6 | echo 'hello'; |
7 | 7 | } else echo 'hi'; |
8 | 8 | |
9 | -if ($something) { |
|
9 | +if ( $something ) { |
|
10 | 10 | echo 'hello'; |
11 | -} else if ($else) echo 'hi'; |
|
11 | +} else if ( $else ) echo 'hi'; |
|
12 | 12 | |
13 | -foreach ($something as $thing) echo 'hello'; |
|
13 | +foreach ( $something as $thing ) echo 'hello'; |
|
14 | 14 | |
15 | -for ($i; $i > 0; $i--) echo 'hello'; |
|
15 | +for ( $i; $i > 0; $i-- ) echo 'hello'; |
|
16 | 16 | |
17 | -while ($something) echo 'hello'; |
|
17 | +while ( $something ) echo 'hello'; |
|
18 | 18 | |
19 | 19 | do { |
20 | 20 | $i--; |
21 | -} while ($something); |
|
21 | +} while ( $something ); |
|
22 | 22 | |
23 | -if(true) |
|
23 | +if ( true ) |
|
24 | 24 | $someObject->{$name}; |
25 | 25 | |
26 | -if (true) : |
|
26 | +if ( true ) : |
|
27 | 27 | $foo = true; |
28 | 28 | endif; |
29 | 29 | |
30 | -while (true) : |
|
30 | +while ( true ) : |
|
31 | 31 | $foo = true; |
32 | 32 | endwhile; |
33 | 33 | |
34 | -for ($i; $i > 0; $i--) : |
|
34 | +for ( $i; $i > 0; $i-- ) : |
|
35 | 35 | echo 'hello'; |
36 | 36 | endfor; |
37 | 37 | |
38 | -foreach ($array as $element) : |
|
38 | +foreach ( $array as $element ) : |
|
39 | 39 | echo 'hello'; |
40 | 40 | endforeach; |
41 | 41 | |
42 | -while (!$this->readLine($tokens, $tag)); |
|
43 | -while (!$this->readLine($tokens, $tag)); //skip to end of file |
|
42 | +while ( ! $this->readLine( $tokens, $tag ) ); |
|
43 | +while ( ! $this->readLine( $tokens, $tag ) ); //skip to end of file |
|
44 | 44 | |
45 | -foreach ($cookies as $cookie) |
|
46 | - if ($cookie->match($uri, $matchSessionCookies, $now)) |
|
47 | - $ret[] = $cookie; |
|
45 | +foreach ( $cookies as $cookie ) |
|
46 | + if ( $cookie->match( $uri, $matchSessionCookies, $now ) ) |
|
47 | + $ret[ ] = $cookie; |
|
48 | 48 | |
49 | -foreach ($stringParade as $hit) |
|
50 | - $hitParade[] = $hit + 0; //cast to integer |
|
49 | +foreach ( $stringParade as $hit ) |
|
50 | + $hitParade[ ] = $hit + 0; //cast to integer |
|
51 | 51 | |
52 | -if ($foo) : |
|
52 | +if ( $foo ) : |
|
53 | 53 | echo 'true'; |
54 | -elseif ($something) : |
|
54 | +elseif ( $something ) : |
|
55 | 55 | echo 'foo'; |
56 | 56 | else: |
57 | 57 | echo 'false'; |
@@ -59,27 +59,27 @@ discard block |
||
59 | 59 | |
60 | 60 | function test() |
61 | 61 | { |
62 | - if ($a) |
|
63 | - $a.=' '.($b ? 'b' : ($c ? ($d ? 'd' : 'c') : '')); |
|
62 | + if ( $a ) |
|
63 | + $a .= ' ' . ( $b ? 'b' : ( $c ? ( $d ? 'd' : 'c' ) : '' ) ); |
|
64 | 64 | } |
65 | 65 | |
66 | -if ($a) |
|
67 | - foreach ($b as $c) { |
|
68 | - if ($d) { |
|
69 | - $e=$f; |
|
70 | - $g=$h; |
|
71 | - } elseif ($i==0) { |
|
72 | - $j=$k; |
|
66 | +if ( $a ) |
|
67 | + foreach ( $b as $c ) { |
|
68 | + if ( $d ) { |
|
69 | + $e = $f; |
|
70 | + $g = $h; |
|
71 | + } elseif ( $i == 0 ) { |
|
72 | + $j = $k; |
|
73 | 73 | } |
74 | 74 | } |
75 | 75 | |
76 | 76 | ?> |
77 | 77 | <div style="text-align: right;"> |
78 | - <?php if ($model->scenario == 'simple') $widget->renderPager() ?> |
|
78 | + <?php if ( $model->scenario == 'simple' ) $widget->renderPager() ?> |
|
79 | 79 | </div> |
80 | 80 | |
81 | 81 | <?php |
82 | -switch ($this->error): |
|
82 | +switch ( $this->error ): |
|
83 | 83 | case Shop_Customer :: ERROR_INVALID_GENDER: ?> |
84 | 84 | Ungültiges Geschlecht! |
85 | 85 | <?php break; |
@@ -88,9 +88,9 @@ discard block |
||
88 | 88 | <?php break; |
89 | 89 | endswitch; |
90 | 90 | |
91 | -if ($this->allowShopping !== true): |
|
92 | - if ($this->status != Shop_Cart :: OK): |
|
93 | - switch ($this->status): |
|
91 | +if ( $this->allowShopping !== true ): |
|
92 | + if ( $this->status != Shop_Cart :: OK ): |
|
93 | + switch ( $this->status ): |
|
94 | 94 | case Shop_Cart :: NOT_FOUND: |
95 | 95 | echo 'foo'; |
96 | 96 | endswitch; |
@@ -100,15 +100,15 @@ discard block |
||
100 | 100 | endif; |
101 | 101 | |
102 | 102 | // ELSE IF split over multiple lines (not inline) |
103 | -if ($test) { |
|
103 | +if ( $test ) { |
|
104 | 104 | } else |
105 | - if ($test) { |
|
105 | + if ( $test ) { |
|
106 | 106 | } else { |
107 | 107 | } |
108 | 108 | |
109 | -switch($response = \Bar::baz('bat', function ($foo) { |
|
109 | +switch ( $response = \Bar::baz( 'bat', function( $foo ) { |
|
110 | 110 | return 'bar'; |
111 | -})) { |
|
111 | +}) ) { |
|
112 | 112 | case 1: |
113 | 113 | return 'test'; |
114 | 114 | |
@@ -116,38 +116,38 @@ discard block |
||
116 | 116 | return 'other'; |
117 | 117 | } |
118 | 118 | |
119 | -$stuff = [1,2,3]; |
|
120 | -foreach($stuff as $num) |
|
121 | - if ($num %2 ) { |
|
119 | +$stuff = [ 1, 2, 3 ]; |
|
120 | +foreach ( $stuff as $num ) |
|
121 | + if ( $num % 2 ) { |
|
122 | 122 | echo "even"; |
123 | 123 | } else { |
124 | 124 | echo "odd"; |
125 | 125 | } |
126 | 126 | |
127 | 127 | $i = 0; |
128 | -foreach($stuff as $num) |
|
128 | +foreach ( $stuff as $num ) |
|
129 | 129 | do { |
130 | 130 | echo $i; |
131 | 131 | $i++; |
132 | - } while ($i < 5); |
|
132 | + } while ( $i < 5 ); |
|
133 | 133 | |
134 | -foreach($stuff as $num) |
|
135 | - if (true) { |
|
134 | +foreach ( $stuff as $num ) |
|
135 | + if ( true ) { |
|
136 | 136 | echo "true1\n"; |
137 | 137 | } |
138 | - if (true) { |
|
138 | + if ( true ) { |
|
139 | 139 | echo "true2\n"; |
140 | 140 | } |
141 | 141 | |
142 | -if ($foo) echo 'foo'; |
|
143 | -elseif ($bar) echo 'bar'; |
|
142 | +if ( $foo ) echo 'foo'; |
|
143 | +elseif ( $bar ) echo 'bar'; |
|
144 | 144 | else echo 'baz'; |
145 | 145 | |
146 | -switch ($type) { |
|
146 | +switch ( $type ) { |
|
147 | 147 | case 1: |
148 | - if ($foo) { |
|
148 | + if ( $foo ) { |
|
149 | 149 | return true; |
150 | - } elseif ($baz) |
|
150 | + } elseif ( $baz ) |
|
151 | 151 | return true; |
152 | 152 | else { |
153 | 153 | echo 'else'; |
@@ -155,55 +155,55 @@ discard block |
||
155 | 155 | break; |
156 | 156 | } |
157 | 157 | |
158 | -foreach ($sql as $s) |
|
159 | - if (!$this->execute) echo "<pre>",$s.";\n</pre>"; |
|
158 | +foreach ( $sql as $s ) |
|
159 | + if ( ! $this->execute ) echo "<pre>", $s . ";\n</pre>"; |
|
160 | 160 | else { |
161 | - $ok = $this->connDest->Execute($s); |
|
162 | - if (!$ok) |
|
163 | - if ($this->neverAbort) $ret = false; |
|
161 | + $ok = $this->connDest->Execute( $s ); |
|
162 | + if ( ! $ok ) |
|
163 | + if ( $this->neverAbort ) $ret = false; |
|
164 | 164 | else return false; |
165 | 165 | } |
166 | 166 | |
167 | -if ($bar) |
|
168 | - if ($foo) echo 'hi'; // lol |
|
167 | +if ( $bar ) |
|
168 | + if ( $foo ) echo 'hi'; // lol |
|
169 | 169 | |
170 | -if ($level == 'district') |
|
171 | - \DB::update(<<<EOD |
|
170 | +if ( $level == 'district' ) |
|
171 | + \DB::update( <<<EOD |
|
172 | 172 | some |
173 | 173 | text |
174 | 174 | here |
175 | 175 | EOD |
176 | 176 | ); |
177 | 177 | |
178 | -if ($level == 'district') |
|
178 | +if ( $level == 'district' ) |
|
179 | 179 | $var = <<<EOD |
180 | 180 | some |
181 | 181 | text |
182 | 182 | here |
183 | 183 | EOD; |
184 | 184 | |
185 | -if ($a && $a === Foo::VARIABLE && ($a === Foo::METHOD || $a === Foo::FUNCTION)) |
|
185 | +if ( $a && $a === Foo::VARIABLE && ( $a === Foo::METHOD || $a === Foo::FUNCTION) ) |
|
186 | 186 | echo 'hi'; |
187 | 187 | |
188 | -$out = array_map(function ($test) { if ($test) return 1; else return 2; }, $input); // comment |
|
188 | +$out = array_map( function( $test ) { if ( $test ) return 1; else return 2; }, $input ); // comment |
|
189 | 189 | |
190 | -for ($x=0;$x<5;$x++): |
|
191 | - if ($x) continue; |
|
190 | +for ( $x = 0; $x < 5; $x++ ): |
|
191 | + if ( $x ) continue; |
|
192 | 192 | endfor; |
193 | 193 | |
194 | -for ($x=0;$x<5;$x++): |
|
195 | - if ($x) continue ?> <?php |
|
194 | +for ( $x = 0; $x < 5; $x++ ): |
|
195 | + if ( $x ) continue ?> <?php |
|
196 | 196 | endfor; |
197 | 197 | |
198 | -if (true) |
|
198 | +if ( true ) |
|
199 | 199 | try { |
200 | 200 | } |
201 | - catch(Exception $e) { |
|
201 | + catch ( Exception $e ) { |
|
202 | 202 | } |
203 | 203 | |
204 | -switch ($num) { |
|
204 | +switch ( $num ) { |
|
205 | 205 | case 0: |
206 | - if (1 > $num) |
|
206 | + if ( 1 > $num ) |
|
207 | 207 | return bar( |
208 | 208 | baz( |
209 | 209 | "foobarbaz" |
@@ -216,25 +216,25 @@ discard block |
||
216 | 216 | $i++; |
217 | 217 | } |
218 | 218 | // Comment |
219 | -while ($i < 10); |
|
219 | +while ( $i < 10 ); |
|
220 | 220 | |
221 | -if ($this) { |
|
222 | - if ($that) |
|
223 | - foo(${$a[$b]}); |
|
221 | +if ( $this ) { |
|
222 | + if ( $that ) |
|
223 | + foo( ${$a[ $b ]}); |
|
224 | 224 | } |
225 | 225 | |
226 | -while (!$this->readLine($tokens, $tag)); //phpcs:ignore Standard.Category.Sniff |
|
226 | +while ( ! $this->readLine( $tokens, $tag ) ); //phpcs:ignore Standard.Category.Sniff |
|
227 | 227 | |
228 | -while (!$this->readLine($tokens, $tag)); // comment |
|
228 | +while ( ! $this->readLine( $tokens, $tag ) ); // comment |
|
229 | 229 | |
230 | -while (!$this->readLine($tokens, $tag)); /* comment */ |
|
230 | +while ( ! $this->readLine( $tokens, $tag ) ); /* comment */ |
|
231 | 231 | |
232 | -foreach ($stringParade as $hit) |
|
233 | - $hitParade[] = $hit + 0; // phpcs:ignore Standard.Category.Sniff |
|
232 | +foreach ( $stringParade as $hit ) |
|
233 | + $hitParade[ ] = $hit + 0; // phpcs:ignore Standard.Category.Sniff |
|
234 | 234 | |
235 | -if ($bar) |
|
236 | - if ($foo) echo 'hi'; /* @phpcs:ignore Standard.Category.Sniff */ |
|
235 | +if ( $bar ) |
|
236 | + if ( $foo ) echo 'hi'; /* @phpcs:ignore Standard.Category.Sniff */ |
|
237 | 237 | |
238 | -if (true) $callable = function () { |
|
238 | +if ( true ) $callable = function() { |
|
239 | 239 | return true; |
240 | 240 | }; |
@@ -1,27 +1,40 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | |
3 | -if ($something) echo 'hello'; |
|
3 | +if ($something) { |
|
4 | + echo 'hello'; |
|
5 | +} |
|
4 | 6 | |
5 | 7 | if ($something) { |
6 | 8 | echo 'hello'; |
7 | -} else echo 'hi'; |
|
9 | +} else { |
|
10 | + echo 'hi'; |
|
11 | +} |
|
8 | 12 | |
9 | 13 | if ($something) { |
10 | 14 | echo 'hello'; |
11 | -} else if ($else) echo 'hi'; |
|
15 | +} else if ($else) { |
|
16 | + echo 'hi'; |
|
17 | +} |
|
12 | 18 | |
13 | -foreach ($something as $thing) echo 'hello'; |
|
19 | +foreach ($something as $thing) { |
|
20 | + echo 'hello'; |
|
21 | +} |
|
14 | 22 | |
15 | -for ($i; $i > 0; $i--) echo 'hello'; |
|
23 | +for ($i; $i > 0; $i--) { |
|
24 | + echo 'hello'; |
|
25 | +} |
|
16 | 26 | |
17 | -while ($something) echo 'hello'; |
|
27 | +while ($something) { |
|
28 | + echo 'hello'; |
|
29 | +} |
|
18 | 30 | |
19 | 31 | do { |
20 | 32 | $i--; |
21 | 33 | } while ($something); |
22 | 34 | |
23 | -if(true) |
|
35 | +if(true) { |
|
24 | 36 | $someObject->{$name}; |
37 | +} |
|
25 | 38 | |
26 | 39 | if (true) : |
27 | 40 | $foo = true; |
@@ -42,31 +55,37 @@ discard block |
||
42 | 55 | while (!$this->readLine($tokens, $tag)); |
43 | 56 | while (!$this->readLine($tokens, $tag)); //skip to end of file |
44 | 57 | |
45 | -foreach ($cookies as $cookie) |
|
58 | +foreach ($cookies as $cookie) { |
|
46 | 59 | if ($cookie->match($uri, $matchSessionCookies, $now)) |
47 | 60 | $ret[] = $cookie; |
61 | +} |
|
48 | 62 | |
49 | -foreach ($stringParade as $hit) |
|
50 | - $hitParade[] = $hit + 0; //cast to integer |
|
63 | +foreach ($stringParade as $hit) { |
|
64 | + $hitParade[] = $hit + 0; |
|
65 | +} |
|
66 | +//cast to integer |
|
51 | 67 | |
52 | 68 | if ($foo) : |
53 | 69 | echo 'true'; |
54 | 70 | elseif ($something) : |
55 | 71 | echo 'foo'; |
56 | -else: |
|
72 | +else { |
|
73 | + : |
|
57 | 74 | echo 'false'; |
75 | +} |
|
58 | 76 | endif; |
59 | 77 | |
60 | -function test() |
|
61 | -{ |
|
62 | - if ($a) |
|
63 | - $a.=' '.($b ? 'b' : ($c ? ($d ? 'd' : 'c') : '')); |
|
64 | -} |
|
78 | +function test() { |
|
79 | + if ($a) { |
|
80 | + $a.=' '.($b ? 'b' : ($c ? ($d ? 'd' : 'c') : '')); |
|
81 | + } |
|
82 | + } |
|
65 | 83 | |
66 | -if ($a) |
|
84 | +if ($a) { |
|
67 | 85 | foreach ($b as $c) { |
68 | 86 | if ($d) { |
69 | 87 | $e=$f; |
88 | +} |
|
70 | 89 | $g=$h; |
71 | 90 | } elseif ($i==0) { |
72 | 91 | $j=$k; |
@@ -75,7 +94,8 @@ discard block |
||
75 | 94 | |
76 | 95 | ?> |
77 | 96 | <div style="text-align: right;"> |
78 | - <?php if ($model->scenario == 'simple') $widget->renderPager() ?> |
|
97 | + <?php if ($model->scenario == 'simple') { |
|
98 | + $widget->renderPager() ?> |
|
79 | 99 | </div> |
80 | 100 | |
81 | 101 | <?php |
@@ -83,6 +103,7 @@ discard block |
||
83 | 103 | case Shop_Customer :: ERROR_INVALID_GENDER: ?> |
84 | 104 | Ungültiges Geschlecht! |
85 | 105 | <?php break; |
106 | +} |
|
86 | 107 | case Shop_Customer :: ERROR_EMAIL_IN_USE: ?> |
87 | 108 | Die eingetragene E-Mail-Adresse ist bereits registriert. |
88 | 109 | <?php break; |
@@ -95,8 +116,10 @@ discard block |
||
95 | 116 | echo 'foo'; |
96 | 117 | endswitch; |
97 | 118 | endif; |
98 | -else: |
|
119 | +else { |
|
120 | + : |
|
99 | 121 | echo 'foo'; |
122 | +} |
|
100 | 123 | endif; |
101 | 124 | |
102 | 125 | // ELSE IF split over multiple lines (not inline) |
@@ -117,85 +140,109 @@ discard block |
||
117 | 140 | } |
118 | 141 | |
119 | 142 | $stuff = [1,2,3]; |
120 | -foreach($stuff as $num) |
|
143 | +foreach($stuff as $num) { |
|
121 | 144 | if ($num %2 ) { |
122 | 145 | echo "even"; |
146 | +} |
|
123 | 147 | } else { |
124 | 148 | echo "odd"; |
125 | 149 | } |
126 | 150 | |
127 | 151 | $i = 0; |
128 | -foreach($stuff as $num) |
|
152 | +foreach($stuff as $num) { |
|
129 | 153 | do { |
130 | 154 | echo $i; |
155 | +} |
|
131 | 156 | $i++; |
132 | 157 | } while ($i < 5); |
133 | 158 | |
134 | -foreach($stuff as $num) |
|
159 | +foreach($stuff as $num) { |
|
135 | 160 | if (true) { |
136 | 161 | echo "true1\n"; |
162 | +} |
|
137 | 163 | } |
138 | 164 | if (true) { |
139 | 165 | echo "true2\n"; |
140 | 166 | } |
141 | 167 | |
142 | -if ($foo) echo 'foo'; |
|
143 | -elseif ($bar) echo 'bar'; |
|
144 | -else echo 'baz'; |
|
168 | +if ($foo) { |
|
169 | + echo 'foo'; |
|
170 | +} elseif ($bar) { |
|
171 | + echo 'bar'; |
|
172 | +} else { |
|
173 | + echo 'baz'; |
|
174 | +} |
|
145 | 175 | |
146 | 176 | switch ($type) { |
147 | 177 | case 1: |
148 | 178 | if ($foo) { |
149 | 179 | return true; |
150 | - } elseif ($baz) |
|
151 | - return true; |
|
152 | - else { |
|
180 | + } elseif ($baz) { |
|
181 | + return true; |
|
182 | + } else { |
|
153 | 183 | echo 'else'; |
154 | 184 | } |
155 | 185 | break; |
156 | 186 | } |
157 | 187 | |
158 | -foreach ($sql as $s) |
|
188 | +foreach ($sql as $s) { |
|
159 | 189 | if (!$this->execute) echo "<pre>",$s.";\n</pre>"; |
190 | +} |
|
160 | 191 | else { |
161 | 192 | $ok = $this->connDest->Execute($s); |
162 | - if (!$ok) |
|
163 | - if ($this->neverAbort) $ret = false; |
|
164 | - else return false; |
|
193 | + if (!$ok) { |
|
194 | + if ($this->neverAbort) $ret = false; |
|
195 | + } else { |
|
196 | + return false; |
|
197 | + } |
|
165 | 198 | } |
166 | 199 | |
167 | -if ($bar) |
|
168 | - if ($foo) echo 'hi'; // lol |
|
200 | +if ($bar) { |
|
201 | + if ($foo) echo 'hi'; |
|
202 | +} |
|
203 | +// lol |
|
169 | 204 | |
170 | -if ($level == 'district') |
|
205 | +if ($level == 'district') { |
|
171 | 206 | \DB::update(<<<EOD |
172 | 207 | some |
173 | 208 | text |
174 | 209 | here |
175 | 210 | EOD |
176 | 211 | ); |
212 | +} |
|
177 | 213 | |
178 | -if ($level == 'district') |
|
214 | +if ($level == 'district') { |
|
179 | 215 | $var = <<<EOD |
180 | 216 | some |
181 | 217 | text |
182 | 218 | here |
183 | 219 | EOD; |
220 | +} |
|
184 | 221 | |
185 | -if ($a && $a === Foo::VARIABLE && ($a === Foo::METHOD || $a === Foo::FUNCTION)) |
|
222 | +if ($a && $a === Foo::VARIABLE && ($a === Foo::METHOD || $a === Foo::FUNCTION)) { |
|
186 | 223 | echo 'hi'; |
224 | +} |
|
187 | 225 | |
188 | -$out = array_map(function ($test) { if ($test) return 1; else return 2; }, $input); // comment |
|
226 | +$out = array_map(function ($test) { if ($test) { |
|
227 | + return 1; |
|
228 | +} else { |
|
229 | + return 2; |
|
230 | +} |
|
231 | +}, $input); // comment |
|
189 | 232 | |
190 | 233 | for ($x=0;$x<5;$x++): |
191 | - if ($x) continue; |
|
192 | -endfor; |
|
234 | + if ($x) { |
|
235 | + continue; |
|
236 | + } |
|
237 | + endfor; |
|
193 | 238 | |
194 | 239 | for ($x=0;$x<5;$x++): |
195 | - if ($x) continue ?> <?php |
|
240 | + if ($x) { |
|
241 | + continue ?> <?php |
|
196 | 242 | endfor; |
243 | + } |
|
197 | 244 | |
198 | -if (true) |
|
245 | +if (true) { |
|
199 | 246 | try { |
200 | 247 | } |
201 | 248 | catch(Exception $e) { |
@@ -209,6 +256,7 @@ discard block |
||
209 | 256 | "foobarbaz" |
210 | 257 | ) |
211 | 258 | ); |
259 | +} |
|
212 | 260 | break; |
213 | 261 | } |
214 | 262 | |
@@ -219,9 +267,10 @@ discard block |
||
219 | 267 | while ($i < 10); |
220 | 268 | |
221 | 269 | if ($this) { |
222 | - if ($that) |
|
223 | - foo(${$a[$b]}); |
|
224 | -} |
|
270 | + if ($that) { |
|
271 | + foo(${$a[$b]}); |
|
272 | + } |
|
273 | + } |
|
225 | 274 | |
226 | 275 | while (!$this->readLine($tokens, $tag)); //phpcs:ignore Standard.Category.Sniff |
227 | 276 | |
@@ -229,12 +278,18 @@ discard block |
||
229 | 278 | |
230 | 279 | while (!$this->readLine($tokens, $tag)); /* comment */ |
231 | 280 | |
232 | -foreach ($stringParade as $hit) |
|
233 | - $hitParade[] = $hit + 0; // phpcs:ignore Standard.Category.Sniff |
|
281 | +foreach ($stringParade as $hit) { |
|
282 | + $hitParade[] = $hit + 0; |
|
283 | +} |
|
284 | +// phpcs:ignore Standard.Category.Sniff |
|
234 | 285 | |
235 | -if ($bar) |
|
236 | - if ($foo) echo 'hi'; /* @phpcs:ignore Standard.Category.Sniff */ |
|
286 | +if ($bar) { |
|
287 | + if ($foo) echo 'hi'; |
|
288 | +} |
|
289 | +/* @phpcs:ignore Standard.Category.Sniff */ |
|
237 | 290 | |
238 | -if (true) $callable = function () { |
|
291 | +if (true) { |
|
292 | + $callable = function () { |
|
239 | 293 | return true; |
294 | +} |
|
240 | 295 | }; |
@@ -172,7 +172,7 @@ discard block |
||
172 | 172 | some |
173 | 173 | text |
174 | 174 | here |
175 | -EOD |
|
175 | +eod |
|
176 | 176 | ); |
177 | 177 | |
178 | 178 | if ($level == 'district') |
@@ -180,9 +180,9 @@ discard block |
||
180 | 180 | some |
181 | 181 | text |
182 | 182 | here |
183 | -EOD; |
|
183 | +eod; |
|
184 | 184 | |
185 | -if ($a && $a === Foo::VARIABLE && ($a === Foo::METHOD || $a === Foo::FUNCTION)) |
|
185 | +if ($a && $a === Foo::VARIABLE && ($a === Foo::METHOD || $a === Foo::function)) |
|
186 | 186 | echo 'hi'; |
187 | 187 | |
188 | 188 | $out = array_map(function ($test) { if ($test) return 1; else return 2; }, $input); // comment |