Skip to content

Commit 0734364

Browse files
authored
Merge pull request #2301 from WordPress/feature/arraydeclarationspacing-phpcsutils-phpcsextra
Arrays/ArrayDeclarationSpacing: partially replace the sniff + implement PHPCSUtils in what remains
2 parents ceff5f5 + c7eae91 commit 0734364

8 files changed

+136
-500
lines changed

WordPress-Core/ruleset.xml

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -256,10 +256,18 @@
256256

257257
<!-- Generic array layout check. -->
258258
<!-- Covers rule: For associative arrays, each item should start on a new line
259-
when the array contains more than one item.
260-
Also covers various single-line array whitespace issues. -->
259+
when the array contains more than one item. -->
261260
<rule ref="WordPress.Arrays.ArrayDeclarationSpacing"/>
262261

262+
<!-- Covers various array whitespace issues. -->
263+
<rule ref="NormalizedArrays.Arrays.ArrayBraceSpacing">
264+
<properties>
265+
<property name="spacesWhenEmpty" value="0"/>
266+
<property name="spacesSingleLine" value="1"/>
267+
<property name="spacesMultiLine" value="newline"/>
268+
</properties>
269+
</rule>
270+
263271
<!-- Covers rule: Note the comma after the last array item: this is recommended. -->
264272
<rule ref="WordPress.Arrays.CommaAfterArrayItem"/>
265273

0 commit comments

Comments
 (0)