Skip to content

Abstract methods declared by traits and implemented by parent classes shouldn't raise errors #3406

@Slamdunk

Description

@Slamdunk

Bug report

Abstract methods declared by traits and implemented by parent classes shouldn't raise errors, at least not on Level 0.

Code snippet that reproduces the problem

abstract class AbstractFoo {
	public function myFoo(): void {}
}
trait TraitFoo {
	abstract public function myFoo(): void;
}
final class ClassFoo extends AbstractFoo {
	use TraitFoo;
}

https://phpstan.org/r/12ccc2ea-b367-471b-9da9-7efd57b012a4

Expected output

No errors, at least not on Level 0, as this is valid code: https://3v4l.org/BOAEE

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions