Skip to content

implicitThrows: false not affecting callables #9779

@janedbal

Description

@janedbal

Bug report

Following snippet with disabled implicit throws reports dead catch only for regular method call, not when callable is called. Config used:

includes:
    - phar://phpstan.phar/conf/config.levelmax.neon
    - phar://phpstan.phar/conf/bleedingEdge.neon

parameters:
    paths:
        - src
    exceptions:
        check:
            missingCheckedExceptionInThrows: true
            tooWideThrowType: true
        implicitThrows: false

Code snippet that reproduces the problem

https://phpstan.org/r/19789499-3a42-4ac7-9e81-deffde20bf48

Expected output

Behave the same way for both - error to be reported even on line 9.

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