Skip to content

Optional callable parameters are not enforced #7320

@5lava

Description

@5lava

Bug report

PHPStan does not enforce callable parameters to be optional to match the expected callable signature declared in PHPDoc.

Code snippet that reproduces the problem

https://phpstan.org/r/6323d45a-fbf0-4f3a-a150-e7ce34fb39d1

Expected output

Parameter #1 $c of function foo expects callable(int=): void, Closure(int): void given.

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

You make the world a better place.

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