Skip to content

Invalid return type definition #10786

@yurybykov

Description

@yurybykov

Bug report

Invalid return type definition (check example), but all variables checks are present.
Found 1 error: "Method HelloWorld::sayHello() should return int but returns int|null."

Code snippet that reproduces the problem

https://phpstan.org/r/a66a0cf3-2a04-4b26-be2d-39c1953726a7

Expected output

No error.

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

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions