Skip to content

Static Analysis: psalm errors on model classes even with the plugin enabled  #545

Open
@NJPod

Description

Not sure what I am doing wrong but I have followed this guide https://valinor.cuyz.io/latest/other/static-analysis/.

My data model classes are read only with public properties declared in the constructor. Some models are dependencies of others.

psalm.xml:

<?xml version="1.0"?>
<psalm
    errorLevel="1"
    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"
    findUnusedBaselineEntry="true"
    findUnusedCode="true"
>
    <plugins>
        <pluginClass class="CuyZ\Valinor\QA\Psalm\ValinorPsalmPlugin"/>
    </plugins>
    <projectFiles>
        <directory name="src" />
        <directory name="public" />
        <ignoreFiles>
            <directory name="vendor" />
        </ignoreFiles>
    </projectFiles>
</psalm>

composer.json:

    "autoload-dev": {
        "files": [
            "vendor/cuyz/valinor/qa/Psalm/ValinorPsalmPlugin.php"
        ]
    },

However, running ./vendor/bin/psalm still produces PossiblyUnusedMethod for the constructors and PossiblyUnusedProperty for the properties related to the model classes.

Any ideas?

Thanks.

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions