-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathphpstan.neon
More file actions
118 lines (104 loc) · 4.91 KB
/
Copy pathphpstan.neon
File metadata and controls
118 lines (104 loc) · 4.91 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
includes:
- phpstan-baseline.neon
- phpstan.entity_mapping.neon
# Uncomment this line to enable overrides for local development and testing.
# - phpstan.local.neon
parameters:
editorUrlTitle: '%%relFile%%:%%line%%'
level: 3
fileExtensions:
- php
- module
- inc
- install
- theme
- profile
paths:
- src
- tests
- modules
- ./patternkit.post_update.php
- ./patternkit.install
- ./patternkit.module
excludePaths:
- src/Form/PatternkitTranslateBlockForm.php
stubFiles:
- stubs/Behat/Mink/WebAssert.stub
- stubs/Drupal/FunctionalJavascriptTests/WebDriverTestBase.stub
- stubs/Drupal/FunctionalJavascriptTests/JSWebAssert.stub
- stubs/Drupal/Tests/BrowserTestBase.stub
- stubs/Drupal/Tests/WebAssert.stub
# Schema.stub must precede SchemaContract.stub. PHPStan 2.1.44+ StubValidator
# requires @phpstan-require-extends references to be resolvable within the stub
# registry; Schema is not declared as a stub by any upstream package.
- stubs/Swaggest/JsonSchema/Schema.stub
- stubs/Swaggest/JsonSchema/SchemaContract.stub
# Customize the rules being scanned for.
reportUnmatchedIgnoredErrors: true
treatPhpDocTypesAsCertain: false
# Ignore some known or irrelevant errors.
ignoreErrors:
# new static() is a best practice in Drupal, so we cannot fix that.
- "#^Unsafe usage of new static#"
# Don't require specifying array shapes for everything.
# This is only required for level 4+
# - identifier: missingType.iterableValue
# Ignore issues with unknown properties in tests, especially common on schemas.
- identifier: property.notFound
paths:
- *Test.php
# Ignore complaints when accessing known section list fields.
- message: '#^Call to an undefined method Drupal\\Core\\Field\\FieldItemListInterface\<Drupal\\Core\\Field\\FieldItemInterface\>\:\:getSection\(\)\.$#'
paths:
- *Test.php
# Ignore dependency injection warnings for intentional lazy-loader methods.
- message: '#^\\Drupal calls should be avoided in classes, use dependency injection instead$#'
count: 1
path: src/LayoutHelper.php
- message: '#^\\Drupal calls should be avoided in classes, use dependency injection instead$#'
count: 1
path: src/PatternLibrary.php
- message: '#^\\Drupal calls should be avoided in classes, use dependency injection instead$#'
count: 1
path: src/Plugin/PatternLibrary/PatternLibraryTwig.php
- message: '#^\\Drupal calls should be avoided in classes, use dependency injection instead$#'
count: 1
path: src/Schema/PatternkitRefProvider.php
- message: '#^\\Drupal calls should be avoided in classes, use dependency injection instead$#'
count: 1
path: src/UpdateHelper.php
- message: '#^\\Drupal calls should be avoided in classes, use dependency injection instead$#'
count: 1
path: src/Hook/ThemeHooks.php
# PatternkitJson must resolve the container directly — it is instantiated from
# typed schema, not a service container-aware factory. reportUnmatched: false
# because the Drupal PHPStan plugin does not emit this rule on all Drupal versions.
- message: '#^\\Drupal calls should be avoided in classes, use dependency injection instead$#'
count: 1
path: src/FormElement/PatternkitJson.php
reportUnmatched: false
# The test overrides the container service class to TestLibraryNamespaceResolver
# via ServiceModifierInterface::alter(), so the runtime type is correct. PHPStan
# cannot infer this from the service container call. reportUnmatched: false
# because the error only fires when the full Drupal vendor autoload is present.
- identifier: assign.propertyType
path: tests/src/Kernel/Asset/LibraryNamespaceResolverTest.php
reportUnmatched: false
# Ignore deprecation warnings inconsistent between Drupal versions.
- identifier: method.deprecated
count: 1
path: tests/src/Unit/PatternFieldProcessorPluginManagerTest.php
reportUnmatched: false
# Ignore missing attribute class warnings from Drupal <11.
- message: '#Attribute class PHPUnit\\Framework\\Attributes\\.* does not exist.#'
reportUnmatched: false
- message: '#Attribute class Drupal\\Core\\Hook\\Attribute\\(Legacy)?Hook does not exist.#'
reportUnmatched: false
# YamlCacheCollector and the matching parent::__construct() arity were added
# in Drupal 11.4. Suppress cross-version failures on earlier Drupal versions.
- message: '#Parameter \$yamlCacheCollector of method Drupal\\patternkit\\Asset\\PatternLibraryParserBase::__construct\(\) has invalid type#'
reportUnmatched: false
- message: '#Method Drupal\\Core\\Asset\\LibraryDiscoveryParser::__construct\(\) invoked with 8 parameters#'
reportUnmatched: false
- message: '#has unknown class Drupal\\Core\\Utility\\YamlCacheCollector as its type#'
reportUnmatched: false