src/Request.php
public function getEnv($key = null, $default = null) {
        if ($key === null) {
            return $this->env;
        }
        return val(strtoupper($key), $this->env, $default);
    }
public function getEnv($key = null, $default = null) {
        if ($key === null) {
            return $this->env;
        }
        return val(strtoupper($key), $this->env, $default);
    }
Get a value from the environment or the entire environment.

@param string|null $key The key to get or null to get the entire environment.
@param mixed $default The default value if {@link $key} is not found.
@return mixed|array Returns the value at {@link $key}, {$link $default} or the entire environment array.
@see Request::setEnv()