Skip to content

Commit

Permalink
Remove EEmbeddedEnumClassConstSpotterRule, as configurable and quite …
Browse files Browse the repository at this point in the history
…complex (#64)
  • Loading branch information
TomasVotruba committed Aug 7, 2023
1 parent 18b34b9 commit ab93db5
Show file tree
Hide file tree
Showing 14 changed files with 1 addition and 470 deletions.
3 changes: 0 additions & 3 deletions config/services/services.neon
Original file line number Diff line number Diff line change
Expand Up @@ -13,17 +13,14 @@ services:
- Symplify\PHPStanRules\Composer\ClassNamespaceMatcher
- Symplify\PHPStanRules\Composer\ComposerAutoloadResolver
- Symplify\PHPStanRules\Composer\Psr4PathValidator
- Symplify\PHPStanRules\Enum\EnumConstantAnalyzer
- Symplify\PHPStanRules\Formatter\RequiredWithMessageFormatter
- Symplify\PHPStanRules\Location\DirectoryChecker
- Symplify\PHPStanRules\Matcher\PositionMatcher
- Symplify\PHPStanRules\Matcher\SharedNamePrefixMatcher
- Symplify\PHPStanRules\Naming\BoolishNameAnalyser
- Symplify\PHPStanRules\Naming\ClassToSuffixResolver
- Symplify\PHPStanRules\NodeAnalyzer\ArrayAnalyzer
- Symplify\PHPStanRules\NodeAnalyzer\AttributeFinder
- Symplify\PHPStanRules\NodeAnalyzer\CacheIfAnalyzer
- Symplify\PHPStanRules\NodeAnalyzer\ClassAnalyzer
- Symplify\PHPStanRules\NodeAnalyzer\EnumAnalyzer
- Symplify\PHPStanRules\NodeAnalyzer\IfElseBranchAnalyzer
- Symplify\PHPStanRules\NodeAnalyzer\IfResemblingMatchAnalyzer
Expand Down
52 changes: 1 addition & 51 deletions docs/rules_overview.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# 78 Rules Overview
# 77 Rules Overview

## AnnotateRegexClassConstWithRegexLinkRule

Expand Down Expand Up @@ -316,56 +316,6 @@ class SomeCommand extends Command

<br>

## EmbeddedEnumClassConstSpotterRule

Constants "%s" should be extract to standalone enum class

:wrench: **configure it!**

- class: [`Symplify\PHPStanRules\Rules\Enum\EmbeddedEnumClassConstSpotterRule`](../src/Rules/Enum/EmbeddedEnumClassConstSpotterRule.php)

```yaml
services:
-
class: Symplify\PHPStanRules\Rules\Enum\EmbeddedEnumClassConstSpotterRule
tags: [phpstan.rules.rule]
arguments:
parentTypes:
- AbstractObject
```
```php
class SomeProduct extends AbstractObject
{
public const STATUS_ENABLED = 1;

public const STATUS_DISABLED = 0;
}
```

:x:

<br>

```php
class SomeProduct extends AbstractObject
{
}

class SomeStatus
{
public const ENABLED = 1;

public const DISABLED = 0;
}
```

:+1:

<br>

## ExclusiveNamespaceRule

Exclusive namespace can only contain classes of specific type, nothing else
Expand Down
36 changes: 0 additions & 36 deletions src/Enum/EnumConstantAnalyzer.php

This file was deleted.

63 changes: 0 additions & 63 deletions src/Matcher/SharedNamePrefixMatcher.php

This file was deleted.

25 changes: 0 additions & 25 deletions src/NodeAnalyzer/ClassAnalyzer.php

This file was deleted.

152 changes: 0 additions & 152 deletions src/Rules/Enum/EmbeddedEnumClassConstSpotterRule.php

This file was deleted.

Loading

0 comments on commit ab93db5

Please sign in to comment.