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

Commit 6e6f36a

Browse files
Arrays must be created before being used (#48)
1 parent 0db1bcf commit 6e6f36a

File tree

2 files changed

+13
-0
lines changed

2 files changed

+13
-0
lines changed

src/Libero/ruleset.xml

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

tests/cases/php/array-creation

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
---DESCRIPTION---
2+
Arrays must be created before being used
3+
---CONTENTS---
4+
<?php
5+
6+
declare(strict_types=1);
7+
8+
$foo['bar'] = $baz;
9+
10+
---MESSAGES---
11+
5:1 SlevomatCodingStandard.Arrays.DisallowImplicitArrayCreation.ImplicitArrayCreationUsed
12+
---

0 commit comments

Comments
 (0)