Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove NoSingleInterfaceImplementerRule as way complex, let devs handle it #156

Merged
merged 1 commit into from
Dec 18, 2024
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
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
Loading