/** * Constructs a new CLI input. * * @param Option $option the option instance * @param string $longName the long name/ID of the CLI input * @param string $shortName an alternative short name (default: <code>''</code>) * @param string $name the input descriptive name (default: <code>''</code>) * @param string $description the input description (default: <code>''</code>) * @param int $type the data type - one of <code>Input::TYPE_STRING</code>, * <code>Input::TYPE_INT</code>, <code>Input::TYPE_BOOL</code>, <code>Input::TYPE_FLOAT</code>, * <code>Input::TYPE_SERIALIZED</code> (default: <code>Input::TYPE_STRING</code>) * @param multitype $default the default value or <code>null</code> for no default value * (default: <code>null</code>) * @param string $regex the regular expression to check against (default: <code>''</code>) * @param callable $check the check function to perform, must take one argument, which is the * value to check (default: <code>null</code>) * @see empire\framework\cli\Option */ public function __construct($option, $longName, $shortName = '', $name = '', $description = '', $type = self::TYPE_STRING, $default = null, $regex = '', Closure $check = null) { $this->option = $option; $this->shortName = $shortName; parent::__construct($longName, $name, $description, $type, $default, $regex, $check); }
/** * Adds an input. * * If an input with the same ID already exists, it will be overridden. This class should be * implemented called in the constructor of Task child classes. * * @param Input $input the input to add */ public function addInput(Input $input) { $this->inputs[$input->getID()] = $input; }