<?xml version="1.0"?>
<ruleset name="YITH Plugin Framework Coding Standards">
    <description>YITH Plugin Framework - 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>/dist/*</exclude-pattern>
    <exclude-pattern>/languages/*</exclude-pattern>
    <exclude-pattern>*/node_modules/*</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 5.6 and higher. -->
    <config name="testVersion" value="7.0-"/>

    <!-- Rules -->

    <!-- WordPress -->
    <rule ref="WordPress">
        <exclude name="WordPress.DB.DirectDatabaseQuery.NoCaching" />
        <exclude name="WordPress.DB.DirectDatabaseQuery.DirectQuery" />
        <exclude name="WordPress.DB.DirectDatabaseQuery.SchemaChange" />
    </rule>

    <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,yith_plugin_fw_html_attributes_to_string"/>
        </properties>
    </rule>

    <rule ref="WordPress.Arrays.MultipleStatementAlignment">
        <properties>
            <property name="maxColumn" value="200"/>
        </properties>
    </rule>
</ruleset>
