public function setEnv($key, $value = null) {
        if (is_string($key)) {
            $this->env[strtoupper($key)] = $value;
        } elseif (is_array($key)) {
            $this->env = $key;
        } else {
            throw new \InvalidArgumentException("Argument 1 must be either a string or array.", 422);
        }
        return $this;
    }
public function setEnv($key, $value = null) {
        if (is_string($key)) {
            $this->env[strtoupper($key)] = $value;
        } elseif (is_array($key)) {
            $this->env = $key;
        } else {
            throw new \InvalidArgumentException("Argument 1 must be either a string or array.", 422);
        }
        return $this;
    }
public function setEnv ( $ key , $ value = null ) { if ( is_string ( $ key ) ) { $ this -> env [ strtoupper ( $ key ) ] = $ value ; } elseif ( is_array ( $ key ) ) { $ this -> env = $ key ; } else { throw new \ InvalidArgumentException ( "Argument 1 must be either a string or array." , 422 ) ; } return $ this ; }
Set a value from the environment or the entire environment.

@param string|array $key The key to set or an array to set the entire environment.
@param mixed $value The value to set.
@return Request Returns $this for fluent calls.
@throws \InvalidArgumentException Throws an exception when {@link $key} is invalid.
@see Request::getEnv()
Set a value from the environment or the entire environment .