Skip to content

Unable to inline-ignore errors from most collector-based rules #12328

@janedbal

Description

@janedbal

Bug report

When a collector-based rule needs data from full codebase, it uses if ($node->isOnlyFilesAnalysis()) return [] (example). But then, you are unable to inline-ignore those errors via // @phpstan-ignore identifier as it produces false-positives in partial analysis of such file (unmatched ignore reported).

See reproduction repository: https://github.com/janedbal/phpstan-unable-to-inline-ignore-collector-based-rule

Code snippet that reproduces the problem

No response

Expected output

Be able to inline-ignore everything

Did PHPStan help you today? Did it make you happy in any way?

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions