forked from WordPress/wordpress-develop
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathphpstan.neon.dist
More file actions
141 lines (135 loc) · 6.41 KB
/
Copy pathphpstan.neon.dist
File metadata and controls
141 lines (135 loc) · 6.41 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
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
# PHPStan configuration for WordPress Core.
#
# To overload this configuration, copy this file to phpstan.neon and adjust as needed.
#
# https://phpstan.org/config-reference
includes:
# The base configuration file for using PHPStan with the WordPress core codebase.
- tests/phpstan/base.neon
# Type-specifying extension so PHPUnit assertions (e.g. assertArrayHasKey(),
# assertInstanceOf(), assertNotNull()) narrow types in the analysis. Only the
# extension is included, not phpstan-phpunit's rules.neon, to avoid introducing
# new strict rules.
- vendor/phpstan/phpstan-phpunit/extension.neon
# Preexisting errors that should be ignored, one baseline per error identifier
# so that the remaining work on each is visible as a single shrinking file.
# Each is meant to reach zero and be deleted, taking its line below with it.
# https://phpstan.org/user-guide/baseline
#
# Regenerate with `composer phpstan:baselines`, which rewrites both the files
# and the list between the markers. Do not edit that list by hand.
# phpstan:baselines start
- tests/phpstan/baselines/argument.type.neon
- tests/phpstan/baselines/argument.unresolvableType.neon
- tests/phpstan/baselines/arguments.count.neon
- tests/phpstan/baselines/arrayValues.list.neon
- tests/phpstan/baselines/assign.propertyType.neon
- tests/phpstan/baselines/binaryOp.invalid.neon
- tests/phpstan/baselines/booleanAnd.alwaysFalse.neon
- tests/phpstan/baselines/booleanAnd.alwaysTrue.neon
- tests/phpstan/baselines/booleanAnd.leftAlwaysTrue.neon
- tests/phpstan/baselines/booleanAnd.rightAlwaysFalse.neon
- tests/phpstan/baselines/booleanAnd.rightAlwaysTrue.neon
- tests/phpstan/baselines/booleanNot.alwaysFalse.neon
- tests/phpstan/baselines/booleanNot.alwaysTrue.neon
- tests/phpstan/baselines/booleanOr.alwaysFalse.neon
- tests/phpstan/baselines/booleanOr.alwaysTrue.neon
- tests/phpstan/baselines/booleanOr.rightAlwaysTrue.neon
- tests/phpstan/baselines/catch.neverThrown.neon
- tests/phpstan/baselines/class.nameCase.neon
- tests/phpstan/baselines/class.notFound.neon
- tests/phpstan/baselines/deadCode.unreachable.neon
- tests/phpstan/baselines/empty.offset.neon
- tests/phpstan/baselines/empty.property.neon
- tests/phpstan/baselines/empty.variable.neon
- tests/phpstan/baselines/encapsedStringPart.nonString.neon
- tests/phpstan/baselines/foreach.nonIterable.neon
- tests/phpstan/baselines/function.alreadyNarrowedType.neon
- tests/phpstan/baselines/function.impossibleType.neon
- tests/phpstan/baselines/function.resultUnused.neon
- tests/phpstan/baselines/greater.invalid.neon
- tests/phpstan/baselines/greaterOrEqual.alwaysTrue.neon
- tests/phpstan/baselines/identical.alwaysFalse.neon
- tests/phpstan/baselines/identical.alwaysTrue.neon
- tests/phpstan/baselines/if.alwaysFalse.neon
- tests/phpstan/baselines/if.alwaysTrue.neon
- tests/phpstan/baselines/instanceof.alwaysTrue.neon
- tests/phpstan/baselines/isset.offset.neon
- tests/phpstan/baselines/isset.property.neon
- tests/phpstan/baselines/isset.variable.neon
- tests/phpstan/baselines/method.childParameterType.neon
- tests/phpstan/baselines/method.nonObject.neon
- tests/phpstan/baselines/method.notFound.neon
- tests/phpstan/baselines/method.unused.neon
- tests/phpstan/baselines/notIdentical.alwaysTrue.neon
- tests/phpstan/baselines/nullCoalesce.offset.neon
- tests/phpstan/baselines/nullCoalesce.property.neon
- tests/phpstan/baselines/offsetAccess.nonOffsetAccessible.neon
- tests/phpstan/baselines/offsetAccess.notFound.neon
- tests/phpstan/baselines/offsetAssign.valueType.neon
- tests/phpstan/baselines/parameter.defaultValue.neon
- tests/phpstan/baselines/parameter.notFound.neon
- tests/phpstan/baselines/parameter.phpDocType.neon
- tests/phpstan/baselines/parameter.unresolvableType.neon
- tests/phpstan/baselines/parameterByRef.type.neon
- tests/phpstan/baselines/parameterByRef.unusedType.neon
- tests/phpstan/baselines/property.defaultValue.neon
- tests/phpstan/baselines/property.nonObject.neon
- tests/phpstan/baselines/property.notFound.neon
- tests/phpstan/baselines/property.onlyWritten.neon
- tests/phpstan/baselines/property.phpDocType.neon
- tests/phpstan/baselines/property.private.neon
- tests/phpstan/baselines/property.protected.neon
- tests/phpstan/baselines/property.unusedType.neon
- tests/phpstan/baselines/return.empty.neon
- tests/phpstan/baselines/return.missing.neon
- tests/phpstan/baselines/return.type.neon
- tests/phpstan/baselines/return.unusedType.neon
- tests/phpstan/baselines/smallerOrEqual.alwaysTrue.neon
- tests/phpstan/baselines/staticClassAccess.privateMethod.neon
- tests/phpstan/baselines/ternary.alwaysFalse.neon
- tests/phpstan/baselines/ternary.alwaysTrue.neon
- tests/phpstan/baselines/varTag.noVariable.neon
- tests/phpstan/baselines/variable.undefined.neon
- tests/phpstan/baselines/while.alwaysFalse.neon
- tests/phpstan/baselines/while.alwaysTrue.neon
# phpstan:baselines end
parameters:
# https://phpstan.org/user-guide/rule-levels
level: 5
reportUnmatchedIgnoredErrors: true
# The following ignored errors are not intended to be fixed, as distinct from the baselines
# included above.
#
# A baseline records work still to be done. Every entry in one is in scope to be fixed, and
# each file is meant to reach zero and then be deleted. An entry here is the opposite: a
# decision that the code is right as written and the report is not actionable, whether
# because PHPStan cannot see what makes the code safe, or because satisfying it would mean
# changing code that has no other reason to change.
#
# So prefer fixing an error, and baseline it when it cannot be fixed yet. Add it here only
# when it should never be fixed, and say why.
ignoreErrors:
# Level 0:
- # Inner functions aren't supported by PHPStan.
message: '#Function wxr_[a-z_]+ not found#'
path: src/wp-admin/includes/export.php
-
identifier: function.inner
path: src/wp-admin/includes/export.php
count: 13
-
identifier: function.inner
path: src/wp-admin/includes/file.php
count: 1
-
identifier: function.inner
path: src/wp-includes/canonical.php
count: 1
# Level 2:
# ValueError is PHP 8.0+; core throws it conditionally so the docblocks are correct for WP's 7.4+ range,
# but bleedingEdge's version-aware check treats the class as non-existent against the PHP 7.4 floor.
-
message: '#^PHPDoc tag @throws with type InvalidArgumentException\|ValueError is not subtype of Throwable$#'
path: src/wp-includes/compat.php
reportUnmatched: false