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

Commit 6bfa0b2

Browse files
UnusedUses needs to take annotations into account (#25)
1 parent 1389cf6 commit 6bfa0b2

File tree

2 files changed

+26
-1
lines changed

2 files changed

+26
-1
lines changed

src/Libero/ruleset.xml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,11 @@
3232
<property name="allowFallbackGlobalFunctions" value="false"/>
3333
</properties>
3434
</rule>
35-
<rule ref="SlevomatCodingStandard.Namespaces.UnusedUses"/>
35+
<rule ref="SlevomatCodingStandard.Namespaces.UnusedUses">
36+
<properties>
37+
<property name="searchAnnotations" value="true"/>
38+
</properties>
39+
</rule>
3640
<rule ref="SlevomatCodingStandard.Namespaces.UseDoesNotStartWithBackslash"/>
3741
<rule ref="SlevomatCodingStandard.Namespaces.UseFromSameNamespace"/>
3842
<rule ref="SlevomatCodingStandard.Namespaces.UseSpacing"/>

tests/cases/php/use-unused

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
---DESCRIPTION---
22
Use statements must be used
3+
---FILENAME---
4+
Grault.php
35
---CONTENTS---
46
<?php
57

@@ -9,16 +11,35 @@ namespace Vendor;
911

1012
use Foo;
1113
use Bar\Baz;
14+
use Garply;
1215
use const QUX;
1316
use const Bar\QUUX;
1417
use function quuz;
1518
use function Bar\corge;
1619

20+
interface Grault
21+
{
22+
/**
23+
* @throws Garply
24+
*/
25+
public function waldo() : void;
26+
}
27+
1728
---FIXED---
1829
<?php
1930

2031
declare(strict_types=1);
2132

2233
namespace Vendor;
2334

35+
use Garply;
36+
37+
interface Grault
38+
{
39+
/**
40+
* @throws Garply
41+
*/
42+
public function waldo() : void;
43+
}
44+
2445
---

0 commit comments

Comments
 (0)