<?xml version="1.0"?>
<psalm
    errorLevel="3"
    phpVersion="8.1"
    findUnusedPsalmSuppress="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/Persistence" />
        <directory name="tests" />
        <ignoreFiles>
            <directory name="vendor" />
            <!-- this one is a mapping file in written in PHP -->
            <file name="tests/Persistence/Mapping/_files/Doctrine.Tests.Persistence.Mapping.PHPTestEntity.php" />
        </ignoreFiles>
    </projectFiles>
    <issueHandlers>
        <TypeDoesNotContainType>
            <errorLevel type="suppress">
                <!-- Expected class list that is not a list<class-string> -->
                <file name="tests/Persistence/Mapping/DefaultFileLocatorTest.php"/>
                <file name="tests/Persistence/Mapping/SymfonyFileLocatorTest.php"/>
            </errorLevel>
        </TypeDoesNotContainType>
        <NullArgument>
            <errorLevel type="suppress">
                <file name="tests/Persistence/Mapping/SymfonyFileLocatorTest.php"/>
            </errorLevel>
        </NullArgument>
        <UndefinedClass>
            <errorLevel type="suppress">
                <!-- This test references ArrayCache which has been removed from Doctrine Cache -->
                <file name="tests/Persistence/Mapping/ClassMetadataFactoryTest.php"/>
            </errorLevel>
        </UndefinedClass>
        <ArgumentTypeCoercion>
            <errorLevel type="suppress">
                <!-- On purpose to use a non existing class for tests -->
                <file name="tests/Persistence/Mapping/RuntimeReflectionServiceTest.php"/>
            </errorLevel>
        </ArgumentTypeCoercion>
        <MoreSpecificReturnType>
            <errorLevel type="suppress">
                <!-- FileDriver::loadMappingFile() in tests could have a more specific return, but is not needed -->
                <file name="tests/Persistence/Mapping/FileDriverTest.php"/>
            </errorLevel>
        </MoreSpecificReturnType>
        <RedundantCast>
            <errorLevel type="suppress">
                <!-- We're filtering invalid input- -->
                <file name="src/Persistence/Mapping/Driver/SymfonyFileLocator.php"/>
            </errorLevel>
        </RedundantCast>
    </issueHandlers>
</psalm>
