<?xml version="1.0"?>
<psalm
    errorLevel="1"
    phpVersion="8.1"
    resolveFromConfigFile="true"
    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="src"/>
        <directory name="tests"/>
        <ignoreFiles>
            <directory name="vendor"/>
        </ignoreFiles>
    </projectFiles>
    <plugins>
        <pluginClass class="Psalm\PhpUnitPlugin\Plugin"/>
    </plugins>
    <issueHandlers>
        <DeprecatedMethod>
            <errorLevel type="suppress">
                <referencedMethod name="Doctrine\Common\Lexer\Token::offsetGet"/>
                <referencedMethod name="Doctrine\Common\Lexer\Token::offsetSet"/>
            </errorLevel>
        </DeprecatedMethod>
        <DocblockTypeContradiction>
            <errorLevel type="suppress">
                <!-- let us assume no one actually unsets the value of a token -->
                <file name="tests/TokenTest.php" />
            </errorLevel>
        </DocblockTypeContradiction>
        <InvalidReturnStatement>
            <errorLevel type="suppress">
                <!-- https://github.com/vimeo/psalm/issues/8878 -->
                <file name="src/AbstractLexer.php" />
            </errorLevel>
        </InvalidReturnStatement>
        <InvalidReturnType>
            <errorLevel type="suppress">
                <!-- https://github.com/vimeo/psalm/issues/8878 -->
                <file name="src/AbstractLexer.php" />
            </errorLevel>
        </InvalidReturnType>
        <MixedAssignment>
            <errorLevel type="suppress">
                <file name="src/AbstractLexer.php" />
            </errorLevel>
        </MixedAssignment>
        <MixedReturnStatement>
            <errorLevel type="suppress">
                <file name="src/Token.php" />
            </errorLevel>
        </MixedReturnStatement>
        <ReferenceConstraintViolation>
            <errorLevel type="suppress">
                <!-- https://github.com/vimeo/psalm/issues/8891 -->
                <file name="src/AbstractLexer.php" />
            </errorLevel>
        </ReferenceConstraintViolation>
        <RedundantConditionGivenDocblockType>
            <errorLevel type="suppress">
                <!-- that test checks non-obvious things guaranteed by static analysis, just in case -->
                <file name="tests/AbstractLexerTest.php" />
            </errorLevel>
        </RedundantConditionGivenDocblockType>
    </issueHandlers>
</psalm>
