<?xml version="1.0"?>
<ruleset name="PHP_CodeSniffer">
    <config name="installed_paths" value="../../slevomat/coding-standard"/>
    <rule ref="PSR12" />
    <!-- Forbid usage of a function or a class constant via fallback global name -->
    <rule ref="SlevomatCodingStandard.Namespaces.ReferenceUsedNamesOnly">
        <properties>
            <property name="allowFallbackGlobalConstants" type="boolean" value="false"/>
            <property name="allowFallbackGlobalFunctions" type="boolean" value="false"/>
            <property name="allowFullyQualifiedGlobalConstants" type="boolean" value="true"/>
            <property name="allowFullyQualifiedGlobalFunctions" type="boolean" value="true"/>
            <property name="allowFullyQualifiedGlobalClasses" type="boolean" value="true"/>
        </properties>
        <exclude name="SlevomatCodingStandard.Namespaces.ReferenceUsedNamesOnly.ReferenceViaFullyQualifiedName"/>
    </rule>

    <rule ref="PSR2.Namespaces.UseDeclaration">
        <exclude-pattern>*</exclude-pattern>
    </rule>

    <rule ref="PSR1.Methods.CamelCapsMethodName.NotCamelCaps">
        <exclude-pattern>tests/Unit</exclude-pattern>
    </rule>

    <file>src/</file>
    <file>tests</file>
    <exclude-pattern>cache/</exclude-pattern>
    <exclude-pattern>tests/_run/</exclude-pattern>
    <exclude-pattern>tests/Acceptance/_output</exclude-pattern>
    <exclude-pattern>tests/Acceptance/_run</exclude-pattern>
    <exclude-pattern>tests/Acceptance/_support</exclude-pattern>
    <exclude-pattern>tests/Acceptance/Support/</exclude-pattern><!-- This code mostly copy-paste from https://github.com/psalm/codeception-psalm-module and thus may have different coding-style rules -->
    <exclude-pattern>tests/Application/</exclude-pattern>
    <exclude-pattern>tests/Unit/Handlers/Eloquent/Schema/migrations</exclude-pattern>
</ruleset>
