Skip to content
Snippets Groups Projects
psalm.xml 4.09 KiB
Newer Older
<?xml version="1.0"?>
<psalm
    name="SimpleSAMLphp"
    useDocblockTypes="true"
Tim van Dijen's avatar
Tim van Dijen committed
    errorLevel="2"
    reportMixedIssues="false"
    hideExternalErrors="true"
    allowStringToStandInForClass="true"
        <directory name="config" />
        <directory name="metadata" />
Tim van Dijen's avatar
Tim van Dijen committed
        <directory name="modules" />
        <directory name="public" />
Tim van Dijen's avatar
Tim van Dijen committed
        <directory name="src/SimpleSAML" />
        <directory name="tests" />

        <!-- Ignore certain directories -->
        <ignoreFiles>
            <directory name="vendor" />
        </ignoreFiles>
    </projectFiles>

    <issueHandlers>
        <LessSpecificReturnType errorLevel="info" />

        <!-- level 3 issues - slightly lazy code writing, but probably low false-negatives -->
        <DeprecatedClass errorLevel="info" />
        <DeprecatedMethod errorLevel="info" />

        <MissingClosureReturnType errorLevel="info" />
        <MissingReturnType errorLevel="info" />
        <MissingPropertyType errorLevel="info" />
        <InvalidDocblock errorLevel="info" />

        <PropertyNotSetInConstructor errorLevel="info" />
        <MissingConstructor errorLevel="info" />
        <MissingClosureParamType errorLevel="info" />
        <MissingParamType errorLevel="info" />
        <UnusedClass errorLevel="info" />
        <PossiblyUnusedMethod errorLevel="info" />
Tim van Dijen's avatar
Tim van Dijen committed

        <!-- Ignore these errors until we are fully typehinted -->
        <DocblockTypeContradiction errorLevel="suppress" />
        <RedundantConditionGivenDocblockType errorLevel="suppress" />
        <!-- Ignore UnresolvableInclude on CLI-scripts -->
        <UnresolvableInclude>
            <errorLevel type="suppress">
                <file name="bin/*.php" />
Tim van Dijen's avatar
Tim van Dijen committed
                <file name="modules/core/src/Auth/Process/AttributeMap.php" />
                <file name="modules/*/bin/*.php" />
Tim van Dijen's avatar
Tim van Dijen committed
                <file name="src/SimpleSAML/Configuration.php" />
                <file name="src/SimpleSAML/Metadata/MetaDataStorageHandlerFlatFile.php" />
                <file name="src/SimpleSAML/Module.php" />
                <file name="src/SimpleSAML/XHTML/Template.php" />
                <file name="tests/bootstrap.php" />
                <file name="tests/routers/configLoader.php" />
            </errorLevel>
        </UnresolvableInclude>

        <!-- Ignore MissingFile on public-scripts - Remove when the last public-script is replaced by a controller -->
        <MissingFile>
            <errorLevel type="suppress">
                <file name="public/*.php" />
            </errorLevel>
        </MissingFile>
        <!-- Suppress PossiblyUndefinedGlobalVariable on templates -->
        <PossiblyUndefinedGlobalVariable>
            <errorLevel type="suppress">
                <directory name="config" />
                <directory name="metadata" />
                <directory name="modules/adfs/metadata-templates" />
                <directory name="tests/src/SimpleSAML/Metadata/test-metadata" />
            </errorLevel>
        </PossiblyUndefinedGlobalVariable>

        <!-- Suppress PHPunit-issue -->
        <PropertyNotSetInConstructor>
            <errorLevel type="suppress">
                <directory name="tests" />
            </errorLevel>
        </PropertyNotSetInConstructor>

        <!-- Suppress PHPunit-issue -->
        <InternalMethod>
            <errorLevel type="suppress">
                <directory name="tests" />
            </errorLevel>
        </InternalMethod>

        <!-- Suppress Psalm-issue - We should be able to fix this with the static return-type in PHP 8.0 -->
        <UnsafeInstantiation>
            <errorLevel type="suppress">
                <directory name="tests" />
            </errorLevel>
        </UnsafeInstantiation>
        <file name="vendor/simplesamlphp/simplesamlphp-test-framework/stubs/krb5.php" />
        <file name="vendor/simplesamlphp/simplesamlphp-test-framework/stubs/memcache.php" />
        <file name="vendor/simplesamlphp/simplesamlphp-test-framework/stubs/memcached.php" />
        <file name="vendor/simplesamlphp/simplesamlphp-test-framework/stubs/predis.php" />
    </stubs>