Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
NJPod opened this issue Jul 11, 2024 · 0 comments
Open

Comments

@NJPod
Copy link

NJPod commented Jul 11, 2024

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant