Skip to content

Commit 998146c

Browse files
authored
Remove NoSingleInterfaceImplementerRule as way complex, let devs handle it (#156)
1 parent be7b28d commit 998146c

14 files changed

+0
-384
lines changed

README.md

Lines changed: 0 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -596,47 +596,6 @@ final class SomeClass
596596

597597
<br>
598598

599-
### NoSingleInterfaceImplementerRule
600-
601-
Interface "%s" has only single implementer. Consider using the class directly as there is no point in using the interface.
602-
603-
```yaml
604-
rules:
605-
- Symplify\PHPStanRules\Rules\NoSingleInterfaceImplementerRule
606-
```
607-
608-
```php
609-
class SomeClass implements SomeInterface
610-
{
611-
}
612-
613-
interface SomeInterface
614-
{
615-
}
616-
```
617-
618-
:x:
619-
620-
<br>
621-
622-
```php
623-
class SomeClass implements SomeInterface
624-
{
625-
}
626-
627-
class AnotherClass implements SomeInterface
628-
{
629-
}
630-
631-
interface SomeInterface
632-
{
633-
}
634-
```
635-
636-
:+1:
637-
638-
<br>
639-
640599
### NoTestMocksRule
641600

642601
Mocking "%s" class is forbidden. Use direct/anonymous class instead for better static analysis

config/code-complexity-rules.neon

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,2 @@
11
rules:
22
- Symplify\PHPStanRules\Rules\NoDynamicNameRule
3-
- Symplify\PHPStanRules\Rules\NoSingleInterfaceImplementerRule
4-
5-
services:
6-
-
7-
class: Symplify\PHPStanRules\Collector\InterfaceCollector
8-
tags:
9-
- phpstan.collector
10-
11-
-
12-
class: Symplify\PHPStanRules\Collector\ImplementedInterfaceCollector
13-
tags:
14-
- phpstan.collector
15-
16-
-
17-
class: Symplify\PHPStanRules\Collector\InterfaceOfAbstractClassCollector
18-
tags:
19-
- phpstan.collector

phpstan.neon

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,6 @@ parameters:
3333
# part of public contract
3434
- '#Method Symplify\\PHPStanRules\\Tests\\Rules\\(.*?)\\(.*?)Test\:\:testRule\(\) has parameter \$(expectedError(.*?)|expectedErrors) with no value type specified in iterable type array#'
3535

36-
# overly detailed
37-
- '#Class Symplify\\PHPStanRules\\Collector\\(.*?) implements generic interface PHPStan\\Collectors\\Collector but does not specify its types\: TNodeType, TValue#'
38-
3936
# useful to have IDE know the types
4037
- identifier: phpstanApi.instanceofType
4138

src/Collector/ImplementedInterfaceCollector.php

Lines changed: 0 additions & 42 deletions
This file was deleted.

src/Collector/InterfaceCollector.php

Lines changed: 0 additions & 31 deletions
This file was deleted.

src/Collector/InterfaceOfAbstractClassCollector.php

Lines changed: 0 additions & 41 deletions
This file was deleted.

src/Enum/RuleIdentifier.php

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -36,11 +36,6 @@ final class RuleIdentifier
3636
*/
3737
public const PHP_PARSER_NO_LEADING_BACKSLASH_IN_NAME = 'phpParser.noLeadingBackslashInName';
3838

39-
/**
40-
* @var string
41-
*/
42-
public const NO_SINGLE_INTERFACE_IMPLEMENTER = 'symplify.noSingleInterfaceImplementer';
43-
4439
/**
4540
* @var string
4641
*/

src/Rules/NoSingleInterfaceImplementerRule.php

Lines changed: 0 additions & 98 deletions
This file was deleted.

tests/Rules/NoSingleInterfaceImplementerRule/Fixture/AllowAbstract.php

Lines changed: 0 additions & 9 deletions
This file was deleted.

tests/Rules/NoSingleInterfaceImplementerRule/Fixture/ImplementsSimpleInterface.php

Lines changed: 0 additions & 9 deletions
This file was deleted.

0 commit comments

Comments
 (0)