Skip to content

Add detection of default arguments to functions e.g. ! isset( $args[ 'numberposts' ] ) && get_posts( $args ) #2461

Closed

Description

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.

  • [?] I intend to create a pull request to implement this feature.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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