<?xml version="1.0"?>
<ruleset name="Zeno Chatbot AI - PHP Compatibility">
    <description>PHP 7.4-8.3 compatibility gate for the free plugin. Kept until WordPress drops PHP 7.4 support.</description>

    <!-- Supported PHP range: bump when WordPress core drops 7.4 -->
    <config name="testVersion" value="7.4-8.3"/>

    <!--
        Plain PHPCompatibility 10 (PHPCompatibilityWP 3.0 is not released yet;
        its stable 2.1.x is locked to the outdated 9.x sniffs). The excludes
        below replicate the WP ruleset's purpose for the functions this plugin
        polyfills itself in src/Support/Polyfill.php (also WP-core-polyfilled
        since WP 5.9).
    -->
    <rule ref="PHPCompatibility">
        <exclude name="PHPCompatibility.FunctionUse.NewFunctions.str_containsFound"/>
        <exclude name="PHPCompatibility.FunctionUse.NewFunctions.str_starts_withFound"/>
        <exclude name="PHPCompatibility.FunctionUse.NewFunctions.str_ends_withFound"/>
        <!--
            Detects the func_get_args() behavior change at the PHP 7.0 boundary,
            which is below this plugin's 7.4 floor — semantics are identical across
            the whole supported range. The flagged framework Collection sites were
            manually verified: func_get_args() only runs on branches where the
            parameter was never reassigned.
        -->
        <exclude name="PHPCompatibility.FunctionUse.ArgumentFunctionsReportCurrentValue"/>
    </rule>

    <arg name="extensions" value="php"/>
    <arg value="sp"/>

    <!-- Free plugin scan surface -->
    <file>zeno-chatbot-ai.php</file>
    <file>src</file>
    <file>boot</file>
    <file>config</file>
    <file>database</file>
    <file>packages/wpchatbot/framework/src</file>

    <!-- Upstream Action Scheduler (maintained externally, ships own compat shims) -->
    <exclude-pattern>*/src/Services/Scheduler/scoped-vendor/*</exclude-pattern>
    <exclude-pattern>*/vendor/*</exclude-pattern>
    <exclude-pattern>*/node_modules/*</exclude-pattern>
</ruleset>
