Skip to content

Error when parent class and interface contradicts each other #7388

@canvural

Description

@canvural

Bug report

PHPStan fails to detect that method definitions differ when a class extends a parent class and implements an interface at the same time.

Code snippet that reproduces the problem

https://phpstan.org/r/d44386f4-7f54-4900-a0f2-eec7248b3760

Expected output

An error about ParentFoo having less parameters than the FooInterface (in the Foo class context)

Psalm detects it: https://psalm.dev/r/26e8a0f624
Runtime error: https://3v4l.org/GujnL

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

Yes!

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions