Skip to content

Commit

Permalink
Remove RequireEnumDocBlockOnConstantListPassRule as reports many fals…
Browse files Browse the repository at this point in the history
…e positive, better shift to native enums (#119)

* Remove RequireEnumDocBlockOnConstantListPassRule as reports many false positive, better shift to native enums

* remove related services
  • Loading branch information
TomasVotruba committed May 19, 2024
1 parent a71f91c commit 753627d
Show file tree
Hide file tree
Showing 20 changed files with 1 addition and 651 deletions.
2 changes: 0 additions & 2 deletions config/services/services.neon
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ services:
- Symplify\PHPStanRules\Naming\ClassToSuffixResolver
- Symplify\PHPStanRules\NodeAnalyzer\AttributeFinder
- Symplify\PHPStanRules\NodeAnalyzer\EnumAnalyzer
- Symplify\PHPStanRules\NodeAnalyzer\MethodCall\MethodCallClassConstFetchPositionResolver
- Symplify\PHPStanRules\NodeAnalyzer\RegexFuncCallAnalyzer
- Symplify\PHPStanRules\NodeAnalyzer\RegexStaticCallAnalyzer
- Symplify\PHPStanRules\NodeFinder\ClassMethodNodeFinder
Expand All @@ -26,7 +25,6 @@ services:
- Symplify\PHPStanRules\PhpDoc\BarePhpDocParser
- Symplify\PHPStanRules\PhpDoc\PhpDocResolver
- Symplify\PHPStanRules\Printer\NodeComparator
- Symplify\PHPStanRules\Reflection\MethodCallNodeAnalyzer
- Symplify\PHPStanRules\Reflection\MethodNodeAnalyser
- Symplify\PHPStanRules\TypeAnalyzer\CallableTypeAnalyzer
- Symplify\PHPStanRules\Matcher\Collector\PublicClassMethodMatcher
Expand Down
63 changes: 1 addition & 62 deletions docs/rules_overview.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# 44 Rules Overview
# 43 Rules Overview

## AnnotateRegexClassConstWithRegexLinkRule

Expand Down Expand Up @@ -1398,67 +1398,6 @@ final class SomeAttribute

<br>

## RequireEnumDocBlockOnConstantListPassRule

On passing a constant, the method should have an enum type. See https://phpstan.org/writing-php-code/phpdoc-types#literals-and-constants

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

```php
final class Direction
{
public const LEFT = 'left';

public const RIGHT = 'right';
}

final class Driver
{
public function goToWork()
{
$this->turn(Direction::LEFT);
}

private function turn(string $direction)
{
// ...
}
}
```

:x:

<br>

```php
final class Direction
{
public const LEFT = 'left';

public const RIGHT = 'right';
}

final class Driver
{
public function goToWork()
{
$this->turn(Direction::LEFT);
}

/**
* @param Direction::*
*/
private function turn(string $direction)
{
// ...
}
}
```

:+1:

<br>

## RequireExceptionNamespaceRule

`Exception` must be located in "Exception" namespace
Expand Down

This file was deleted.

57 changes: 0 additions & 57 deletions src/Reflection/MethodCallNodeAnalyzer.php

This file was deleted.

193 changes: 0 additions & 193 deletions src/Rules/Enum/RequireEnumDocBlockOnConstantListPassRule.php

This file was deleted.

Loading

0 comments on commit 753627d

Please sign in to comment.