Repository navigation
Expand file tree
/
Copy pathphpstan.neon.dist
More file actions
147 lines (146 loc) · 4.5 KB
/
Copy pathphpstan.neon.dist
File metadata and controls
147 lines (146 loc) · 4.5 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
142
143
144
145
146
147
includes:
- phar://phpstan.phar/conf/bleedingEdge.neon
parameters:
level: 8
treatPhpDocTypesAsCertain: false
paths:
- plugins
- performance.php
bootstrapFiles:
- tools/phpstan/constants.php
scanDirectories:
- vendor/wp-phpunit/wp-phpunit/
scanFiles:
# These are needed due config.platform.php being 7.4 in composer.json and wordpress-stubs not including polyfills.
# See <https://github.com/php-stubs/wordpress-stubs/issues/100>.
- vendor/phpstan/php-8-stubs/stubs/ext/standard/str_contains.php
- vendor/phpstan/php-8-stubs/stubs/ext/standard/str_starts_with.php
- vendor/phpstan/php-8-stubs/stubs/ext/standard/str_ends_with.php
# ValueError is a PHP 8 class, caught for forward compatibility but absent under the PHP 7.4 platform target.
- vendor/phpstan/php-8-stubs/stubs/Zend/ValueError.php
stubFiles:
- tools/phpstan/filtered-functions.stub
dynamicConstantNames:
- PERFLAB_OBJECT_CACHE_DROPIN_VERSION
strictRules:
strictArrayFilter: false
ignoreErrors:
# Allow using a plugin's private functions in itself.
-
identifier: no.private.function
message: '/function dominant_color_.*/'
path: plugins/dominant-color-images/*
-
identifier: no.private.class
message: '/class Image_Prioritizer_.*/'
path: plugins/image-prioritizer/*
-
identifier: no.private.class
message: '/class Embed_Optimizer_.*/'
path: plugins/embed-optimizer/*
-
identifier: no.private.class
message: '/class OD_.*/'
path: plugins/optimization-detective/*
-
identifier: no.private.method
message: '/class OD_.*/'
path: plugins/optimization-detective/*
-
identifier: no.private.function
message: '/function od_.*/'
path: plugins/optimization-detective/*
-
identifier: no.private.function
message: '/function webp_uploads_.*/'
path: plugins/webp-uploads/*
-
identifier: no.private.function
message: '/function plwwo_.*/'
path: plugins/web-worker-offloading/*
-
identifier: no.private.function
message: '/function embed_optimizer_.*/'
path: plugins/embed-optimizer/*
-
identifier: no.private.function
message: '/function image_prioritizer_.*/'
path: plugins/image-prioritizer/*
-
identifier: no.private.function
message: '/function plsr_.*/'
path: plugins/speculation-rules/*
-
identifier: no.private.function
message: '/function plvt_.*/'
path: plugins/view-transitions/*
-
identifier: no.private.class
message: '/class PLVT_.*/'
path: plugins/view-transitions/*
-
identifier: no.private.function
message: '/function perflab_.*/'
path: plugins/performance-lab/*
# Ignore require/include errors in test bootstraps that load files via the TESTS_PLUGIN_DIR sentinel, which is set to the plugin-under-test dir at runtime and cannot be modeled during analysis. See tools/phpstan/constants.php.
-
identifier: requireOnce.fileNotFound
message: '#/tests-plugin-dir/#'
-
identifier: require.fileNotFound
message: '#/tests-plugin-dir/#'
# The build/*.asset.php files are generated by `npm run build`, which does not run in the PHPStan CI job. When they are present the error is not raised, hence reportUnmatched.
-
identifier: require.fileNotFound
message: '#/build/.+\.asset\.php#'
reportUnmatched: false
-
# Ignore error related to PHP 8 using a GdImage but PHP 7 using a resource.
message: '/^Parameter .+? of function .+? expects resource, GdImage\|resource given\.$/'
path: plugins/dominant-color-images/*.php
# Hook callbacks receive their arguments positionally, so an unused parameter cannot be removed when a later one is used.
-
identifier: function.unusedParameter
# The following ignored errors are all for tests. They are likely excessively strict and do not warrant being fixed.
-
identifier: argument.type
path: */tests/*
-
identifier: offsetAccess.nonArray
path: */tests/*
-
identifier: method.notFound
path: */tests/*
-
identifier: offsetAccess.notFound
path: */tests/*
-
identifier: encapsedStringPart.nonString
path: */tests/*
-
identifier: assign.propertyType
path: */tests/*
-
identifier: method.nonObject
path: */tests/*
-
identifier: cast.string
path: */tests/*
-
identifier: staticMethod.dynamicCall
path: */tests/*
-
identifier: phpunit.assertEquals
path: */tests/*
-
identifier: catch.internalClass
path: */tests/*
-
identifier: method.alreadyNarrowedType
path: */tests/*
-
identifier: no.private.method
path: */tests/*
-
identifier: no.private.function
path: */tests/*