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
This commit is contained in:
parent
d4ac467462
commit
3c0615141e
@ -370,7 +370,7 @@ class Command
|
|||||||
* @param string $shortcut The shortcut (can be null)
|
* @param string $shortcut The shortcut (can be null)
|
||||||
* @param int $mode The option mode: One of the InputOption::VALUE_* constants
|
* @param int $mode The option mode: One of the InputOption::VALUE_* constants
|
||||||
* @param string $description A description text
|
* @param string $description A description text
|
||||||
* @param mixed $default The default value (must be null for InputOption::VALUE_REQUIRED or InputOption::VALUE_NONE)
|
* @param mixed $default The default value (must be null for InputOption::VALUE_NONE)
|
||||||
*
|
*
|
||||||
* @return Command The current instance
|
* @return Command The current instance
|
||||||
*/
|
*/
|
||||||
|
@ -36,7 +36,7 @@ class InputOption
|
|||||||
* @param string|array $shortcut The shortcuts, can be null, a string of shortcuts delimited by | or an array of shortcuts
|
* @param string|array $shortcut The shortcuts, can be null, a string of shortcuts delimited by | or an array of shortcuts
|
||||||
* @param int $mode The option mode: One of the VALUE_* constants
|
* @param int $mode The option mode: One of the VALUE_* constants
|
||||||
* @param string $description A description text
|
* @param string $description A description text
|
||||||
* @param mixed $default The default value (must be null for self::VALUE_REQUIRED or self::VALUE_NONE)
|
* @param mixed $default The default value (must be null for self::VALUE_NONE)
|
||||||
*
|
*
|
||||||
* @throws \InvalidArgumentException If option mode is invalid or incompatible
|
* @throws \InvalidArgumentException If option mode is invalid or incompatible
|
||||||
*/
|
*/
|
||||||
|
Reference in New Issue
Block a user