File tree Expand file tree Collapse file tree 3 files changed +19
-1
lines changed Expand file tree Collapse file tree 3 files changed +19
-1
lines changed Original file line number Diff line number Diff line change @@ -91,6 +91,19 @@ See the `extension-installer` documentation for more information: https://github
91
91
92
92
## Adapting to your project
93
93
94
+ ### Customizing rules
95
+
96
+ #### Disabling checks for extending ` @internal ` classes
97
+
98
+ You can disable the ` ClassExtendsInternalClassRule ` rule by adding the following to your ` phpstan.neon ` :
99
+
100
+ ``` neon
101
+ parameters:
102
+ drupal:
103
+ rules:
104
+ classExtendsInternalClassRule: false
105
+ ```
106
+
94
107
### Specifying your Drupal project's root
95
108
96
109
By default, the PHPStan Drupal extension will try to determine your Drupal project's root directory based on the working
Original file line number Diff line number Diff line change @@ -23,6 +23,7 @@ parameters:
23
23
testClassSuffixNameRule : false
24
24
dependencySerializationTraitPropertyRule : false
25
25
accessResultConditionRule : false
26
+ classExtendsInternalClassRule : true
26
27
entityMapping :
27
28
aggregator_feed :
28
29
class : Drupal\aggregator\Entity\Feed
@@ -246,6 +247,7 @@ parametersSchema:
246
247
testClassSuffixNameRule : boolean ()
247
248
dependencySerializationTraitPropertyRule : boolean ()
248
249
accessResultConditionRule : boolean ()
250
+ classExtendsInternalClassRule : boolean ()
249
251
])
250
252
entityMapping : arrayOf (anyOf (
251
253
structure ([
Original file line number Diff line number Diff line change 3
3
- mglaman\PHPStanDrupal\Rules\Drupal\GlobalDrupalDependencyInjectionRule
4
4
- mglaman\PHPStanDrupal\Rules\Drupal\PluginManager\PluginManagerSetsCacheBackendRule
5
5
- mglaman\PHPStanDrupal\Rules\Deprecations\AccessDeprecatedConstant
6
- - mglaman\PHPStanDrupal\Rules\Classes\ClassExtendsInternalClassRule
7
6
- mglaman\PHPStanDrupal\Rules\Classes\PluginManagerInspectionRule
8
7
- mglaman\PHPStanDrupal\Rules\Deprecations\ConditionManagerCreateInstanceContextConfigurationRule
9
8
- mglaman\PHPStanDrupal\Rules\Drupal\RenderCallbackRule
@@ -27,6 +26,8 @@ conditionalTags:
27
26
phpstan.rules.rule : %drupal.rules.dependencySerializationTraitPropertyRule%
28
27
mglaman\PHPStanDrupal\Rules\Drupal\AccessResultConditionRule :
29
28
phpstan.rules.rule : %drupal.rules.accessResultConditionRule%
29
+ mglaman\PHPStanDrupal\Rules\Classes\ClassExtendsInternalClassRule :
30
+ phpstan.rules.rule : %drupal.rules.classExtendsInternalClassRule%
30
31
31
32
services :
32
33
-
@@ -37,3 +38,5 @@ services:
37
38
class : mglaman\PHPStanDrupal\Rules\Drupal\AccessResultConditionRule
38
39
arguments :
39
40
treatPhpDocTypesAsCertain : %treatPhpDocTypesAsCertain%
41
+ -
42
+ class : mglaman\PHPStanDrupal\Rules\Classes\ClassExtendsInternalClassRule
You can’t perform that action at this time.
0 commit comments