+
Skip to content

False only boolean type gets lost through a method with a template #6653

@mitelg

Description

@mitelg

Bug report

Hello there 👋

We have a method that gets all kind of values, and in it an event is dispatched. The return value is the same as the given parameter. It works totally fine, but with one exception, if the passed value is type of array|false. The return type is then array|bool which is not correct. See the prepared example

Code snippet that reproduces the problem

https://phpstan.org/r/a057351b-dec7-449b-b8fb-86e921e2cac6

Expected output

No issue should appear

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

We are using PHPStan on a heavy legacy code base and with its help, the code gets more stable every day, thanks for that!

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      点击 这是indexloc提供的php浏览器服务,不要输入任何密码和下载