Skip to content

Commit 2510ea7

Browse files
committed
[docs] avoid using sets as too complicated and bloated, use particular rules instead
1 parent 94aaa3c commit 2510ea7

File tree

7 files changed

+2
-136
lines changed

7 files changed

+2
-136
lines changed

README.md

Lines changed: 2 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -16,52 +16,9 @@ composer require symplify/phpstan-rules --dev
1616

1717
<br>
1818

19-
## A. Add Prepared Sets
19+
## Register Rules you Need
2020

21-
Sets are bunch of rules grouped by a common area, e.g. improve naming. You can pick from 5 sets:
22-
23-
```yaml
24-
includes:
25-
- vendor/symplify/phpstan-rules/config/code-complexity-rules.neon
26-
- vendor/symplify/phpstan-rules/config/naming-rules.neon
27-
- vendor/symplify/phpstan-rules/config/regex-rules.neon
28-
- vendor/symplify/phpstan-rules/config/static-rules.neon
29-
```
30-
31-
<br>
32-
33-
## B. Cherry-pick Configurable Rules
34-
35-
There is one set with pre-configured configurable rules. Include it and see what is errors are found:
36-
37-
```yaml
38-
# phpstan.neon
39-
includes:
40-
- vendor/symplify/phpstan-rules/config/configurable-rules.neon
41-
```
42-
43-
<br>
44-
45-
Would you like to tailor it to fit your taste? Pick one PHPStan rule and configure it manually ↓
46-
47-
```yaml
48-
services:
49-
-
50-
class: Symplify\PHPStanRules\Rules\ForbiddenNodeRule
51-
tags: [phpstan.rules.rule]
52-
arguments:
53-
forbiddenNodes:
54-
- PhpParser\Node\Expr\Empty_
55-
- PhpParser\Node\Stmt\Switch_
56-
```
57-
58-
<br>
59-
60-
## 3. Register Particular Rules
61-
62-
<br>
63-
64-
# 25+ Rules Overview
21+
Pick from 25+ rules:
6522

6623
<br>
6724

config/services/services.neon

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,6 @@ services:
99
- Symplify\PHPStanRules\Naming\ClassToSuffixResolver
1010
- Symplify\PHPStanRules\NodeAnalyzer\AttributeFinder
1111
- Symplify\PHPStanRules\NodeAnalyzer\EnumAnalyzer
12-
- Symplify\PHPStanRules\NodeAnalyzer\RegexFuncCallAnalyzer
13-
- Symplify\PHPStanRules\NodeAnalyzer\RegexStaticCallAnalyzer
1412
- Symplify\PHPStanRules\ParentClassMethodNodeResolver
1513
- Symplify\PHPStanRules\PhpDoc\BarePhpDocParser
1614
- Symplify\PHPStanRules\PhpDoc\PhpDocResolver

config/symplify-rules.neon

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,4 @@ includes:
22
- code-complexity-rules.neon
33
- configurable-rules.neon
44
- naming-rules.neon
5-
- regex-rules.neon
65
- static-rules.neon

src/Enum/ClassName.php

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,6 @@ final class ClassName
1111
*/
1212
public const ROUTE_ATTRIBUTE = 'Symfony\Component\Routing\Annotation\Route';
1313

14-
/**
15-
* @var string
16-
*/
17-
public const NETTE_STRINGS = 'Nette\Utils\Strings';
18-
1914
/**
2015
* @var string
2116
*/

src/Enum/RuleIdentifier.php

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,6 @@ final class RuleIdentifier
1616
*/
1717
public const SEE_ANNOTATION_TO_TEST = 'symplify.seeAnnotationToTest';
1818

19-
/**
20-
* @var string
21-
*/
22-
public const REGEX_SUFFIX_IN_REGEX_CONSTANT = 'symplify.regexSuffixInRegexConstant';
23-
2419
/**
2520
* @var string
2621
*/
@@ -66,11 +61,6 @@ final class RuleIdentifier
6661
*/
6762
public const PARENT_METHOD_VISIBILITY_OVERRIDE = 'symplify.parentMethodVisibilityOverride';
6863

69-
/**
70-
* @var string
71-
*/
72-
public const CLASS_CONSTANT_REGEX = 'symplify.classConstantRegex';
73-
7464
/**
7565
* @var string
7666
*/
@@ -126,11 +116,6 @@ final class RuleIdentifier
126116
*/
127117
public const FORBIDDEN_ARRAY_METHOD_CALL = 'symplify.forbiddenArrayMethodCall';
128118

129-
/**
130-
* @var string
131-
*/
132-
public const REGEX_ANNOTATE_CLASS_CONST = 'symplify.regexAnnotateClassConst';
133-
134119
/**
135120
* @var string
136121
*/

src/NodeAnalyzer/RegexFuncCallAnalyzer.php

Lines changed: 0 additions & 32 deletions
This file was deleted.

src/NodeAnalyzer/RegexStaticCallAnalyzer.php

Lines changed: 0 additions & 36 deletions
This file was deleted.

0 commit comments

Comments
 (0)