<?xml version="1.0"?>
<ruleset xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" name="Laravel" xsi:noNamespaceSchemaLocation="phpcs.xsd">
    <description>Laravel PHP_CodeSniffer configuration</description>

    <!-- Include PSR-12 coding standard -->
    <rule ref="PSR12"/>

    <!-- Additional Laravel-specific rules -->
    <rule ref="Generic.Arrays.DisallowLongArraySyntax"/>
    <rule ref="Generic.Formatting.SpaceAfterCast"/>
    <rule ref="Generic.Functions.FunctionCallArgumentSpacing"/>
    <rule ref="Generic.NamingConventions.UpperCaseConstantName"/>
    <rule ref="Generic.WhiteSpace.DisallowTabIndent"/>
    <rule ref="Squiz.WhiteSpace.SuperfluousWhitespace">
        <properties>
            <property name="ignoreBlankLines" value="true"/>
        </properties>
    </rule>

    <!-- Check all PHP files in the app, config, database, routes, and tests directories -->
    <file>app/</file>
    <file>config/</file>
    <file>database/</file>
    <file>routes/</file>
    <file>tests/</file>

    <!-- Exclude vendor directory -->
    <exclude-pattern>vendor/</exclude-pattern>
    <exclude-pattern>storage/</exclude-pattern>
    <exclude-pattern>bootstrap/cache/</exclude-pattern>
    <exclude-pattern>*.blade.php</exclude-pattern>

    <!-- Laravel migrations don't require namespaces -->
    <rule ref="PSR1.Classes.ClassDeclaration.MissingNamespace">
        <exclude-pattern>database/migrations/*</exclude-pattern>
    </rule>

    <!-- Show progress -->
    <arg value="p"/>
    <arg value="s"/>

    <!-- Use colors in output -->
    <arg name="colors"/>

    <!-- Show sniff codes in all reports -->
    <arg value="n"/>
</ruleset>
