Skip to content

Commit 8fd9d04

Browse files
committed
Merge branch 'php-8.0/generic-arrayindent-test-named-params' of https://github.com/jrfnl/PHP_CodeSniffer
2 parents c732fec + 77cd2c8 commit 8fd9d04

File tree

3 files changed

+45
-18
lines changed

3 files changed

+45
-18
lines changed

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

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,3 +98,16 @@ $array = [
9898
match ($test) { 1 => 'a', 2 => 'b' }
9999
=> 'dynamic keys, woho!',
100100
];
101+
102+
// Ensure that PHP 8.0 named parameters don't affect the sniff.
103+
$array = [
104+
functionCall(
105+
name: $value
106+
),
107+
];
108+
109+
$array = [
110+
functionCall(
111+
name: $value
112+
),
113+
];

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

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,3 +99,16 @@ $array = [
9999
match ($test) { 1 => 'a', 2 => 'b' }
100100
=> 'dynamic keys, woho!',
101101
];
102+
103+
// Ensure that PHP 8.0 named parameters don't affect the sniff.
104+
$array = [
105+
functionCall(
106+
name: $value
107+
),
108+
];
109+
110+
$array = [
111+
functionCall(
112+
name: $value
113+
),
114+
];

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

Lines changed: 19 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -26,24 +26,25 @@ class ArrayIndentUnitTest extends AbstractSniffUnitTest
2626
public function getErrorList()
2727
{
2828
return [
29-
14 => 1,
30-
15 => 1,
31-
17 => 1,
32-
30 => 1,
33-
31 => 1,
34-
33 => 1,
35-
41 => 1,
36-
62 => 1,
37-
63 => 1,
38-
69 => 1,
39-
77 => 1,
40-
78 => 1,
41-
79 => 1,
42-
85 => 1,
43-
86 => 1,
44-
87 => 1,
45-
88 => 1,
46-
98 => 1,
29+
14 => 1,
30+
15 => 1,
31+
17 => 1,
32+
30 => 1,
33+
31 => 1,
34+
33 => 1,
35+
41 => 1,
36+
62 => 1,
37+
63 => 1,
38+
69 => 1,
39+
77 => 1,
40+
78 => 1,
41+
79 => 1,
42+
85 => 1,
43+
86 => 1,
44+
87 => 1,
45+
88 => 1,
46+
98 => 1,
47+
110 => 1,
4748
];
4849

4950
}//end getErrorList()

0 commit comments

Comments
 (0)