<?xml version="1.0"?>
<ruleset name="Winter CMS">
    <description>The coding standard for Winter CMS.</description>
    <rule ref="PSR12">
        <!--
        Exceptions to the PSR-2 guidelines as per our Developer Guide:
        https://wintercms.com/docs/v1.2/docs/architecture/developer-guide#exceptions-to-the-standard
        -->
        <exclude name="PSR1.Methods.CamelCapsMethodName.NotCamelCaps" />
        <exclude name="Squiz.ControlStructures.ControlSignature.SpaceAfterCloseBrace" />
        <exclude name="PSR2.ControlStructures.ControlStructureSpacing.SpacingAfterOpenBrace" />

        <!--  We're not enforcing a line length limit -->
        <exclude name="Generic.Files.LineLength" />
    </rule>

    <rule ref="PSR1.Classes.ClassDeclaration.MultipleClasses">
        <!--
        Test fixtures and cases can have multiple classes defined, only if they are directly related to the test, or are
        extended classes
        -->
        <exclude-pattern>*/tests/*</exclude-pattern>
    </rule>

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

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

    <!-- Ignore vendor files -->
    <exclude-pattern>*/vendor/*</exclude-pattern>
</ruleset>
