src/Call/Arguments.php
public function set($indexOrValue = null, $value = null): self
    {
        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;
    }
public function set($indexOrValue = null, $value = null): self
    {
        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;
    }
public function set ( $ indexOrValue = null , $ value = null ) : self { 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 ; }
Set an argument by index.

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`.

@param mixed $indexOrValue The index, or value if no index is specified.
@param mixed $value        The value.

@return $this                      This arguments object.
@throws UndefinedArgumentException If the requested argument is undefined.
Set an argument by index .