Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add new IsInterfaceRule #250

Merged

Conversation

jesperbeisner
Copy link
Contributor

Hey everyone,

I would like to check that all classes in a specific namespace are interfaces. Something like this:

public function testAllClassesInNamespaceNeedToBeInterfaces(): Rule
{
    return PHPat::rule()
        ->classes(
            Selector::inNamespace('App\Interfaces'),
            Selector::inNamespace('Package\One\Interfaces'),
            Selector::inNamespace('Package\Two\Interfaces'),
        )
        ->shouldBeInterface();
    }

@jesperbeisner jesperbeisner force-pushed the feature/add-new-IsInterfaceRule branch 2 times, most recently from 758a771 to beb8e5c Compare November 29, 2023 14:26
@carlosas
Copy link
Owner

carlosas commented Dec 2, 2023

LGTM. I'm out until next weekend, when I come back I will merge it and release it 👍

@carlosas carlosas merged commit d282233 into carlosas:master Dec 23, 2023
12 checks passed
@carlosas
Copy link
Owner

Released with https://github.com/carlosas/phpat/releases/tag/0.10.12

@jesperbeisner
Copy link
Contributor Author

Thank you very much. My first open source contribution. 🥳

@carlosas
Copy link
Owner

Welcome! That was a good start! 🙂

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants