8000 [Console] Doc Block: More intuitive usage example in ArrayInput. by mattjanssen · Pull Request #30319 · symfony/symfony · GitHub
[go: up one dir, main page]

Skip to content

Conversation

@mattjanssen
Copy link
Contributor
@mattjanssen mattjanssen commented Feb 20, 2019

Make the ArrayInput doc block example more self-explanatory and less misleading. Show the common use case of having command, and replace the confusing name argument with something more arbitrary.

Q A
Branch? 3.4
Bug fix? no
New feature? no
BC breaks? no
Deprecations? no
Tests pass? yes
Fixed tickets n/a
License MIT
Doc PR n/a

The current doc block example for ArrayInput seems to imply that the command name goes in as name, but this is actually just a random argument, named "name", in this case.

new ArrayInput(['name' => 'foo', '--bar' => 'foobar']);

It might be more helpful to provide an example that works with Symfony's Console component out of the box, as that is a common use case:

new ArrayInput(['command' => 'foo:bar', 'foo' => 'bar', '--bar' => 'foobar']);

Copy link
Member
@chalasr chalasr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For 3.4 I'd say.

@mattjanssen mattjanssen changed the base branch from master to 3.4 February 20, 2019 21:36
@mattjanssen mattjanssen changed the base branch from 3.4 to master February 20, 2019 21:37
Make the ArrayInput doc block example more self-explanatory and less misleading. Show the common use case of having `command`, and replace the confusing `name` argument with something more arbitrary.
@mattjanssen mattjanssen changed the base branch from master to 3.4 February 20, 2019 22:12
@fabpot
Copy link
Member
fabpot commented Feb 21, 2019

Thank you @mattjanssen.

@fabpot fabpot merged commit 0c8d311 into symfony:3.4 Feb 21, 2019
fabpot added a commit that referenced this pull request Feb 21, 2019
…ayInput. (mattjanssen)

This PR was merged into the 3.4 branch.

Discussion
----------

[Console] Doc Block: More intuitive usage example in ArrayInput.

Make the ArrayInput doc block example more self-explanatory and less misleading. Show the common use case of having `command`, and replace the confusing `name` argument with something more arbitrary.

| Q             | A
| ------------- | ---
| Branch?       | 3.4
| Bug fix?      | no
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | n/a
| License       | MIT
| Doc PR        | n/a

The current doc block example for `ArrayInput` seems to imply that the command name goes in as `name`, but this is actually just a random argument, named "name", in this case.
```php
new ArrayInput(['name' => 'foo', '--bar' => 'foobar']);
```

It might be more helpful to provide an example that works with Symfony's `Console` component out of the box, as that is a common use case:
```php
new ArrayInput(['command' => 'foo:bar', 'foo' => 'bar', '--bar' => 'foobar']);
```

Commits
-------

0c8d311 Update usage example in ArrayInput doc block.
@mattjanssen mattjanssen deleted the patch-1 branch February 21, 2019 08:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants

0