Skip to content

Remove unused variable $new_assoc_args in wp rewrite structure subcommand #40

@david-binda

Description

@david-binda

Feature Request

Describe your use case and the problem you are facing

I have been reviewing the code of the wp rewrite structure command and have run into unused $new_assoc_args variable , which looks like a residuum after past code updates:

$new_assoc_args = [];

The variable was introduced in 3be1d98 where \WP_CLI::launch_wpcli was used for launching the flush command.

But it was later changed to WP_CLI::runcommand ( in bf6c7c0 ) which does not accept the assoc args param, and the --hard flag is being appended to the $cmd.

Keeping the $new_assoc_args variable in place makes the code less readable.

Describe the solution you'd like

Removing the $new_assoc_args variable definition and the only other usage in the code, as the variable is never really used:

$new_assoc_args = [];

$new_assoc_args['hard'] = true;

I'm happy to open a pull request, if we agree that this issue is valid.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions