public static function addOptions(InputDefinition $definition, array $fields, $description)
    {
        foreach ($fields as $field => $type) {
            $mode = 'array' === $type
                ? InputOption::VALUE_REQUIRED | InputOption::VALUE_IS_ARRAY
                : InputOption::VALUE_REQUIRED;

            if (!$definition->hasOption($field) && !$definition->hasArgument($field)) {
                $definition->addOption(new InputOption($field, null, $mode, sprintf($description, $field, $type)));
            }
        }
    }
public static function addOptions(InputDefinition $definition, array $fields, $description)
    {
        foreach ($fields as $field => $type) {
            $mode = 'array' === $type
                ? InputOption::VALUE_REQUIRED | InputOption::VALUE_IS_ARRAY
                : InputOption::VALUE_REQUIRED;

            if (!$definition->hasOption($field) && !$definition->hasArgument($field)) {
                $definition->addOption(new InputOption($field, null, $mode, sprintf($description, $field, $type)));
            }
        }
    }
public static function addOptions ( InputDefinition $ definition , array $ fields , $ description ) { foreach ( $ fields as $ field => $ type ) { $ mode = 'array' === $ type ? InputOption :: VALUE_REQUIRED | InputOption :: VALUE_IS_ARRAY : InputOption :: VALUE_REQUIRED ; if ( ! $ definition -> hasOption ( $ field ) && ! $ definition -> hasArgument ( $ field ) ) { $ definition -> addOption ( new InputOption ( $ field , null , $ mode , sprintf ( $ description , $ field , $ type ) ) ) ; } } }
Add options in input definition.

@param InputDefinition $definition  The input definition
@param array           $fields      The fields
@param string          $description The option description
Add options in input definition .