Skip to content

@return never on a stubbed trait method is not recognized #5233

@PHLAK

Description

@PHLAK

Bug report Feature Request

@return never on a stubbed trait method is not recognized.

Code snippet that reproduces the problem

Here's the code that generates an error.

https://phpstan.org/r/c8758900-a162-4aca-a397-b4d4adc39b48

And using the following stub.

trait Foo
{
    /** @return never */
    public function doNotReturn() {}
}

Expected output

No errors.

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

In general, yes.

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