Skip to content

Inheritance issues with Implement and Extend #169

@benr77

Description

@benr77

Bug Report

Q A
BC Break no
Library Version 0.2.0
PHP version 8.0

Summary

Do the Extend and Implement classes handle multiple levels of inheritance?

E.g. I have this line, to pick up Symfony form types:

$formTypeClassNames = Rule::allClasses()
        ->that(new ResideInOneOfTheseNamespaces('App\UI\Form'))
        ->andThat(new Implement(FormTypeInterface::class))
        ->should(new HaveNameMatching('*Type'))
        ->because('we want uniform form type naming');

However, it's ignoring all these classes, because they extend AbstractType which in turn implements FormTypeInterface

Expected behavior

I would expect the check to consider interfaces implemented, or classes extended from, all the way up the inheritance tree.

Thanks

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