| 1 |
parameters: |
| 2 |
# Start with level 4 for better performance |
| 3 |
level: 4 |
| 4 |
|
| 5 |
paths: |
| 6 |
- src/ |
| 7 |
|
| 8 |
# Bootstrap file for plugin constants and functions |
| 9 |
bootstrapFiles: |
| 10 |
- tests/phpstan-bootstrap.php |
| 11 |
|
| 12 |
# Exclude vendor and build directories |
| 13 |
excludePaths: |
| 14 |
- vendor/ |
| 15 |
- node_modules/ |
| 16 |
- public/ |
| 17 |
- assets/ |
| 18 |
|
| 19 |
# Explicitly load WooCommerce stubs and plugin helper functions |
| 20 |
scanFiles: |
| 21 |
- vendor/php-stubs/woocommerce-stubs/woocommerce-stubs.php |
| 22 |
- tests/stubs/woocommerce-subscriptions-stubs.php |
| 23 |
- includes/woocommerce-gateway-monei-core-functions.php |
| 24 |
|
| 25 |
# Scan MONEI SDK for type information |
| 26 |
scanDirectories: |
| 27 |
- vendor/monei/monei-php-sdk/lib |
| 28 |
|
| 29 |
# Ignore specific errors |
| 30 |
ignoreErrors: |
| 31 |
# Ignore missing array value types (WordPress patterns) |
| 32 |
- |
| 33 |
identifier: missingType.iterableValue |
| 34 |
# Ignore missing generic types (WordPress patterns) |
| 35 |
- |
| 36 |
identifier: missingType.generics |
| 37 |
# Allow WordPress globals |
| 38 |
- '#Variable \$[a-zA-Z_]+ might not be defined\.#' |
| 39 |
# Ignore dynamic properties (WordPress pattern) |
| 40 |
- '#Access to an undefined property#' |
| 41 |
# WordPress actions can have return values (they're ignored by WordPress) |
| 42 |
- '#Action callback returns .+ but should not return anything\.#' |
| 43 |
# Bootstrap stubs can have simplified return types |
| 44 |
- |
| 45 |
message: '#never returns .+ so it can be removed from the return type#' |
| 46 |
path: tests/phpstan-bootstrap.php |
| 47 |
# The SDK documents Payment::getStatus() as returning a PaymentStatus, but that |
| 48 |
# class is a bag of string constants and the getter returns the raw container |
| 49 |
# value — a string. Concatenating it is correct at runtime; only the docblock is |
| 50 |
# wrong. Full-repo runs infer this correctly, so without an explicit ignore the |
| 51 |
# pre-commit hook (which analyses only the staged files) disagrees with CI. |
| 52 |
- '#(Binary operation "\." between .+ and Monei\\Model\\PaymentStatus results in an error|Cannot cast Monei\\Model\\PaymentStatus to string)#' |
| 53 |
|
| 54 |
# Performance optimizations |
| 55 |
parallel: |
| 56 |
maximumNumberOfProcesses: 1 |
| 57 |
processTimeout: 300.0 |
| 58 |
|
| 59 |
# Report unmatched ignored errors |
| 60 |
reportUnmatchedIgnoredErrors: false |
| 61 |
|