Skip to content

phpstan-this-out is not taken into account for fluent interfaces #8439

@stof

Description

@stof

Bug report

When a method is documented as having a fluent interface with @return $this and uses @param-this-out, the out type is not taken into account for the return value.

Code snippet that reproduces the problem

https://phpstan.org/r/dd0f11fe-7f22-49d4-bdbb-172337007753

Expected output

Both prophesize() and prophesize2() should report the same errors. But prophesize() currently reports an error on the return statement using the return value of the fluent API.

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

this new @param-this-out feature is really nice, allowing us to start adding generic types in Prophecy itself.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions