Skip to content
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

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

Open
1 task done
david-binda opened this issue Mar 19, 2020 · 1 comment
Open
1 task done

Comments

@david-binda
Copy link

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.

@danielbachhuber
Copy link
Member

@david-binda Feel free to open a PR for this, if you'd like!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants