-
Notifications
You must be signed in to change notification settings - Fork 63
Expand file tree
/
Copy pathphpstan.neon.dist
More file actions
79 lines (66 loc) · 2.6 KB
/
phpstan.neon.dist
File metadata and controls
79 lines (66 loc) · 2.6 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
# Configuration file for PHPStan static code checking, see https://phpstan.org .
# The PHPStan check is executed as a job in the CI pipeline.
includes:
- .phpstan-baseline.php
parameters:
tmpDir: phpstan-tmp
level: 1
checkInternalClassCaseSensitivity: true
fileExtensions:
- sh
paths:
- .
- ../composer
bootstrapFiles:
# Load aliases.
- lib/Drupal/Core/Serialization/Yaml.php
excludePaths:
# Skip sites directory.
- ../sites
# Skip test fixtures.
- ../*/node_modules/*
- */tests/fixtures/*.php
- */tests/fixtures/*.php.gz
# Skip the phpstan tmpDir
- phpstan-tmp/*
# Skip Drupal's own PHPStan rules test fixtures.
- tests/PHPStan/fixtures/*
# Skip Drupal's own PHPStan vendor directory
- tests/PHPStan/vendor/*
# Skip Drupal 6 & 7 code.
- scripts/dump-database-d?.sh
- scripts/generate-d?-content.sh
# Skip update countries script for fake t() declaration.
- scripts/update-countries.sh
# Skip data files.
- lib/Drupal/Component/Transliteration/data/*.php
# The following classes deliberately extend non-existent classes for testing.
- modules/system/tests/modules/plugin_test/src/Plugin/plugin_test/fruit/ExtendingNonInstalledClass.php
- modules/system/tests/modules/plugin_test/src/Plugin/plugin_test/custom_annotation/UsingNonInstalledTraitClass.php
- modules/system/tests/modules/plugin_test/src/Plugin/plugin_test/custom_annotation/ExtendingNonInstalledClass.php
# Needs to be skipped until PHPStan recognises the existence of Pdo\Sqlite
- modules/sqlite/src/Driver/Database/sqlite/SqliteConnection.php
ignoreErrors:
# new static() is a best practice in Drupal, so we cannot fix that.
- "#^Unsafe usage of new static#"
# Ignore common errors for now.
- "#Drupal calls should be avoided in classes, use dependency injection instead#"
- "#^Class .* extends @internal class#"
- identifier: missingType.iterableValue
rules:
- Drupal\PHPStan\Rules\ComponentTestDoesNotExtendCoreTest
- Drupal\PHPStan\Rules\TestClassClassMetadata
- Drupal\PHPStan\Rules\TestClassMethodMetadata
- PHPStan\Rules\Functions\MissingFunctionReturnTypehintRule
- PHPStan\Rules\Methods\MissingMethodReturnTypehintRule
# The rule below can be removed when we increase level to 2.
- PHPStan\Rules\Classes\AccessPrivateConstantThroughStaticRule
services:
errorFormatter.multiplex:
class: Drupal\PHPStan\ErrorFormatter\MultiplexErrorFormatter
arguments:
basePath: ::getenv(_ARTIFACTS_DIR)
outputs:
gitlab: phpstan-gitlab.json
junit: phpstan-junit.xml
table: null