-
-
Notifications
You must be signed in to change notification settings - Fork 5.2k
Closed
Description
If an option is expected to be boolean (as shown in the documentation: --yell), seen here , the statement about InputOption::VALUE_OPTIONAL
is misleading or wrong.
$input->getOption('yell') // always (!) returns NULL if no value is provided AND the third parameter from Command::addOption() is set to InputOption::VALUE_OPTIONAL
The documentation says about InputOption::VALUE_OPTIONAL
:
"This option may or may not have a value (e.g., --yell or --yell=loud)"
Right here is the problem, because if the option has no value, it will always return NULL - no boolean operation is possible. I suggest a clarification about the correct operation to Boolean options.