8000 Remove InputOption::VALUE_REQUIRED mode from $default parameter descr… · symfony/symfony@3c06151 · GitHub
[go: up one dir, main page]

Skip to content

Commit 3c06151

Browse files
tomasliubinasfabpot
authored andcommitted
Remove InputOption::VALUE_REQUIRED mode from $default parameter description as InputOption::setDefault() throws an exception only when called in InputOption::VALUE_NONE mode.
In practice the $default value could still be accessed in InputOption::VALUE_REQUIRED mode in case InputOption was never set but accessed from InputDefinition::getOption() method
1 parent d4ac467 commit 3c06151

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/Symfony/Component/Console/Command/Command.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -370,7 +370,7 @@ public function addArgument($name, $mode = null, $description = '', $default = n
370370
* @param string $shortcut The shortcut (can be null)
371371
* @param int $mode The option mode: One of the InputOption::VALUE_* constants
372372
* @param string $description A description text
373-
* @param mixed $default The default value (must be null for InputOption::VALUE_REQUIRED or InputOption::VALUE_NONE)
373+
* @param mixed $default The default value (must be null for InputOption::VALUE_NONE)
374374
*
375375
* @return Command The current instance
376376
*/

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ class InputOption
3636
* @param string|array $shortcut The shortcuts, can be null, a string of shortcuts delimited by | or an array of shortcuts
3737
* @param int $mode The option mode: One of the VALUE_* constants
3838
* @param string $description A description text
39-
* @param mixed $default The default value (must be null for self::VALUE_REQUIRED or self::VALUE_NONE)
39+
* @param mixed $default The default value (must be null for self::VALUE_NONE)
4040
*
4141
* @throws \InvalidArgumentException If option mode is invalid or incompatible
4242
*/

0 commit comments

Comments
 (0)
0