option opcje jako tablica w comandzie symfony

        ->addOption(
                self::OPTION_STATUS_TYPES,
                'st',
                InputOption::VALUE_OPTIONAL | InputOption::VALUE_IS_ARRAY,
                'Allowed status types separated by comma i.e. <info>--statusTypes=1,2,3</info> 1 - initial, 2 - normal, 3 - final',
                ''
            )
php symfony test:myTask --typical-days=7 --typical-days=5 --typical-days=8

LUB

          ->addOption(
                self::OPTION_STATUS_TYPES,
                'st',
                InputOption::VALUE_OPTIONAL,
                'Allowed status types separated by comma i.e. <info>--statusTypes=1,2,3</info> 1 - initial, 2 - normal, 3 - final',
                ''
            )
$statusTypes = array_filter(array_map('intval', explode(',', $input->getOption(self::OPTION_STATUS_TYPES))));
Komentarze wyłączone