# monei/trunk/phpstan.neon

MONEI Payments for WooCommerce, version trunk. 61 lines.

- Page: https://pluginprobe.com/plugins/monei/trunk/code/phpstan.neon
- Raw: https://pluginprobe.com/plugins/monei/trunk/raw/phpstan.neon
- Modified: 2026-08-25T15:15:06+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/monei/trunk/code/phpstan.neon#L10-L20`.

```
parameters:
    # Start with level 4 for better performance
    level: 4

    paths:
        - src/

    # Bootstrap file for plugin constants and functions
    bootstrapFiles:
        - tests/phpstan-bootstrap.php

    # Exclude vendor and build directories
    excludePaths:
        - vendor/
        - node_modules/
        - public/
        - assets/

    # Explicitly load WooCommerce stubs and plugin helper functions
    scanFiles:
        - vendor/php-stubs/woocommerce-stubs/woocommerce-stubs.php
        - tests/stubs/woocommerce-subscriptions-stubs.php
        - includes/woocommerce-gateway-monei-core-functions.php

    # Scan MONEI SDK for type information
    scanDirectories:
        - vendor/monei/monei-php-sdk/lib

    # Ignore specific errors
    ignoreErrors:
        # Ignore missing array value types (WordPress patterns)
        -
            identifier: missingType.iterableValue
        # Ignore missing generic types (WordPress patterns)
        -
            identifier: missingType.generics
        # Allow WordPress globals
        - '#Variable \$[a-zA-Z_]+ might not be defined\.#'
        # Ignore dynamic properties (WordPress pattern)
        - '#Access to an undefined property#'
        # WordPress actions can have return values (they're ignored by WordPress)
        - '#Action callback returns .+ but should not return anything\.#'
        # Bootstrap stubs can have simplified return types
        -
            message: '#never returns .+ so it can be removed from the return type#'
            path: tests/phpstan-bootstrap.php
        # The SDK documents Payment::getStatus() as returning a PaymentStatus, but that
        # class is a bag of string constants and the getter returns the raw container
        # value — a string. Concatenating it is correct at runtime; only the docblock is
        # wrong. Full-repo runs infer this correctly, so without an explicit ignore the
        # pre-commit hook (which analyses only the staged files) disagrees with CI.
        - '#(Binary operation "\." between .+ and Monei\\Model\\PaymentStatus results in an error|Cannot cast Monei\\Model\\PaymentStatus to string)#'

    # Performance optimizations
    parallel:
        maximumNumberOfProcesses: 1
        processTimeout: 300.0

    # Report unmatched ignored errors
    reportUnmatchedIgnoredErrors: false

```
