Skip to content
Snippets Groups Projects
psalm.xml 4.38 KiB
Newer Older
<?xml version="1.0"?>
<psalm
    name="SimpleSAMLphp"
    useDocblockTypes="true"
    totallyTyped="false"
    hideExternalErrors="true"
    allowStringToStandInForClass="true"
        <directory name="lib/SimpleSAML/Auth" />
        <directory name="lib/SimpleSAML/Bindings" />
        <directory name="lib/SimpleSAML/Error" />
        <directory name="lib/SimpleSAML/HTTP" />
        <directory name="lib/SimpleSAML/IdP" />
        <directory name="lib/SimpleSAML/Locale" />
        <directory name="lib/SimpleSAML/Logger" />
        <directory name="lib/SimpleSAML/Metadata" />
        <directory name="lib/SimpleSAML/Module" />
        <directory name="lib/SimpleSAML/Stats" />
        <directory name="lib/SimpleSAML/Store" />
        <directory name="lib/SimpleSAML/Utils" />
        <directory name="lib/SimpleSAML/XHTML" />
        <directory name="lib/SimpleSAML/XML" />

        <!-- Replaces all modules/... with this one-liner for 2.0
        <directory name="modules" />
        -->
        <directory name="modules/admin" />
        <directory name="modules/core" />
        <directory name="modules/cron" />
        <directory name="modules/exampleauth" />
        <directory name="modules/multiauth" />
        <directory name="modules/portal" />
        <directory name="modules/saml" />
        <directory name="tests" />

        <!-- Ignore deprecated classes -->
        <ignoreFiles>
            <file name="lib/SimpleSAML/Auth/DefaultAuth.php" />
Tim van Dijen's avatar
Tim van Dijen committed
            <file name="lib/SimpleSAML/Auth/TimeLimitedToken.php" />
            <file name="lib/SimpleSAML/Utilities.php" />

            <!-- Ignore deprecated PHP-templates - Remove for 2.0 -->
            <file name="modules/**/templates/*.tpl.php" />
            <file name="modules/saml/templates/proxy/*.tpl.php" />
            <file name="modules/saml/templates/sp/*.tpl.php" />

            <directory name="tests/Utils/Stubs" />
            <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" />
        <MisplacedRequiredParam 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" />

        <!-- See #1141 -->
        <MissingDependency>
            <errorLevel type="suppress">
                <file name="lib/SimpleSAML/HTTP/Router.php" />
            </errorLevel>
        </MissingDependency>

        <!-- Ignore UnresolvableInclude on CLI-scripts -->
        <UnresolvableInclude>
            <errorLevel type="suppress">
                <file name="bin/*.php" />
                <file name="lib/SimpleSAML/XHTML/Template.php" />
                <file name="modules/*/bin/*.php" />
                <file name="tests/bootstrap.php" />
                <file name="tests/routers/configLoader.php" />
            </errorLevel>
        </UnresolvableInclude>

        <!-- Ignore MissingFile on www-scripts - Remove for 2.0 -->
        <MissingFile>
            <errorLevel type="suppress">
                <file name="www/*.php" />
                <file name="modules/*/www/*.php" />
            </errorLevel>
        </MissingFile>

        <!-- Suppress PHPunit-issue -->
        <PropertyNotSetInConstructor>
            <errorLevel type="suppress">
                <directory name="tests" />
            </errorLevel>
        </PropertyNotSetInConstructor>
        <file name="tests/Utils/Stubs/krb5.php" />
        <file name="tests/Utils/Stubs/memcache.php" />
        <file name="tests/Utils/Stubs/memcached.php" />
        <file name="tests/Utils/Stubs/predis.php" />
    </stubs>