-
-
Notifications
You must be signed in to change notification settings - Fork 40
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 HaveMethod expression #226
Comments
I think this is a useful addition. Would you elaborate a bit more about how is it supposed to work? In particular:
|
Regarding your questions:
|
I am not sure we capture inherited methods in ClassDescription objects but we can probably discuss the implementation later For consistency we should also have a NotHaveMethod Good to go for me |
At the moment we don't have a mechanism to check stuff on class implementation because we were focused on rules for dependencies. |
That's a good point with As for generic methods, shouldn't developer cover this with interfaces? Maybe only magic method expression? |
Would love to see this feature coming! One of my use case would be to check for "valid" method names on a controller. Valid according to this list of actions: https://laravel.com/docs/9.x/controllers#actions-handled-by-resource-controller Example: Rule::allClasses()
->that(new ResideInOneOfTheseNamespaces('App\Http\Controllers'))
->should(new HaveMethod(['index', 'create', 'store', 'show'...]))
->because('something'); |
Feature Request
Summary
I would like to enforce this constraint:
ATM we don't have any mechanism to check stuff on class implementation, isn't it?
The text was updated successfully, but these errors were encountered: