Skip to content

False positive with Symfony Messenger #43

Closed
@enumag

Description

@enumag

Symfony\Component\Messenger\Envelope::all() returns a different type based on whether or not an argument was passed to it. Currently PHPStan doesn't know that which results in errors like this:

Parameter #1 ... of method ... expects array<array<Symfony\Component\Messenger\Stamp\StampInterface>>, array<array<Symfony\Component\Messenger\Stamp\StampInterface>|Symfony\Component\Messenger\Stamp\StampInterface> given.

I'd send PR but I'm not sure how cases like these should be solved in PHPStan. If you can give me an advice how to do it, I'll send the PR.

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