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

Commit 472c04e

Browse files
Use statements must be used (#5)
1 parent 0e12fde commit 472c04e

File tree

3 files changed

+27
-0
lines changed

3 files changed

+27
-0
lines changed

src/Libero/ruleset.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
<exclude name="PSR2.Namespaces.UseDeclaration.SpaceAfterLastUse"/>
1111
</rule>
1212

13+
<rule ref="SlevomatCodingStandard.Namespaces.UnusedUses"/>
1314
<rule ref="SlevomatCodingStandard.Namespaces.UseDoesNotStartWithBackslash"/>
1415
<rule ref="SlevomatCodingStandard.Namespaces.UseSpacing"/>
1516
<rule ref="SlevomatCodingStandard.TypeHints.ParameterTypeHintSpacing"/>

tests/cases/php/use-groups

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,10 @@ use Foo\{ Bar, Baz as Qux, Quux\Quuz, const CORGE, function grault };
88
use const Foo\{ GARPLY as WALDO, Quux\FRED };
99
use function Foo\{ plugh as xyzzy, Quux\thud };
1010

11+
new Bar(grault(CORGE));
12+
new Qux(xyzzy(WALDO));
13+
new Quuz(thud(FRED));
14+
1115
---FIXED---
1216
<?php
1317
namespace Vendor;
@@ -22,4 +26,8 @@ use const Foo\Quux\FRED;
2226
use function Foo\plugh as xyzzy;
2327
use function Foo\Quux\thud;
2428

29+
new Bar(grault(CORGE));
30+
new Qux(xyzzy(WALDO));
31+
new Quuz(thud(FRED));
32+
2533
---

tests/cases/php/use-unused

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
---DESCRIPTION---
2+
Use statements must be used
3+
---CONTENTS---
4+
<?php
5+
namespace Vendor;
6+
7+
use Foo;
8+
use Bar\Baz;
9+
use const QUX;
10+
use const Bar\QUUX;
11+
use function quuz;
12+
use function Bar\corge;
13+
14+
---FIXED---
15+
<?php
16+
namespace Vendor;
17+
18+
---

0 commit comments

Comments
 (0)