forked from WordPress/performance
-
Notifications
You must be signed in to change notification settings - Fork 0
/
phpstan.neon.dist
73 lines (72 loc) · 2.06 KB
/
phpstan.neon.dist
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
includes:
- phar://phpstan.phar/conf/bleedingEdge.neon
parameters:
level: 8
treatPhpDocTypesAsCertain: false
paths:
- plugins
- tests
- performance.php
- plugins/performance-lab/load.php
bootstrapFiles:
- tools/phpstan/constants.php
- plugins/performance-lab/load.php
- plugins/webp-uploads/load.php
scanDirectories:
- vendor/wp-phpunit/wp-phpunit/
scanFiles:
# These are needed due config.platform.php being 7.2 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
stubFiles:
- tools/phpstan/filtered-functions.stub
dynamicConstantNames:
- PERFLAB_OBJECT_CACHE_DROPIN_VERSION
strictRules:
strictArrayFilter: false
ignoreErrors:
-
# 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
# 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: offsetAccess.invalidOffset
path: */tests/*
-
identifier: assign.propertyType
path: */tests/*
-
identifier: method.nonObject
path: */tests/*
-
identifier: cast.string
path: */tests/*
-
identifier: staticMethod.dynamicCall
path: */tests/*
-
# TODO: Remove this to fix https://github.com/WordPress/performance/issues/1219
identifier: empty.notAllowed
paths:
- */tests/*
- plugins/dominant-color-images
- plugins/performance-lab
- plugins/webp-uploads