Skip to content

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

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

Merged
merged 2 commits into from
May 19, 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
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
Loading