Skip to content

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

Merged
taylorotwell merged 1 commit intolaravel:9.xfrom
jnoordsij:allow-named-artisan-command-parameters
May 5, 2022
Merged

[9.x] Allow passing key/value arrays to getArguments and getOptions#42268
taylorotwell merged 1 commit intolaravel:9.xfrom
jnoordsij:allow-named-artisan-command-parameters

Conversation

@jnoordsij
Copy link
Copy Markdown
Contributor

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

@taylorotwell
Copy link
Copy Markdown
Member

Demonstration of the easier interface?

@jnoordsij
Copy link
Copy Markdown
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