8000 minor #30319 [Console] Doc Block: More intuitive usage example in Arr… · symfony/symfony@eb7a612 · GitHub
[go: up one dir, main page]

Skip to content
8000

Commit eb7a612

Browse files
committed
minor #30319 [Console] Doc Block: More intuitive usage example in ArrayInput. (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.
2 parents a67441a + 0c8d311 commit eb7a612

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/Symfony/Component/Console/Input/ArrayInput.php

Lines changed: 1 addition & 1 deletion
72CA
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
*
2020
* Usage:
2121
*
22-
* $input = new ArrayInput(['name' => 'foo', '--bar' => 'foobar']);
22+
* $input = new ArrayInput(['command' => 'foo:bar', 'foo' => 'bar', '--bar' => 'foobar']);
2323
*
2424
* @author Fabien Potencier <fabien@symfony.com>
2525
*/

0 commit comments

Comments
 (0)
0