Eloquent\Phony\Call\Arguments::set PHP Method

set() public method

If called with no arguments, sets the first argument to null. If called with one argument, sets the first argument to $indexOrValue. If called with two arguments, sets the argument at $indexOrValue to $value.
public set ( mixed $indexOrValue = null, mixed $value = null )
$indexOrValue mixed The index, or value if no index is specified.
$value mixed The value.
    public function set($indexOrValue = null, $value = null)
    {
        if (func_num_args() > 1) {
            $index = $indexOrValue;
        } else {
            $index = 0;
            $normalized = 0;
            $value = $indexOrValue;
        }
        if (!$this->normalizeIndex($this->count, $index, $normalized)) {
            throw new UndefinedArgumentException($index);
        }
        $this->arguments[$normalized] = $value;
        return $this;
    }