<?xml version="1.0"?>
<ruleset xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" name="Example Project"
         xsi:noNamespaceSchemaLocation="https://raw.githubusercontent.com/squizlabs/PHP_CodeSniffer/master/phpcs.xsd">

    <description>Set of rules to check this project</description>

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

    <file>.</file>

    <!-- Exclude the Composer Vendor directory. -->
    <exclude-pattern>/vendor/*</exclude-pattern>

    <!-- Include the WordPress-Extra standard, with some exceptions. -->
    <rule ref="WordPress-Extra">
        <exclude name="Generic.WhiteSpace.DisallowSpaceIndent"/>
        <exclude name="Squiz.Commenting.FileComment.MissingPackageTag"/>
        <exclude name="WordPress.WhiteSpace.PrecisionAlignment"/>
    </rule>

    <!-- Let's also check that everything is properly documented. -->
    <rule ref="WordPress-Docs">
        <exclude name="Squiz.Commenting.FunctionComment.Missing"/>
    </rule>

    <!-- Check for PHP cross-version compatibility. -->
    <!--
    To enable this, the PHPCompatibilityWP standard needs to be installed. See the readme for installation instructions:
    https://github.com/PHPCompatibility/PHPCompatibilityWP
    For more information, also see:
    https://github.com/PHPCompatibility/PHPCompatibility
    -->
    <!--
    <config name="testVersion" value="5.2-"/>
    <rule ref="PHPCompatibilityWP"/>
    -->

    <!--
    To get the optimal benefits of using WPCS, we should add a couple of custom properties.
    Adjust the values of these properties to fit our needs.

    For information on additional custom properties available, check out the wiki:
    https://github.com/WordPress/WordPress-Coding-Standards/wiki/Customizable-sniff-properties
    -->
    <config name="minimum_supported_wp_version" value="4.7"/>

    <!-- Prevent invalid (in PHP8) `trim()` calls in I18n and PrefixAllGlobals sniffs by WordPress. -->
    <config name="text_domain" value=""/>
    <config name="prefixes" value=""/>

    <!-- Additional and modified rules. -->
    <rule ref="Generic.WhiteSpace.DisallowTabIndent"/>

    <rule ref="WordPress.WP.I18n">
        <properties>
            <property name="text_domain" type="array">
                <element value="headers-security-advanced-hsts-wp"/>
                <element value="headers-security-advanced-hsts-admin-login"/>
            </property>
        </properties>
    </rule>

    <rule ref="WordPress.NamingConventions.PrefixAllGlobals">
        <properties>
            <property name="prefixes" type="array">
                <element value="hsts_plugin_"/><!-- for functions -->
            </property>
        </properties>
    </rule>

    <rule ref="Squiz.Commenting.FileComment.WrongStyle">
        <exclude-pattern>/index\.php</exclude-pattern>
    </rule>

    <rule ref="Squiz.Commenting.InlineComment.WrongStyle">
        <exclude-pattern>/index\.php</exclude-pattern>
    </rule>
</ruleset>
