-
Notifications
You must be signed in to change notification settings - Fork 16
Expand file tree
/
Copy pathphpstan.neon
More file actions
65 lines (54 loc) · 2.24 KB
/
phpstan.neon
File metadata and controls
65 lines (54 loc) · 2.24 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
parameters:
level: 5
paths:
- includes
excludePaths:
- includes/updates/*
- vendor/*
- vendor_prefixed/*
# WordPress and WooCommerce stubs
bootstrapFiles:
- vendor/php-stubs/wordpress-stubs/wordpress-stubs.php
- vendor/php-stubs/woocommerce-stubs/woocommerce-stubs.php
- phpstan-constants.php
# Ignore errors in third-party code
ignoreErrors:
# Allow dynamic property access for WordPress objects
- '#Access to an undefined property WC_Order::\$#'
- '#Access to an undefined property WC_Product::\$#'
- '#Access to an undefined property WP_User::\$#'
- '#Access to an undefined property WC_Meta_Data::\$#'
- '#Access to an undefined property WooCommerce::\$#'
# Allow calls to undefined methods on mock objects in tests
- '#Call to an undefined method .+::expects\(\)#'
# WC methods/classes not in stubs
- '#Call to an undefined method WC_Data::#'
- '#Call to an undefined method WC_Product::get_global_unique_id\(\)#'
- '#Call to an undefined method WC_Order_Item::#'
- '#Call to an undefined method WC_Abstract_Order::#'
- '#Call to method .+ on an unknown class#'
- '#Access to property .+ on an unknown class#'
- '#PHPDoc tag @throws with type .+ is not subtype of Throwable#'
# Vendor-prefixed classes
- '#on an unknown class WCPOS\\Vendor\\#'
# WordPress/WooCommerce function parameter mismatches in stubs
- '#Function rest_ensure_response invoked with#'
- '#Function remove_action invoked with#'
# WordPress constants not in stubs
- '#Used constant DOING_AJAX not found#'
# Ignore missing typehints for iterables and generics
-
identifier: missingType.iterableValue
-
identifier: missingType.generics
# Treat these as universal object crates (dynamic properties allowed)
universalObjectCratesClasses:
- WP_Post
- WP_User
- WC_Order
- WC_Product
- WC_Customer
# Report unmatched ignored errors
reportUnmatchedIgnoredErrors: false
includes:
- vendor/szepeviktor/phpstan-wordpress/extension.neon