Skip to content

It isn't reporting when you return a variable that could be false #8223

@WossomGonzo

Description

@WossomGonzo

Bug report

If the signature of the function states that the return type is, for example, DateTimeImmutable and you returns DateTimeImmutable|false, phpstan didn't report it.

Code snippet that reproduces the problem

https://phpstan.org/r/5f6db730-672e-410b-9296-8bff29660974

Expected output

It should report an invalid variable type return.

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

PHPStan is the tool to keep your software in order and clean :-)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions