Skip to content

Commit

Permalink
PHP 8.0 | Generic/ArrayIndent: add tests with match control structure
Browse files Browse the repository at this point in the history
  • Loading branch information
jrfnl committed Feb 23, 2021
1 parent b52a018 commit 48b3d88
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/Standards/Generic/Tests/Arrays/ArrayIndentUnitTest.inc
Original file line number Diff line number Diff line change
Expand Up @@ -86,3 +86,15 @@ $var = [
2 => 'two',
/* three */ 3 => 'three',
];

// phpcs:set Generic.Arrays.ArrayIndent indent 4

$array = array(
match ($test) { 1 => 'a', 2 => 'b' }
=> 'dynamic keys, woho!',
);

$array = [
match ($test) { 1 => 'a', 2 => 'b' }
=> 'dynamic keys, woho!',
];
12 changes: 12 additions & 0 deletions src/Standards/Generic/Tests/Arrays/ArrayIndentUnitTest.inc.fixed
Original file line number Diff line number Diff line change
Expand Up @@ -87,3 +87,15 @@ $var = [
2 => 'two',
/* three */ 3 => 'three',
];

// phpcs:set Generic.Arrays.ArrayIndent indent 4

$array = array(
match ($test) { 1 => 'a', 2 => 'b' }
=> 'dynamic keys, woho!',
);

$array = [
match ($test) { 1 => 'a', 2 => 'b' }
=> 'dynamic keys, woho!',
];
1 change: 1 addition & 0 deletions src/Standards/Generic/Tests/Arrays/ArrayIndentUnitTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ public function getErrorList()
86 => 1,
87 => 1,
88 => 1,
98 => 1,
];

}//end getErrorList()
Expand Down

0 comments on commit 48b3d88

Please sign in to comment.