Skip to content

@require-extends not recognized for @throws #10475

@RobertMe

Description

@RobertMe

Bug report

Personally I would expect that if I have an interface with @phpstan-require-extends \Exception that I can use @throws <this interface> and it will work fine. This as it is known that every implementation of the interface will extend \Exception and thus is a throwable. But this isn't the case, and an error is reported that " is not subtype of Throwable"

Code snippet that reproduces the problem

https://phpstan.org/r/fe5464f1-7d2e-4570-a61f-c86b0a82b669

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

    Labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions