-
-
Notifications
You must be signed in to change notification settings - Fork 483
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 detection of default arguments to functions e.g. ! isset( $args[ 'numberposts' ] ) && get_posts( $args ) #2461
Comments
@claimableperch Thanks for opening this issue, but it is completely unclear to me what you are suggesting. On the one hand you talk about "your" code (post retrieval ... made it to production), on the other hand you talk about an abstract sniff, without it being clear what you expect to happen. And the "subject" of the issue mentioning some code pattern without any context, also doesn't help. Let's take a step back:
|
Marking this as close candidate as without more information, this ticket is not actionable. |
Add detection of default arguments to functionse.g. When I guess I was just wishing that It's really more an IDE-completion sort of thing. But unless you filter them all, it also isn't. Real question is why I posted it to this repository. So I guess it's all too real. |
Is your feature request related to a problem?
Post retrieval limited to 5 posts made its way into production briefly.
Describe the solution you'd like
AbstractFunctionRestrictionSniff to make a call to [ static::class, 'defaulted_callback' ] in the case of that function being defined in sub-classes, making it simple to construct sniffs which warn of certain default arguments - such as 'numberposts' in PostsPerPageSniff.
The text was updated successfully, but these errors were encountered: