Skip to content

Commit c27927c

Browse files
committed
Changelog for #2694 + moved some tests around (ref #2695)
1 parent 15c3308 commit c27927c

File tree

4 files changed

+23
-24
lines changed

4 files changed

+23
-24
lines changed

package.xml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,8 @@ http://pear.php.net/dtd/package-2.0.xsd">
5454
- Fixed bug #2678 : PSR12.Classes.AnonClassDeclaration incorrectly enforcing that closing brace be on a line by itself
5555
- Fixed bug #2685 : File::getMethodParameters() setting typeHintEndToken for vars with no type hint
5656
-- Thanks to Juliette Reinders Folmer for the patch
57+
- Fixed bug #2694 : AbstractArraySniff produces invalid indices when using ternary operator
58+
-- Thanks to Michał Bundyra for the patch
5759
</notes>
5860
<contents>
5961
<dir name="/">

src/Standards/Generic/Tests/Arrays/ArrayIndentUnitTest.inc

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -49,14 +49,6 @@ return [
4949
]
5050
];
5151

52-
// phpcs:set Generic.Arrays.ArrayIndent indent 2
53-
54-
$var = [
55-
1 => 'one',
56-
2 => 'two',
57-
/* three */ 3 => 'three',
58-
];
59-
6052
$array = [
6153
'foo' => 'foo',
6254
'bar' => $baz ?
@@ -66,3 +58,11 @@ $array = [
6658
['one'] ??
6759
['two'],
6860
];
61+
62+
// phpcs:set Generic.Arrays.ArrayIndent indent 2
63+
64+
$var = [
65+
1 => 'one',
66+
2 => 'two',
67+
/* three */ 3 => 'three',
68+
];

src/Standards/Generic/Tests/Arrays/ArrayIndentUnitTest.inc.fixed

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -50,20 +50,20 @@ return [
5050
]
5151
];
5252

53+
$array = [
54+
'foo' => 'foo',
55+
'bar' => $baz ?
56+
['abc'] :
57+
['def'],
58+
'hey' => $baz ??
59+
['one'] ??
60+
['two'],
61+
];
62+
5363
// phpcs:set Generic.Arrays.ArrayIndent indent 2
5464

5565
$var = [
5666
1 => 'one',
5767
2 => 'two',
5868
/* three */ 3 => 'three',
5969
];
60-
61-
$array = [
62-
'foo' => 'foo',
63-
'bar' => $baz ?
64-
['abc'] :
65-
['def'],
66-
'hey' => $baz ??
67-
['one'] ??
68-
['two'],
69-
];

src/Standards/Generic/Tests/Arrays/ArrayIndentUnitTest.php

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -33,13 +33,10 @@ public function getErrorList()
3333
31 => 1,
3434
33 => 1,
3535
41 => 1,
36-
55 => 1,
37-
56 => 1,
38-
57 => 1,
39-
58 => 1,
40-
61 => 1,
41-
62 => 1,
4236
65 => 1,
37+
66 => 1,
38+
67 => 1,
39+
68 => 1,
4340
];
4441

4542
}//end getErrorList()

0 commit comments

Comments
 (0)