<?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"
    errorBaseline="psalm-baseline.xml"
>
    <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="src/Persistence/Reflection/RuntimeReflectionProperty.php"/>
                <file name="tests/Persistence/Mapping/SymfonyFileLocatorTest.php"/>
            </errorLevel>
        </NullArgument>
        <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>
        <UndefinedClass>
            <errorLevel type="suppress">
                <!-- We are testing what happens when calling the API with a non existent class -->
                <file name="tests/Persistence/Mapping/ClassMetadataFactoryTest.php"/>
                <file name="tests/Persistence/Mapping/RuntimeReflectionServiceTest.php"/>
            </errorLevel>
        </UndefinedClass>
        <ArgumentTypeCoercion>
            <errorLevel type="suppress">
                <!-- Related to the above, since we are coercing a string to class-string -->
                <file name="tests/Persistence/Mapping/ClassMetadataFactoryTest.php"/>
                <file name="tests/Persistence/Mapping/RuntimeReflectionServiceTest.php"/>
            </errorLevel>
        </ArgumentTypeCoercion>
    </issueHandlers>
    <stubs>
        <file name="psalm.phpstub" />
    </stubs>
</psalm>
