public function set($key, $values, $replace = true)
    {
        if(!is_string($key) && !is_int($key)){
            throw new \InvalidArgumentException('$key expected to be string, got:'.gettype($key));
        }

        if( !is_string($values) && !is_array($values) ){
            throw new \InvalidArgumentException('$key expected to be string or array, got: '.gettype($key));
        }

        $values = array_values((array)$values);

        if (true === $replace || !isset($this->container[$key])) {
            $this->container[$key] = $values;
        } else {
            $this->container[$key] = array_merge($this->container[$key], $values);
        }
    }
public function set($key, $values, $replace = true)
    {
        if(!is_string($key) && !is_int($key)){
            throw new \InvalidArgumentException('$key expected to be string, got:'.gettype($key));
        }

        if( !is_string($values) && !is_array($values) ){
            throw new \InvalidArgumentException('$key expected to be string or array, got: '.gettype($key));
        }

        $values = array_values((array)$values);

        if (true === $replace || !isset($this->container[$key])) {
            $this->container[$key] = $values;
        } else {
            $this->container[$key] = array_merge($this->container[$key], $values);
        }
    }
public function set ( $ key , $ values , $ replace = true ) { if ( ! is_string ( $ key ) && ! is_int ( $ key ) ) { throw new \ InvalidArgumentException ( '$key expected to be string, got:' . gettype ( $ key ) ) ; } if ( ! is_string ( $ values ) && ! is_array ( $ values ) ) { throw new \ InvalidArgumentException ( '$key expected to be string or array, got: ' . gettype ( $ key ) ) ; } $ values = array_values ( ( array ) $ values ) ; if ( true === $ replace || ! isset ( $ this -> container [ $ key ] ) ) { $ this -> container [ $ key ] = $ values ; } else { $ this -> container [ $ key ] = array_merge ( $ this -> container [ $ key ] , $ values ) ; } }
Sets a email values.

@param string|int   $key     The key
@param string|array $values  The value or an array of values
@param Boolean      $replace Whether to replace the actual value or not (true by default)
Sets a email values .