<?xml version="1.0"?>
<ruleset name="YITH Product Bundles">
    <description>YITH Product Bundles - PHP_CodeSniffer ruleset.</description>

    <file>.</file>

    <!-- Exclude paths -->
    <exclude-pattern>Gruntfile.js</exclude-pattern>
    <exclude-pattern>/assets/*</exclude-pattern>
    <exclude-pattern>/bin/*</exclude-pattern>
    <exclude-pattern>/languages/*</exclude-pattern>
    <exclude-pattern>/lib/*</exclude-pattern>
    <exclude-pattern>/node_modules/*</exclude-pattern>
    <exclude-pattern>/plugin-fw/*</exclude-pattern>
    <exclude-pattern>/plugin-upgrade/*</exclude-pattern>
    <exclude-pattern>/tests/*</exclude-pattern>
    <exclude-pattern>/tools/*</exclude-pattern>
    <exclude-pattern>/vendor/*</exclude-pattern>

    <!-- Show progress, show the error codes for each message (source). -->
    <arg value="ps"/>

    <!-- Strip the filepaths in reports down to the relevant bit. -->
    <arg name="basepath" value="./"/>

    <!-- Check up to 8 files simultaneously. -->
    <arg name="parallel" value="8"/>

    <!-- Only scan PHP files. -->
    <arg name="extensions" value="php"/>

    <!-- Configs -->
    <config name="minimum_supported_wp_version" value="5.2"/>

    <!-- Check for cross-version support for PHP 7.0 and higher. -->
    <config name="testVersion" value="7.0-"/>

    <!-- Rules -->

    <rule ref="WordPress">
        <exclude name="WordPress.Files.FileName.InvalidClassFileName"/>
    </rule>
    <rule ref="PHPCompatibilityWP"/>

    <rule ref="WordPress.Security.ValidatedSanitizedInput">
        <properties>
            <property name="customSanitizingFunctions" type="array" value="wc_clean,wc_sanitize_tooltip,wc_format_decimal,wc_stock_amount,wc_sanitize_permalink,wc_sanitize_textarea"/>
        </properties>
    </rule>

    <rule ref="WordPress.Security.EscapeOutput">
        <properties>
            <property name="customEscapingFunctions" type="array" value="wc_help_tip,wc_sanitize_tooltip,wc_selected,wc_kses_notice,wc_esc_json,wc_query_string_form_fields,wc_make_phone_clickable,yith_plugin_fw_html_data_to_string,yith_field_deps_data,yith_panel_field_deps_data"/>
        </properties>
    </rule>
</ruleset>
