forked from DevinVinson/WordPress-Plugin-Boilerplate
-
Notifications
You must be signed in to change notification settings - Fork 8
/
phpstan.neon
33 lines (33 loc) · 1.29 KB
/
phpstan.neon
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
parameters:
level: 8
paths:
- includes
- plugin-slug.php
- autoload.php
- uninstall.php
- tests
excludePaths:
- vendor-prefixed
- tests/_support
bootstrapFiles:
- phpstanbootstrap.php
- autoload.php
- vendor/php-stubs/wordpress-stubs/wordpress-stubs.php
- vendor/wp-cli/wp-cli/php/class-wp-cli-command.php
# - vendor/php-stubs/woocommerce-stubs/woocommerce-stubs.php
# - vendor/php-stubs/woocommerce-stubs/woocommerce-packages-stubs.php
scanFiles:
- vendor/antecedent/patchwork/Patchwork.php
scanDirectories:
- vendor-prefixed
# - wp-content/plugins/...
- vendor/wp-cli
ignoreErrors:
# LoggerAwareTrait allows for null $logger, but we set it in the constructor.
- '#LoggerInterface\|null#'
# PHPStan show errors when filters have more than two parameters.
- '#^Function apply_filters(_ref_array)? invoked with \d parameters, 2 required\.$#'
# Parameter #1 $message of method a expects b, c given, when bad PhpDoc used.
# - '/Parameter .* of .* expects .* given\./'
# Setting an empty array with type associative array in the PhpDoc prints this.
- '/does not accept default value of type array\(\)/'