Get value from environment.

@param string $key
@param mixed  $defaultValue

@return mixed
773816
public function get($key, $defaultValue = null)
    {
        $rawValue = $this->getEnvironmentVariable($key);

        return $this->getValue($rawValue, $defaultValue);
    }
107140
public function read(string $key, $defaultValue = null)
    {
        return isset($_SESSION[$key]) ? $_SESSION[$key] : $defaultValue;
    }
140882
public function get($key, $default = null)
    {
        $keys = explode('.', $key);
        $value = $default;
        foreach ( $keys as $i => $_key ) {
            if ( ! $i && isset($this->_params[$_key]) ) {
                $value = $this->_params[$_key];
            } elseif ( is_array($value) && isset($value[$_key]) ) {
                $value = $value[$_key];
            } else {
                $value = $default;
                break;
            }
        }
        return $value;
    }
617491
public static function get(string $key, $defaultValue = null, string $storage = 'global')
    {
        if (!self::has($key)) {
            return $defaultValue;
        }

        // Get content.
        $fileKey = self::key($key);
        $content = null;
        if (file_exists(self::$path . '/' . $storage . '/' . $fileKey)) {
            $content = file_get_contents(self::$path . '/' . $storage . '/' . $fileKey);
        }

        // Extract expiration.
        $markerPos = strpos($content, self::$marker);
        $expiration = null;
        if ($markerPos !== false) {
            $expiration = substr($content, 0, $markerPos);
        }

        // Extract content.
        if ($expiration < time()) {
            self::forget($key);
        } else {
            return unserialize(substr($content, $markerPos + strlen(self::$marker)));
        }

        return $defaultValue;
    }
658272
public function get(string $key, $default = null)
    {
        return ($value = $this->offsetGet($key)) === null ? $default : $value;
    }
10005
public function getProperty($key, $defaultValue = null)
    {
        if (empty($this->properties[$key])) {
            return $defaultValue;
        }

        return $this->properties[$key];
    }
318467
protected function env($name, $defaultValue = null)
    {
        $value = getenv($name);

        if (null === $value || false === $value) {
            return $defaultValue;
        }

        return $value;
    }
807665
public static function getConfigured($key, $default = null)
    {
        $instance = static::instance();

        $value = $instance->get($key);

        $defaultValue = $instance->getDefaultValue($key);

        return $value != $defaultValue ? $value : $default;
    }
1038159
public function getValue($key, $default = null)
    {
        if (is_array($this->kwargs) && isset($this->kwargs[$key])) {
            return $this->kwargs[$key];
        }
        return $default; // @codeCoverageIgnore
    }
538101
public function getOptional($key, $defaultValue = null)
  {
    if (array_key_exists($key, $this->data)) {
      return $this->data[$key];
    }
    return $defaultValue;
  }
985581
public function get($key, $defaultValue = null)
    {
        if ($this->has($key)) {
            return $this->attributes[$key];
        }

        return $defaultValue;
    }
402380
private function getParameter($values, $key, $defaultValue = null)
    {
        return array_key_exists($key, $values) ? $values[$key] : $defaultValue;
    }
1033872
public function get($key, $defaultValue = array())
    {
        $this->populateFlash($key);

        if ($this->has($key)) {
            return $this->data[$key];
        }

        return $defaultValue;
    }
1277182
public static function get($key, $default = null)
    {
        $value = getenv(Str::upper($key));

        if (is_string($value)) {
            return $value;
        }

        return isset(static::$env[$key]) ? static::$env[$key] : $default;
    }
555210
public function optionalItem($key, $defaultValue = null)
    {
        if (!$this->hasItem($key)) {
            return $defaultValue;
        }

        return $this->getItem($key);
    }
537777
public function getValue(string $key, $defaultValue = null)
    {
        if ($this->offsetExists($key)) {
            return $this->offsetGet($key);
        } else {
            return $defaultValue;
        }
    }
1165367
public function getValue($defaultValue = null)
    {
        if ($this->read === false) {
            if (isset($_COOKIE[$this->name])) {
                if ($this->useEncryption === true) {
                    return $this->value = $this->decrypt($_COOKIE[$this->name]);
                }

                return $this->value = $_COOKIE[$this->name];
            }

            return $defaultValue;
        }

        return $this->value;
    }