Skip to content

Commit 48b3d88

Browse files
committed
PHP 8.0 | Generic/ArrayIndent: add tests with match control structure
1 parent b52a018 commit 48b3d88

File tree

3 files changed

+25
-0
lines changed

3 files changed

+25
-0
lines changed

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

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,3 +86,15 @@ $var = [
8686
2 => 'two',
8787
/* three */ 3 => 'three',
8888
];
89+
90+
// phpcs:set Generic.Arrays.ArrayIndent indent 4
91+
92+
$array = array(
93+
match ($test) { 1 => 'a', 2 => 'b' }
94+
=> 'dynamic keys, woho!',
95+
);
96+
97+
$array = [
98+
match ($test) { 1 => 'a', 2 => 'b' }
99+
=> 'dynamic keys, woho!',
100+
];

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

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,3 +87,15 @@ $var = [
8787
2 => 'two',
8888
/* three */ 3 => 'three',
8989
];
90+
91+
// phpcs:set Generic.Arrays.ArrayIndent indent 4
92+
93+
$array = array(
94+
match ($test) { 1 => 'a', 2 => 'b' }
95+
=> 'dynamic keys, woho!',
96+
);
97+
98+
$array = [
99+
match ($test) { 1 => 'a', 2 => 'b' }
100+
=> 'dynamic keys, woho!',
101+
];

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ public function getErrorList()
4343
86 => 1,
4444
87 => 1,
4545
88 => 1,
46+
98 => 1,
4647
];
4748

4849
}//end getErrorList()

0 commit comments

Comments
 (0)