-
Notifications
You must be signed in to change notification settings - Fork 78
Expand file tree
/
Copy pathphpstan.neon
More file actions
130 lines (121 loc) · 4.85 KB
/
Copy pathphpstan.neon
File metadata and controls
130 lines (121 loc) · 4.85 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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
# PHPStan configuration for WooCommerce Payments
# This replaces the previous Psalm configuration
includes:
- vendor/phpstan/phpstan/conf/bleedingEdge.neon
parameters:
level: 5
phpVersion: 70400 # PHP 7.4
dynamicConstantNames:
- 'WC_VERSION'
- 'WCPAY_VERSION_NUMBER'
- 'WC_ADMIN_VERSION_NUMBER'
- 'MAILPOET_VERSION'
- 'Automattic\Jetpack\Connection\Package_Version::PACKAGE_VERSION'
# Files and directories to analyze
paths:
- woocommerce-payments.php
- includes
- src
# Files and directories to exclude
excludePaths:
- includes/in-person-payments/templates
- includes/subscriptions
- includes/compat/subscriptions
# Bootstrap files
bootstrapFiles:
- psalm-loader.php
scanFiles:
- dev/phpstan-wordpress-constants.php
- dev/phpstan-wcpay-constants.php
- dev/phpstan-abilities-stubs.php
scanDirectories:
- vendor/woocommerce/subscriptions-core
# Handle undefined constants gracefully
reportUnmatchedIgnoredErrors: false
# Ignore common WordPress patterns that cause false positives
ignoreErrors:
- '#Call to function (is_admin|is_user_logged_in|current_user_can|__|_e|esc_attr|esc_html|wp_kses|get_option|update_option|do_action|apply_filters|add_action|add_filter|wp_enqueue_script|wp_enqueue_style|wp_localize_script|wp_redirect|wp_safe_redirect|wp_die|wp_mail|get_transient|set_transient|plugin_dir_path|plugin_dir_url|get_plugin_data)#'
# The list below is defined during the migration and is to be reduced over time
- { identifier: arguments.count }
- { identifier: argument.type }
- { identifier: argument.vsprintf }
- { identifier: assign.propertyType }
- { identifier: binaryOp.invalid }
- { identifier: booleanAnd.alwaysFalse }
- { identifier: booleanAnd.alwaysTrue }
- { identifier: booleanAnd.leftAlwaysTrue }
- { identifier: booleanAnd.rightAlwaysFalse }
- { identifier: booleanAnd.rightAlwaysTrue }
- { identifier: booleanNot.alwaysFalse }
- { identifier: booleanNot.alwaysTrue }
- { identifier: booleanOr.alwaysFalse }
- { identifier: booleanOr.alwaysTrue }
- { identifier: catch.neverThrown }
- { identifier: class.noParent }
- {
identifier: class.notFound
message: '#Automatewoo\\#'
}
- {
identifier: class.notFound
message: '#Automattic\\Jetpack#'
}
- {
identifier: class.notFound
message: '#Automattic\\WooCommerce\\(Utilities|StoreApi)#'
}
- {
identifier: class.notFound
message: '#MailPoet\\#'
}
- {
identifier: class.notFound
message: '#WC_Payments_Subscriptions_(Event_Handler|Migrator)#'
}
- {
identifier: class.notFound
message: '#WC_Product_Booking#'
}
- { identifier: deadCode.unreachable }
- { identifier: empty.property }
- { identifier: empty.variable }
- { identifier: function.alreadyNarrowedType }
- { identifier: function.impossibleType }
- { identifier: identical.alwaysFalse }
- { identifier: if.alwaysFalse }
- { identifier: if.alwaysTrue }
- { identifier: instanceof.alwaysFalse }
- { identifier: instanceof.alwaysTrue }
- { identifier: isset.offset }
- { identifier: isset.property }
- { identifier: isset.variable }
- {
identifier: method.notFound
message: '#(WC_Session|WC_Payment_Token|WC_Data_Store)#'
}
- { identifier: method.unused }
- { identifier: method.resultUnused }
- { identifier: method.childParameterType }
- { identifier: missingType.iterableValue }
- { identifier: missingType.voidReturn }
- { identifier: notIdentical.alwaysFalse }
- { identifier: notIdentical.alwaysTrue }
- { identifier: nullCoalesce.expr }
- { identifier: nullCoalesce.offset }
- { identifier: nullCoalesce.property }
- { identifier: nullCoalesce.variable }
- { identifier: offsetAccess.notFound }
- { identifier: property.nonObject }
- { identifier: property.notFound }
- { identifier: property.onlyWritten }
- { identifier: property.protected }
- { identifier: property.unused }
- { identifier: return.empty }
- { identifier: return.missing }
- { identifier: return.type }
- { identifier: return.unusedType }
- { identifier: smaller.invalid }
- { identifier: staticMethod.notFound }
- { identifier: ternary.alwaysTrue }
- { identifier: variable.undefined }
- { identifier: varTag.differentVariable }