Skip to content

too wide bool in trivial methods #13482

@staabm

Description

@staabm

Bug report

in config objects/feature flag methods we sometimes use plain return true/false in code which will be swap from time to time.

its annoying that PHPStan now reports a too wide bool error:

Method HelloWorld::isMandatory() never returns false so the return type can be changed to true.

Code snippet that reproduces the problem

https://phpstan.org/r/f27b0a2e-1715-4052-85a8-add9422657b4

Expected output

maybe we should make the rule ignore these trivial methods?

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

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions