<?xml version="1.0"?>
<ruleset name="WP Discourse Coding Standards">
    <!-- See https://github.com/squizlabs/PHP_CodeSniffer/wiki/Annotated-ruleset.xml -->
    <!-- See https://github.com/WordPress-Coding-Standards/WordPress-Coding-Standards/blob/develop/WordPress-Core/ruleset.xml -->

    <!-- Set a description for this ruleset. -->
    <description>A custom set of code standard rules for the WP Discourse plugin.</description>

    <!-- Include the WordPress ruleset, with exclusions. -->
    <rule ref="WordPress">
        <exclude name="Generic.Files.LowercasedFilename" />
        <exclude name="Generic.WhiteSpace.ScopeIndent.IncorrectExact" />
        <exclude name="Generic.WhiteSpace.ScopeIndent.Incorrect" />
        <exclude name="PEAR.Functions.FunctionCallSignature.Indent" />
        <exclude name="WordPress.VIP.RestrictedFunctions" />
        <exclude name="WordPress.VIP.SlowDBQuery" />
        <exclude name="WordPress.VIP.DirectDatabaseQuery.NoCaching" />
        <exclude name="WordPress.VIP.DirectDatabaseQuery.SchemaChange" />
        <exclude name="WordPress.Files.FileName.InvalidClassFileName" />
        <exclude name="Generic.WhiteSpace.DisallowSpaceIndent.SpacesUsed" />
        <!-- Have to add this so that $table_name can be included in a prepare statment. -->
        <exclude name="WordPress.WP.PreparedSQL.NotPrepared" />
        <!-- DOMDocument uses camelCase. -->
        <exclude name="WordPress.NamingConventions.ValidVariableName.NotSnakeCaseMemberVar" />
    </rule>

    <!-- Include sniffs for PHP cross-version compatibility. -->
    <rule ref="PHPCompatibility"/>
</ruleset>
