Skip to content

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