<?xml version="1.0"?>
<psalm
    errorLevel="2"
    phpVersion="8.2"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xmlns="https://getpsalm.org/schema/config"
    xsi:schemaLocation="https://getpsalm.org/schema/config vendor/vimeo/psalm/config.xsd"
>
    <projectFiles>
        <directory name="app" />
        <ignoreFiles>
            <directory name="vendor" />
            <directory name="writable" />
            <directory name="tests" />
        </ignoreFiles>
    </projectFiles>

    <issueHandlers>
        <!-- Ignore CodeIgniter helper functions -->
        <UndefinedFunction>
            <errorLevel level="suppress">
                <referencedFunction name="view" />
                <referencedFunction name="redirect" />
                <referencedFunction name="site_url" />
                <referencedFunction name="csrf_token" />
                <referencedFunction name="csrf_hash" />
                <referencedFunction name="session" />
                <referencedFunction name="config" />
                <referencedFunction name="log_message" />
                <referencedFunction name="service" />
                <referencedFunction name="helper" />
            </errorLevel>
        </UndefinedFunction>

        <!-- Ignore config constants -->
        <UndefinedConstant>
            <errorLevel level="suppress">
                <referencedConstant name="WC_ENCRYPTION_KEY" />
                <referencedConstant name="ENVIRONMENT" />
            </errorLevel>
        </UndefinedConstant>
    </issueHandlers>

    <plugins>
        <pluginClass class="Psalm\PhpVersion\PhpVersionAnalyzer" />
    </plugins>
</psalm>
