public function addArgument($name, $mode = null, $description = '', $default = null)
    {
        if (null === $mode) {
            $mode = self::OPTIONAL;
        } elseif (!is_int($mode) || $mode > 7 || $mode < 1) {
            throw new \InvalidArgumentException(sprintf('Argument mode "%s" is not valid.', $mode));
        }

        $this->arguments[] = [$name, $mode, $description, $default];
    }
public function addArgument($name, $mode = null, $description = '', $default = null)
    {
        if (null === $mode) {
            $mode = self::OPTIONAL;
        } elseif (!is_int($mode) || $mode > 7 || $mode < 1) {
            throw new \InvalidArgumentException(sprintf('Argument mode "%s" is not valid.', $mode));
        }

        $this->arguments[] = [$name, $mode, $description, $default];
    }
public function addArgument ( $ name , $ mode = null , $ description = '' , $ default = null ) { if ( null === $ mode ) { $ mode = self :: OPTIONAL ; } elseif ( ! is_int ( $ mode ) || $ mode > 7 || $ mode < 1 ) { throw new \ InvalidArgumentException ( sprintf ( 'Argument mode "%s" is not valid.' , $ mode ) ) ; } $ this -> arguments [ ] = [ $ name , $ mode , $ description , $ default ] ; }
Adds a new command argument.

@param string $name        The argument name
@param int    $mode        The argument mode: self::REQUIRED or self::OPTIONAL
@param string $description A description text
@param mixed  $default     The default value (for self::OPTIONAL mode only)

@throws \InvalidArgumentException When argument mode is not valid
Adds a new command argument .