Skip to content

Commit

Permalink
Merge branch 'php-8.0/generic-arrayindent-test-named-params' of https…
Browse files Browse the repository at this point in the history
  • Loading branch information
gsherwood committed Dec 22, 2022
2 parents c732fec + 77cd2c8 commit 8fd9d04
Show file tree
Hide file tree
Showing 3 changed files with 45 additions and 18 deletions.
13 changes: 13 additions & 0 deletions src/Standards/Generic/Tests/Arrays/ArrayIndentUnitTest.inc
Original file line number Diff line number Diff line change
Expand Up @@ -98,3 +98,16 @@ $array = [
match ($test) { 1 => 'a', 2 => 'b' }
=> 'dynamic keys, woho!',
];

// Ensure that PHP 8.0 named parameters don't affect the sniff.
$array = [
functionCall(
name: $value
),
];

$array = [
functionCall(
name: $value
),
];
13 changes: 13 additions & 0 deletions src/Standards/Generic/Tests/Arrays/ArrayIndentUnitTest.inc.fixed
Original file line number Diff line number Diff line change
Expand Up @@ -99,3 +99,16 @@ $array = [
match ($test) { 1 => 'a', 2 => 'b' }
=> 'dynamic keys, woho!',
];

// Ensure that PHP 8.0 named parameters don't affect the sniff.
$array = [
functionCall(
name: $value
),
];

$array = [
functionCall(
name: $value
),
];
37 changes: 19 additions & 18 deletions src/Standards/Generic/Tests/Arrays/ArrayIndentUnitTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,24 +26,25 @@ class ArrayIndentUnitTest extends AbstractSniffUnitTest
public function getErrorList()
{
return [
14 => 1,
15 => 1,
17 => 1,
30 => 1,
31 => 1,
33 => 1,
41 => 1,
62 => 1,
63 => 1,
69 => 1,
77 => 1,
78 => 1,
79 => 1,
85 => 1,
86 => 1,
87 => 1,
88 => 1,
98 => 1,
14 => 1,
15 => 1,
17 => 1,
30 => 1,
31 => 1,
33 => 1,
41 => 1,
62 => 1,
63 => 1,
69 => 1,
77 => 1,
78 => 1,
79 => 1,
85 => 1,
86 => 1,
87 => 1,
88 => 1,
98 => 1,
110 => 1,
];

}//end getErrorList()
Expand Down

0 comments on commit 8fd9d04

Please sign in to comment.