Skip to content
This repository was archived by the owner on Nov 21, 2019. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/Libero/ruleset.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
<exclude name="PSR2.Namespaces.UseDeclaration.SpaceAfterLastUse"/>
</rule>

<rule ref="SlevomatCodingStandard.Namespaces.UnusedUses"/>
<rule ref="SlevomatCodingStandard.Namespaces.UseDoesNotStartWithBackslash"/>
<rule ref="SlevomatCodingStandard.Namespaces.UseSpacing"/>
<rule ref="SlevomatCodingStandard.TypeHints.ParameterTypeHintSpacing"/>
Expand Down
8 changes: 8 additions & 0 deletions tests/cases/php/use-groups
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@ use Foo\{ Bar, Baz as Qux, Quux\Quuz, const CORGE, function grault };
use const Foo\{ GARPLY as WALDO, Quux\FRED };
use function Foo\{ plugh as xyzzy, Quux\thud };

new Bar(grault(CORGE));
new Qux(xyzzy(WALDO));
new Quuz(thud(FRED));

---FIXED---
<?php
namespace Vendor;
Expand All @@ -22,4 +26,8 @@ use const Foo\Quux\FRED;
use function Foo\plugh as xyzzy;
use function Foo\Quux\thud;

new Bar(grault(CORGE));
new Qux(xyzzy(WALDO));
new Quuz(thud(FRED));

---
18 changes: 18 additions & 0 deletions tests/cases/php/use-unused
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
---DESCRIPTION---
Use statements must be used
---CONTENTS---
<?php
namespace Vendor;

use Foo;
use Bar\Baz;
use const QUX;
use const Bar\QUUX;
use function quuz;
use function Bar\corge;

---FIXED---
<?php
namespace Vendor;

---