<?xml version="1.0"?>
<ruleset name="JohnCMS coding standard">
    <description>JohnCMS coding standard</description>

    <!-- display progress -->
    <arg value="p"/>

    <!-- Paths to check -->
    <file>config</file>
    <file>modules</file>
    <file>system/src</file>
    <exclude-pattern>/config/autoload/*.local.php</exclude-pattern>
    <exclude-pattern>/modules/*/locale/*.lng.php</exclude-pattern>

    <!-- inherit rules from: -->
    <rule ref="PSR12"/>
    <rule ref="PSR1.Files.SideEffects">
        <exclude-pattern>modules</exclude-pattern>
    </rule>
    <rule ref="Generic.Arrays.DisallowLongArraySyntax"/>
    <rule ref="Squiz.WhiteSpace.SuperfluousWhitespace">
        <properties>
            <property name="ignoreBlankLines" value="false"/>
        </properties>
    </rule>
    <rule ref="Generic.Files.LineLength">
        <properties>
            <property name="lineLimit" value="240"/>
            <property name="absoluteLineLimit" value="320"/>
        </properties>
    </rule>

    <!-- 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>
</ruleset>
