Skip to content
This repository was archived by the owner on Nov 21, 2019. It is now read-only.

Commit bc7eb17

Browse files
Trailing comma is required in multi-line arrays (#53)
1 parent 03f3a41 commit bc7eb17

File tree

2 files changed

+28
-0
lines changed

2 files changed

+28
-0
lines changed

src/Libero/ruleset.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
<rule ref="Generic.PHP.LowerCaseType"/>
2626
<rule ref="PEAR.WhiteSpace.ObjectOperatorIndent"/>
2727
<rule ref="SlevomatCodingStandard.Arrays.DisallowImplicitArrayCreation"/>
28+
<rule ref="SlevomatCodingStandard.Arrays.TrailingArrayComma"/>
2829
<rule ref="SlevomatCodingStandard.Classes.ClassConstantVisibility">
2930
<properties>
3031
<property name="fixable" value="true"/>

tests/cases/php/array-comma

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
---DESCRIPTION---
2+
Trailing comma is required in multi-line arrays
3+
---CONTENTS---
4+
<?php
5+
6+
declare(strict_types=1);
7+
8+
['foo', 'bar'];
9+
10+
[
11+
'baz',
12+
'qux'
13+
];
14+
15+
---FIXED---
16+
<?php
17+
18+
declare(strict_types=1);
19+
20+
['foo', 'bar'];
21+
22+
[
23+
'baz',
24+
'qux',
25+
];
26+
27+
---

0 commit comments

Comments
 (0)