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
49 lines (44 loc) · 1.66 KB
/
Copy pathphpstan.neon.dist
File metadata and controls
49 lines (44 loc) · 1.66 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
# 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
# The baseline file includes preexisting errors in the codebase that should be ignored.
# https://phpstan.org/user-guide/baseline
- tests/phpstan/baseline.php
parameters:
# https://phpstan.org/user-guide/rule-levels
level: 0
reportUnmatchedIgnoredErrors: true
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