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

[9.x] Allow passing key/value arrays to getArguments and getOptions #42268

Merged

Conversation

jnoordsij
Copy link
Contributor

Allow passing key/value arrays to getArguments and getOptions on Artisan commands for a slightly easier interface.

@taylorotwell
Copy link
Member

Demonstration of the easier interface?

@jnoordsij
Copy link
Contributor Author

Basically the example in the test: you can pass an array with key/values in an arbitrary order you find convenient, without having to remember a specific order of arguments.

Also it is possible to skip those you don't want to use without providing/copying the default value, e.g. ['name' => 'argument', 'default' => 'default'] which previously would have been ['argument', null, '', 'default'].

@taylorotwell taylorotwell merged commit 57f7431 into laravel:9.x May 5, 2022
@jnoordsij jnoordsij deleted the allow-named-artisan-command-parameters branch May 5, 2022 14:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants