Add an argument to the args array.

@param string $value The argument to add.
@param string|null $index The index to add the arg at.
@return $this
424410
public function addArg($value, $index = null) {
        if ($index !== null) {
            $this->args[$index] = $value;
        } else {
            $this->args[] = $value;
        }
        return $this;
    }
1048685
public function add($element, $index = null) {
		if ($index === null) {
			$this->collection[$this->size()] = $element;
		} else {
			array_splice($this->collection, $index, 0, $element);
		}
		
		return $this;
	}
815195
def add_value(self, value, index_point):
        """"""
        if index_point not in self.index:
            self.values.append(value)
            self.index.append(index_point)
467495
private function addOption($string, $value)
    {
        foreach ($this->optionList as $option) {
            if ($option->matches($string)) {
                if ($option->mode() == Getopt::IS_FLAG) {
                    if (is_null($value)) {
                        $value = isset($this->options[$string]) ?
                            !$this->options[$string]->getValue() :
                ($option->getArgument()->hasDefaultValue() ?
                            !$option->getArgument()->getDefaultValue() : true);
                    }
                } else {
                    if ($option->mode() == Getopt::REQUIRED_ARGUMENT && !mb_strlen($value)) {
                        throw new \UnexpectedValueException("Option '$string' must have a value");
                    }
                    if ($option->getArgument()->hasValidation()) {
                        if ((mb_strlen($value) > 0) && !$option->getArgument()->validates($value)) {
                            throw new \UnexpectedValueException("Option '$string' has an invalid value");
                        }
                    }
                // for no-argument options, check if they are duplicate
                if ($option->mode() == Getopt::NO_ARGUMENT) {
                    $oldValue = isset($this->options[$string]) ?
                        $this->options[$string]->getValue() : null;
                    $value = is_null($oldValue) ? 1 : $oldValue + 1;
                }
                // for optional-argument options, set value to 1 if none was given
                $value = (mb_strlen($value) > 0) ? $value : 1;
                }
                // add both long and short names (if they exist) to the option array to facilitate lookup
                if ($option->short()) {
                    $this->options[$option->short()] = new Value($value);
                }
                if ($option->long()) {
                    $this->options[$option->long()] = new Value($value);
                }

                return;
            }
        }
        throw new \UnexpectedValueException("Option '$string' is unknown");
    }
472937
public function addConstructorValue($value)
    {
        $endPoint = &$this->getEndPoint();
        if (!isset($endPoint['args'])) {
            $endPoint['args'] = [];
        }
        $endPoint['args'][] = ['type' => 'value', 'item' => $value];

        return $this;
    }
1183397
public function getArg($index = 0, $default = null)
    {
        return isset($this->args[$index]) ? $this->args[$index] : $default;
    }
136578
public function args(\stdClass $value = null)
    {
        if (null === $value) {
            return $this->args;
        }
        $this->args = $value;
        return $this;
    }
1078228
public function withHalved($index, $value)
    {
        $res = clone $this;

        $res->halved = $this->insertInList($res->halved, $index, $value);

        return $res;
    }
666671
protected function setArg($key, $value) {
            if ($value !== null) {
                $this->args[$key] = $value;
            }

            return $this;
        }
1320241
public function push($x, $y, $index = 0)
    {
        if (!isset($this->values[$index])) {
            $this->values[$index] = array();
        }

        $this->values[$index][] = array($x, $y);

        return $this;
    }
423983
public function setFlash($value, $index = null)
    {
        if ( ! $this->isOpened()) {
            $this->start();
        }
        if (!empty($index)) {
            $this->flashes[$index] = $value;
        } else {
            $this->flashes[] = $value;
        }
        return $this;
    }
2977
public function set($index, $value) : Vector
    {
        $values = $this->_set($index, $value, true);
        $this->setValues($values);
        return $this;
    }
391396
public function add($value): SetInterface
    {
        $this->resolver->value(function ($value): void {
            $this->items->add($value);
        }, $value);

        return $this;
    }
782213
public function addMethodMetadata($method, $index, $value)
    {
        if (!isset($this->methodMetadata[$method])) {
            $this->methodMetadata[$method] = array($index => $value);
        } else {
            $this->methodMetadata[$method][$index] = $value;
        }

        return $this;
    }
681257
public function insert($index, $value)
    {
        $count = $this->count();

        if ($index == $count) {
            return $this->append($value);
        }

        if ($index < 0) {
            throw new OutOfRangeException("Index have to be greater than 0 not $index");
        }

        if ($index > $count) {
            throw new OutOfRangeException("Index $index overflows greatest index $count");
        }

        array_splice($this->source, $index, 0, $value);

        return $this;
    }
957613
public function group($value = null)
    {
        if (func_num_args()) {
            $this->group = $value;
            return $this;
        }
        return $this->group;
    }
1028419
public function add_param($param, $value = null)
	{
		if ( ! is_array($param))
		{
			$param = array($param => $value);
		}

		foreach ($param as $key => $val)
		{
			\Arr::set($this->params, $key, $val);
		}
		return $this;
	}