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

    <description>Onepix WordPress Coding Standards</description>

    <rule ref="WordPress">
        <exclude name="WordPress.PHP.DisallowShortTernary.Found"/>

        <exclude name="WordPress.Files.FileName"/>

        <exclude name="WordPress.Security.NonceVerification.Recommended"/>

        <!-- Rule does not work with custom functions for verification -->
        <exclude name="WordPress.Security.NonceVerification.Missing"/>

        <exclude name="WordPress.Security.SafeRedirect.wp_redirect_wp_redirect"/>

        <exclude name="Squiz.Commenting.FunctionCommentThrowTag.Missing"/>

        <exclude name="Generic.CodeAnalysis.UnusedFunctionParameter.FoundAfterLastUsed"/>

        <exclude name="Universal.Operators.DisallowShortTernary.Found"/>

        <exclude name="WordPress.Security.EscapeOutput.ExceptionNotEscaped"/>

        <!-- Allow not yoda conditions -->
        <exclude name="WordPress.PHP.YodaConditions.NotYoda"/>

        <!-- Allow short array syntax -->
        <exclude name="Universal.Arrays.DisallowShortArraySyntax.Found"/>

        <exclude name="Squiz.PHP.CommentedOutCode.Found"/>

        <!-- Disable mandatory commenting on anything and everything -->
        <exclude name="Squiz.Commenting"/>
        <exclude name="Generic.Commenting"/>

        <!-- Allow reserved keywords as parameter names -->
        <exclude name="Universal.NamingConventions.NoReservedKeywordParameterNames"/>

        <!-- Allow error logging -->
        <exclude name="WordPress.PHP.DevelopmentFunctions.error_log_error_log"/>

        <!--    The project will not be published in the WP repository. Therefore, we don’t have to worry about these errors.    -->
        <exclude name="WordPress.Security.EscapeOutput.OutputNotEscaped"/>
        <exclude name="WordPress.Security.EscapeOutput.HeredocOutputNotEscaped"/>
        <exclude name="WordPress.PHP.DontExtract.extract_extract"/>
        <exclude name="WordPress.Security.ValidatedSanitizedInput.MissingUnslash"/>
        <exclude name="WordPress.Security.ValidatedSanitizedInput.InputNotValidated"/>
        <exclude name="WordPress.Security.ValidatedSanitizedInput.InputNotSanitized"/>

        <!--    We don't want use wp filesystem functions    -->
        <exclude name="WordPress.WP.AlternativeFunctions.file_system_operations_rmdir"/>
        <exclude name="WordPress.WP.AlternativeFunctions.file_system_operations_mkdir"/>
        <exclude name="WordPress.WP.AlternativeFunctions.file_system_operations_file_put_contents"/>
        <exclude name="WordPress.WP.AlternativeFunctions.file_get_contents_file_get_contents"/>

        <!--   Disable WordPress rules that don't comply with PSR-12     -->
        <exclude name="Generic.Functions"/>
        <exclude name="Squiz.Functions"/>

        <exclude name="Generic.WhiteSpace"/>
        <exclude name="Universal.WhiteSpace"/>
        <exclude name="WordPress.WhiteSpace"/>

        <exclude name="Generic.Classes"/>
        <exclude name="Universal.Classes"/>

        <exclude name="WordPress.Arrays"/>
        <exclude name="NormalizedArrays"/>

        <exclude name="WordPress.NamingConventions"/>
        <exclude name="PEAR"/>
    </rule>

    <rule ref="Generic.Arrays.DisallowLongArraySyntax"/>

    <rule ref="PSR12"/>

    <rule ref="Squiz.NamingConventions.ValidVariableName">
        <exclude name="Squiz.NamingConventions.ValidVariableName.PrivateNoUnderscore"/>
    </rule>

    <rule ref="WordPress.DB">
        <exclude-pattern>/tests</exclude-pattern>
    </rule>
</ruleset>