<?xml version="1.0"?>
<ruleset name="PHP_CodeSniffer">
    <description>The coding standard for PHP_CodeSniffer itself.</description>

    <file>src</file>
    <file>tests</file>

    <exclude-pattern>*/Standards/*/Tests/*\.(inc|css|js)</exclude-pattern>

    <arg name="basepath" value="."/>
    <arg name="colors" />
    <arg name="parallel" value="75" />
    <arg value="np"/>


    <!-- Check var names, but we don't want leading underscores for private vars -->
    <rule ref="Squiz.NamingConventions.ValidVariableName" />
    <rule ref="Squiz.NamingConventions.ValidVariableName.PrivateNoUnderscore">
        <severity>0</severity>
    </rule>

    <!-- Method names MUST NOT be declared with a space after the method name. The opening brace MUST go on its own line, and the closing brace MUST go on the next line following the body. There MUST NOT be a space after the opening parenthesis, and there MUST NOT be a space before the closing parenthesis. -->
    <!-- checked in Methods/FunctionClosingBraceSniff -->
    <rule ref="Squiz.Functions.FunctionDeclaration"/>
    <rule ref="Squiz.Functions.LowercaseFunctionKeywords"/>

    <!-- Only one argument per line in multi-line function calls -->
    <rule ref="PEAR.Functions.FunctionCallSignature">
        <properties>
            <property name="allowMultipleArguments" value="false"/>
        </properties>
    </rule>

    <!-- Code MUST use an indent of 4 spaces, and MUST NOT use tabs for indenting. -->
    <rule ref="Generic.WhiteSpace.ScopeIndent">
        <properties>
            <property name="ignoreIndentationTokens" type="array">
                <element value="T_COMMENT"/>
                <element value="T_DOC_COMMENT_OPEN_TAG"/>
            </property>
        </properties>
    </rule>


    <!-- PHP keywords MUST be in lower case. -->
    <rule ref="Generic.PHP.LowerCaseKeyword"/>

    <!-- The PHP constants true, false, and null MUST be in lower case. -->
    <rule ref="Generic.PHP.LowerCaseConstant"/>

    <!-- Visibility MUST be declared on all methods. -->
    <rule ref="Squiz.Scope.MethodScope"/>
    <rule ref="Squiz.WhiteSpace.ScopeKeywordSpacing"/>

    <!-- Ban some functions -->
    <rule ref="Generic.PHP.ForbiddenFunctions">
        <properties>
            <property name="forbiddenFunctions" type="array">
                <element key="sizeof" value="count"/>
                <element key="delete" value="unset"/>
                <element key="print" value="echo"/>
                <element key="is_null" value="null"/>
                <element key="create_function" value="null"/>
            </property>
        </properties>
    </rule>

    <rule ref="PSR2">
    </rule>

</ruleset>