-
-
Notifications
You must be signed in to change notification settings - Fork 17
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 disallowedMethodCalls.allowCount
to allow method calls N times
#87
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey, thanks for the PR. It looks cool and clean, I like it, good job :-)
If you could change just one more detail and maybe add documentation to README?
Updated the readme. Please suggest changes if you want. |
Add `disallowedMethodCalls.allowCount` to allow method calls N times
Thanks, good job! I've just merged it and released 1.10.0. |
Forgot to add this in spaze#87 Fixes: ``` Invalid configuration: The option 'parameters › disallowedMethodCalls › 2 › allowCount' expects to be string|list|array, 1 given. ```
I made a small error in my thinking while working on this PR. This works fine: parameters:
disallowedMethodCalls:
-
method: 'Generated\MyNamedQuery::execute*()'
message: 'do not reuse GraphQL queries.'
allowCount: 1 It will only allow one call to But I want to go to a situation where I have 1 rule generic rule
and it should track it's usages by FQCN instead of by rule. For example, I have 2 generated classes:
With the current setup, it tracks its usage on the rule and therefore blocks the second call to a separate class. |
To solve that, I would suggest to scope the Do you think that makes sense? So wildcard on method does count, but wildcard on class name does not count. Since the feature is not working (see #88) I don't think it's a breaking change. |
Hey, yeah, usually making things work with other things is the hardest part :-)
I think this is probably the only option we're left with. It would be cool if this can be checked run-time so that |
FYI, I have moved the new FQCN-related issue to #89 |
Close #86