@@ -34,19 +34,19 @@ discard block |
||
34 | 34 | $obj->{$var}( $foo,$bar ); |
35 | 35 | |
36 | 36 | $bar(function( $a, $b ) { |
37 | - return function( $c, $d ) use ( $a, $b ) { |
|
38 | - echo $a, $b, $c, $d; |
|
39 | - }; |
|
37 | + return function( $c, $d ) use ( $a, $b ) { |
|
38 | + echo $a, $b, $c, $d; |
|
39 | + }; |
|
40 | 40 | })( 'a','b' )( 'c','d' ); |
41 | 41 | |
42 | 42 | $closure( $foo,$bar ); |
43 | 43 | $var = $closure() + $closure( $foo,$bar ) + self::$closure( $foo,$bar ); |
44 | 44 | |
45 | 45 | class Test { |
46 | - public static function baz( $foo, $bar ) { |
|
47 | - $a = new self( $foo,$bar ); |
|
48 | - $b = new static( $foo,$bar ); |
|
49 | - } |
|
46 | + public static function baz( $foo, $bar ) { |
|
47 | + $a = new self( $foo,$bar ); |
|
48 | + $b = new static( $foo,$bar ); |
|
49 | + } |
|
50 | 50 | } |
51 | 51 | |
52 | 52 | /* |
@@ -64,13 +64,13 @@ discard block |
||
64 | 64 | if (( null !== $extra ) && ( $row->extra !== $extra )) {} // Bad x 4. |
65 | 65 | |
66 | 66 | if (( null !== $extra // Bad x 1. |
67 | - && is_int($extra)) |
|
68 | - && ( $row->extra !== $extra // Bad x 1. |
|
69 | - || $something ) // Bad x 1. |
|
67 | + && is_int($extra)) |
|
68 | + && ( $row->extra !== $extra // Bad x 1. |
|
69 | + || $something ) // Bad x 1. |
|
70 | 70 | ) {} |
71 | 71 | |
72 | 72 | if (( null !== $extra ) // Bad x 2. |
73 | - && ( $row->extra !== $extra ) // Bad x 2. |
|
73 | + && ( $row->extra !== $extra ) // Bad x 2. |
|
74 | 74 | ) {} |
75 | 75 | |
76 | 76 | $a = (null !== $extra); |
@@ -92,13 +92,13 @@ discard block |
||
92 | 92 | if (( null !== $extra ) && ( $row->extra !== $extra )) {} |
93 | 93 | |
94 | 94 | if (( null !== $extra // Bad x 1. |
95 | - && is_int($extra)) // Bad x 1. |
|
96 | - && ( $row->extra !== $extra |
|
97 | - || $something ) // Bad x 1. |
|
95 | + && is_int($extra)) // Bad x 1. |
|
96 | + && ( $row->extra !== $extra |
|
97 | + || $something ) // Bad x 1. |
|
98 | 98 | ) {} |
99 | 99 | |
100 | 100 | if ((null !== $extra) // Bad x 2. |
101 | - && ($row->extra !== $extra) // Bad x 2. |
|
101 | + && ($row->extra !== $extra) // Bad x 2. |
|
102 | 102 | ) {} |
103 | 103 | |
104 | 104 | $a = (null !== $extra); // Bad x 2. |
@@ -120,42 +120,42 @@ discard block |
||
120 | 120 | * Test handling of ignoreNewlines. |
121 | 121 | */ |
122 | 122 | if ( |
123 | - ( |
|
124 | - null !== $extra |
|
125 | - ) && ( |
|
126 | - $row->extra !== $extra |
|
127 | - ) |
|
123 | + ( |
|
124 | + null !== $extra |
|
125 | + ) && ( |
|
126 | + $row->extra !== $extra |
|
127 | + ) |
|
128 | 128 | ) {} // Bad x 4, 1 x line 123, 2 x line 125, 1 x line 127. |
129 | 129 | |
130 | 130 | |
131 | 131 | $a = ( |
132 | - null !== $extra |
|
132 | + null !== $extra |
|
133 | 133 | ); // Bad x 2, 1 x line 131, 1 x line 133. |
134 | 134 | |
135 | 135 | // phpcs:set Generic.WhiteSpace.ArbitraryParenthesesSpacing spacing 1 |
136 | 136 | if ( |
137 | - ( |
|
138 | - null !== $extra |
|
139 | - ) && ( |
|
140 | - $row->extra !== $extra |
|
141 | - ) |
|
137 | + ( |
|
138 | + null !== $extra |
|
139 | + ) && ( |
|
140 | + $row->extra !== $extra |
|
141 | + ) |
|
142 | 142 | ) {} // Bad x 4, 1 x line 137, 2 x line 139, 1 x line 141. |
143 | 143 | |
144 | 144 | $a = ( |
145 | - null !== $extra |
|
145 | + null !== $extra |
|
146 | 146 | ); // Bad x 2, 1 x line 144, 1 x line 146. |
147 | 147 | // phpcs:set Generic.WhiteSpace.ArbitraryParenthesesSpacing spacing 0 |
148 | 148 | |
149 | 149 | // phpcs:set Generic.WhiteSpace.ArbitraryParenthesesSpacing ignoreNewlines true |
150 | 150 | if ( |
151 | - ( |
|
152 | - null !== $extra |
|
153 | - ) && ( |
|
154 | - $row->extra !== $extra |
|
155 | - ) |
|
151 | + ( |
|
152 | + null !== $extra |
|
153 | + ) && ( |
|
154 | + $row->extra !== $extra |
|
155 | + ) |
|
156 | 156 | ) {} |
157 | 157 | |
158 | 158 | $a = ( |
159 | - null !== $extra |
|
159 | + null !== $extra |
|
160 | 160 | ); |
161 | 161 | // phpcs:set Generic.WhiteSpace.ArbitraryParenthesesSpacing ignoreNewlines false |
@@ -1,58 +1,58 @@ |
||
1 | 1 | <?php |
2 | 2 | $var = [1,2,3]; |
3 | 3 | $var = [ |
4 | - 1, |
|
5 | - 2, |
|
6 | - 3 |
|
4 | + 1, |
|
5 | + 2, |
|
6 | + 3 |
|
7 | 7 | ]; |
8 | 8 | $var = [ |
9 | - 1, |
|
10 | - 2, |
|
11 | - /* three */ 3, |
|
9 | + 1, |
|
10 | + 2, |
|
11 | + /* three */ 3, |
|
12 | 12 | ]; |
13 | 13 | $var = [ |
14 | 14 | 1, |
15 | - 2, |
|
16 | - /* three */ 3, |
|
15 | + 2, |
|
16 | + /* three */ 3, |
|
17 | 17 | ]; |
18 | 18 | |
19 | 19 | $var = [ |
20 | - 1 => 'one', |
|
21 | - 2 => 'two', |
|
22 | - 3 => 'three' |
|
20 | + 1 => 'one', |
|
21 | + 2 => 'two', |
|
22 | + 3 => 'three' |
|
23 | 23 | ]; |
24 | 24 | $var = [ |
25 | - 1 => 'one', |
|
26 | - 2 => 'two', |
|
27 | - /* three */ 3 => 'three', |
|
25 | + 1 => 'one', |
|
26 | + 2 => 'two', |
|
27 | + /* three */ 3 => 'three', |
|
28 | 28 | ]; |
29 | 29 | $var = [ |
30 | 30 | 1 => 'one', |
31 | - 2 => 'two', |
|
32 | - /* three */ 3 => 'three', |
|
33 | - ]; |
|
31 | + 2 => 'two', |
|
32 | + /* three */ 3 => 'three', |
|
33 | + ]; |
|
34 | 34 | |
35 | 35 | $var = array( |
36 | - 'one' => function() { |
|
37 | - $foo = [1,2,3]; |
|
38 | - $bar = [ |
|
39 | - 1, |
|
40 | - 2, |
|
41 | - 3]; |
|
42 | - }, |
|
43 | - 'two' => 2, |
|
36 | + 'one' => function() { |
|
37 | + $foo = [1,2,3]; |
|
38 | + $bar = [ |
|
39 | + 1, |
|
40 | + 2, |
|
41 | + 3]; |
|
42 | + }, |
|
43 | + 'two' => 2, |
|
44 | 44 | ); |
45 | 45 | |
46 | 46 | return [ |
47 | - [ |
|
48 | - 'foo' => true, |
|
49 | - ] |
|
47 | + [ |
|
48 | + 'foo' => true, |
|
49 | + ] |
|
50 | 50 | ]; |
51 | 51 | |
52 | 52 | // phpcs:set Generic.Arrays.ArrayIndent indent 2 |
53 | 53 | |
54 | 54 | $var = [ |
55 | 55 | 1 => 'one', |
56 | - 2 => 'two', |
|
57 | - /* three */ 3 => 'three', |
|
58 | - ]; |
|
56 | + 2 => 'two', |
|
57 | + /* three */ 3 => 'three', |
|
58 | + ]; |
@@ -15,46 +15,46 @@ |
||
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 | - 14 => 1, |
|
30 | - 15 => 1, |
|
31 | - 17 => 1, |
|
32 | - 30 => 1, |
|
33 | - 31 => 1, |
|
34 | - 33 => 1, |
|
35 | - 41 => 1, |
|
36 | - 55 => 1, |
|
37 | - 56 => 1, |
|
38 | - 57 => 1, |
|
39 | - 58 => 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 | - * @return array<int, int> |
|
52 | - */ |
|
53 | - public function getWarningList() |
|
54 | - { |
|
55 | - return []; |
|
56 | - |
|
57 | - }//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 | + 14 => 1, |
|
30 | + 15 => 1, |
|
31 | + 17 => 1, |
|
32 | + 30 => 1, |
|
33 | + 31 => 1, |
|
34 | + 33 => 1, |
|
35 | + 41 => 1, |
|
36 | + 55 => 1, |
|
37 | + 56 => 1, |
|
38 | + 57 => 1, |
|
39 | + 58 => 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 | + * @return array<int, int> |
|
52 | + */ |
|
53 | + public function getWarningList() |
|
54 | + { |
|
55 | + return []; |
|
56 | + |
|
57 | + }//end getWarningList() |
|
58 | 58 | |
59 | 59 | |
60 | 60 | }//end class |
@@ -5,10 +5,10 @@ |
||
5 | 5 | echo $var[1]; |
6 | 6 | $foo = array($var[1],$var[2]); |
7 | 7 | $foo = array( |
8 | - 1, |
|
9 | - 2, |
|
10 | - 3 |
|
11 | - ); |
|
8 | + 1, |
|
9 | + 2, |
|
10 | + 3 |
|
11 | + ); |
|
12 | 12 | $var = array/*comment*/(1,2,3); |
13 | 13 | $var = array; |
14 | 14 |
@@ -6,7 +6,7 @@ |
||
6 | 6 | echo $var[1]; |
7 | 7 | $foo = [$var[1],$var[2]]; |
8 | 8 | $foo = [ |
9 | - 1, |
|
10 | - 2, |
|
11 | - 3 |
|
12 | - ]; |
|
9 | + 1, |
|
10 | + 2, |
|
11 | + 3 |
|
12 | + ]; |
@@ -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 | - * @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 'DisallowLongArraySyntaxUnitTest.1.inc': |
|
32 | - return [ |
|
33 | - 2 => 1, |
|
34 | - 4 => 1, |
|
35 | - 6 => 1, |
|
36 | - 7 => 1, |
|
37 | - 12 => 1, |
|
38 | - 13 => 1, |
|
39 | - ]; |
|
40 | - case 'DisallowLongArraySyntaxUnitTest.2.inc': |
|
41 | - return [ |
|
42 | - 2 => 1, |
|
43 | - 9 => 1, |
|
44 | - ]; |
|
45 | - default: |
|
46 | - return []; |
|
47 | - }//end switch |
|
18 | + /** |
|
19 | + * Returns the lines where errors should occur. |
|
20 | + * |
|
21 | + * The key of the array should represent the line number and the value |
|
22 | + * should represent the number of errors that should occur on that line. |
|
23 | + * |
|
24 | + * @param string $testFile The name of the file being tested. |
|
25 | + * |
|
26 | + * @return array<int, int> |
|
27 | + */ |
|
28 | + public function getErrorList($testFile='') |
|
29 | + { |
|
30 | + switch ($testFile) { |
|
31 | + case 'DisallowLongArraySyntaxUnitTest.1.inc': |
|
32 | + return [ |
|
33 | + 2 => 1, |
|
34 | + 4 => 1, |
|
35 | + 6 => 1, |
|
36 | + 7 => 1, |
|
37 | + 12 => 1, |
|
38 | + 13 => 1, |
|
39 | + ]; |
|
40 | + case 'DisallowLongArraySyntaxUnitTest.2.inc': |
|
41 | + return [ |
|
42 | + 2 => 1, |
|
43 | + 9 => 1, |
|
44 | + ]; |
|
45 | + default: |
|
46 | + return []; |
|
47 | + }//end switch |
|
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 |
@@ -5,13 +5,7 @@ |
||
5 | 5 | // This is not a merge conflict - it is a valid test case to test handling of arrays without associated closer. |
6 | 6 | // Please do not remove. |
7 | 7 | function test() |
8 | - { |
|
9 | - $arr = array( |
|
10 | - 'a' => 'a', |
|
8 | + { |
|
9 | + $arr = array( |
|
10 | + 'a' => 'a', |
|
11 | 11 | <<<<<<< HEAD |
12 | - 'b' => 'b' |
|
13 | -======= |
|
14 | - 'c' => 'c' |
|
15 | ->>>>>>> master |
|
16 | - ); |
|
17 | - } |
@@ -15,39 +15,39 @@ |
||
15 | 15 | { |
16 | 16 | |
17 | 17 | |
18 | - /** |
|
19 | - * Returns the lines where errors should occur. |
|
20 | - * |
|
21 | - * The key of the array should represent the line number and the value |
|
22 | - * should represent the number of errors that should occur on that line. |
|
23 | - * |
|
24 | - * @return array<int, int> |
|
25 | - */ |
|
26 | - public function getErrorList() |
|
27 | - { |
|
28 | - return [ |
|
29 | - 3 => 1, |
|
30 | - 5 => 1, |
|
31 | - 7 => 1, |
|
32 | - 8 => 1, |
|
33 | - ]; |
|
34 | - |
|
35 | - }//end getErrorList() |
|
36 | - |
|
37 | - |
|
38 | - /** |
|
39 | - * Returns the lines where warnings should occur. |
|
40 | - * |
|
41 | - * The key of the array should represent the line number and the value |
|
42 | - * should represent the number of warnings that should occur on that line. |
|
43 | - * |
|
44 | - * @return array<int, int> |
|
45 | - */ |
|
46 | - public function getWarningList() |
|
47 | - { |
|
48 | - return []; |
|
49 | - |
|
50 | - }//end getWarningList() |
|
18 | + /** |
|
19 | + * Returns the lines where errors should occur. |
|
20 | + * |
|
21 | + * The key of the array should represent the line number and the value |
|
22 | + * should represent the number of errors that should occur on that line. |
|
23 | + * |
|
24 | + * @return array<int, int> |
|
25 | + */ |
|
26 | + public function getErrorList() |
|
27 | + { |
|
28 | + return [ |
|
29 | + 3 => 1, |
|
30 | + 5 => 1, |
|
31 | + 7 => 1, |
|
32 | + 8 => 1, |
|
33 | + ]; |
|
34 | + |
|
35 | + }//end getErrorList() |
|
36 | + |
|
37 | + |
|
38 | + /** |
|
39 | + * Returns the lines where warnings should occur. |
|
40 | + * |
|
41 | + * The key of the array should represent the line number and the value |
|
42 | + * should represent the number of warnings that should occur on that line. |
|
43 | + * |
|
44 | + * @return array<int, int> |
|
45 | + */ |
|
46 | + public function getWarningList() |
|
47 | + { |
|
48 | + return []; |
|
49 | + |
|
50 | + }//end getWarningList() |
|
51 | 51 | |
52 | 52 | |
53 | 53 | }//end class |
@@ -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 | - 9 => 1, |
|
30 | - 12 => 1, |
|
31 | - 15 => 1, |
|
32 | - 18 => 2, |
|
33 | - 23 => 1, |
|
34 | - 30 => 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 | + 9 => 1, |
|
30 | + 12 => 1, |
|
31 | + 15 => 1, |
|
32 | + 18 => 2, |
|
33 | + 23 => 1, |
|
34 | + 30 => 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 |