forked from Nullcorps/woocommerce-gateway-bitcoin
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathphpstan.neon
63 lines (63 loc) · 3.1 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
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
parameters:
level: 8
paths:
- src
- bh-wp-bitcoin-gateway.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/...
- wp-content/plugins/woocommerce
- vendor/wp-cli
ignoreErrors:
- # WC_Settings_API::process_admin_options() specifies the bool return, but add_action does not expect any.
message: '#Action callback returns bool but should not return anything.#'
path: src/woocommerce/class-bitcoin-gateway.php
- # We pass the plugin_object array when registering the post type.
message: '#Access to an undefined property WP_Post_Type::\$plugin_objects.#'
paths:
- src/admin/class-wallets-list-table.php
- src/admin/class-addresses-list-table.php
# - Don't check for null|false in tests
# message: '/Parameter .* expects .*|(false|null) given/'
# path: tests/*
# Using exceptions in filters as controlflow to avoid die().
# - message: '/Filter callback return statement is missing./'
# 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.{3}$/'
# Sometimes seems to not find the test parent class's methods.
# - '/Call to an undefined method.*(make|assert).*/'
# WC_Data::add_meta_data works fine with non-string/array values
- '/Parameter #2 \$value of method WC_Data::add_meta_data\(\) expects array\|string/'
- #
message: '#Parameter \#2 \$callback of static method WP_Mock::expect(Action|Filter)Added\(\) expects \(callable\(\): mixed\)\|Mockery\\Matcher\\Type, array{WP_Mock\\Matcher\\AnyInstance, .*} given.#'
path: tests/unit
- # Where we use Exceptions for control flow in tests, the return statements are absent.
message: '#Filter callback return statement is missing.#'
path: tests
- # Let's not check for null|false in tests.
message: '#\|(false|null) given#'
path: tests
- # Let's not check for null|false in tests.
message: '#does not accept .*\|null.#'
path: tests