Skip to content

Error report changes depending on whether collector is included #12065

@SanderRonde

Description

@SanderRonde

Bug report

I've managed to find an issue where an error is or is not reported depending on whether a specific type is described or not in a collector. Running this code with the collector and with the describe causes the error to be reported. Running it without doesn't. I'd assume that since collectors are a readonly feature they should not influence the result.

I know that this explanation is a bit vague, I'd say that it's better to look at the minimum reproduceable code sample I've included where you can see it for yourself a bit more clearly.

(backstory: SanderRonde/phpstan-vscode#109)

Code snippet that reproduces the problem

https://github.com/SanderRonde/phpstan-bug-min-repro/tree/main

Expected output

It should not report an issue. Neither when the collector is included and when it isn't.

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

PHPStan helps me out a lot (as the creator of the PHPStan-VSCode extension I'm of course a big fan :)

Metadata

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