Closed
Description
Hi,
The following example in http://symfony.com/doc/current/components/console/introduction.html
->addOption(
'iterations',
null,
InputOption::VALUE_REQUIRED | InputOption::VALUE_IS_ARRAY,
'How many times should the message be printed?',
1
);
triggers the following exceptions:
PHP Fatal error: Uncaught exception 'LogicException' with message 'A default value for an array option must be an array.' in ..Console/vendor/symfony/console/Symfony/Component/Console/Input/InputOption.php:169
Stack trace:
#0 Console/vendor/symfony/console/Symfony/Component/Console/Input/InputOption.php(89): Symfony\Component\Console\Input\InputOption->setDefault(1)
#1 Console/vendor/symfony/console/Symfony/Component/Console/Command/Command.php(395): Symfony\Component\Console\Input\InputOption->__construct('iterations', NULL, 10, 'How many times ...', 1)
#2 Console/Acme/Console/Command/GreetCommand.php(43): Symfony\Component\Console\Command\Command->addOption('iterations', NULL, 10, 'How many times ...', 1)
#3 Console/vendor/symfony/console/Symfony/Component/Console/Command/Command.php(6 in Console/vendor/symfony/console/Symfony/Component/Console/Input/InputOption.php on line 169