Skip to content

Commit

Permalink
Remove NoSingleInterfaceImplementerRule as way complex, let devs hand…
Browse files Browse the repository at this point in the history
…le it (#156)
  • Loading branch information
TomasVotruba authored Dec 18, 2024
1 parent be7b28d commit 998146c
Show file tree
Hide file tree
Showing 14 changed files with 0 additions and 384 deletions.
41 changes: 0 additions & 41 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -596,47 +596,6 @@ final class SomeClass

<br>

### NoSingleInterfaceImplementerRule

Interface "%s" has only single implementer. Consider using the class directly as there is no point in using the interface.

```yaml
rules:
- Symplify\PHPStanRules\Rules\NoSingleInterfaceImplementerRule
```
```php
class SomeClass implements SomeInterface
{
}

interface SomeInterface
{
}
```

:x:

<br>

```php
class SomeClass implements SomeInterface
{
}

class AnotherClass implements SomeInterface
{
}

interface SomeInterface
{
}
```

:+1:

<br>

### NoTestMocksRule

Mocking "%s" class is forbidden. Use direct/anonymous class instead for better static analysis
Expand Down
17 changes: 0 additions & 17 deletions config/code-complexity-rules.neon
Original file line number Diff line number Diff line change
@@ -1,19 +1,2 @@
rules:
- Symplify\PHPStanRules\Rules\NoDynamicNameRule
- Symplify\PHPStanRules\Rules\NoSingleInterfaceImplementerRule

services:
-
class: Symplify\PHPStanRules\Collector\InterfaceCollector
tags:
- phpstan.collector

-
class: Symplify\PHPStanRules\Collector\ImplementedInterfaceCollector
tags:
- phpstan.collector

-
class: Symplify\PHPStanRules\Collector\InterfaceOfAbstractClassCollector
tags:
- phpstan.collector
3 changes: 0 additions & 3 deletions phpstan.neon
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,6 @@ parameters:
# part of public contract
- '#Method Symplify\\PHPStanRules\\Tests\\Rules\\(.*?)\\(.*?)Test\:\:testRule\(\) has parameter \$(expectedError(.*?)|expectedErrors) with no value type specified in iterable type array#'

# overly detailed
- '#Class Symplify\\PHPStanRules\\Collector\\(.*?) implements generic interface PHPStan\\Collectors\\Collector but does not specify its types\: TNodeType, TValue#'

# useful to have IDE know the types
- identifier: phpstanApi.instanceofType

Expand Down
42 changes: 0 additions & 42 deletions src/Collector/ImplementedInterfaceCollector.php

This file was deleted.

31 changes: 0 additions & 31 deletions src/Collector/InterfaceCollector.php

This file was deleted.

41 changes: 0 additions & 41 deletions src/Collector/InterfaceOfAbstractClassCollector.php

This file was deleted.

5 changes: 0 additions & 5 deletions src/Enum/RuleIdentifier.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,6 @@ final class RuleIdentifier
*/
public const PHP_PARSER_NO_LEADING_BACKSLASH_IN_NAME = 'phpParser.noLeadingBackslashInName';

/**
* @var string
*/
public const NO_SINGLE_INTERFACE_IMPLEMENTER = 'symplify.noSingleInterfaceImplementer';

/**
* @var string
*/
Expand Down
98 changes: 0 additions & 98 deletions src/Rules/NoSingleInterfaceImplementerRule.php

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

Loading

0 comments on commit 998146c

Please sign in to comment.