Get as string value

@param string $key             key string for hash map
@param string $default_value   default value

@return string|NULL
19846
public function getString( string $key, string $default_value = NULL )
    {
        $value = $this->getPropertyNodeValue( $key );

        // return default value if the element is null
        if ( NULL === $value ){
            return NULL === $default_value ? NULL : $default_value;
        }

        return strval($value);
    }
1247352
@SuppressWarnings("null")
	public static String value(String key, String defaultValue) {
		return System.getProperty(key, defaultValue);
	}
514138
public function getParameter($key, $default = null) {
        $value = $this->getUrl()->getQuery()->get($key);

        if ($value === null) {
            $value = $this->getData()->get($key, $default);
        }

        return $value;
    }
1085913
protected function _get_string_value( $key ) {
		if ( ! isset( $this->types[ $key ] ) || 'string' !== $this->types[ $key ] ) {
			return null;
		}

		$default = array_key_exists( $key, $this->defaults ) ? $this->defaults[ $key ] : '';

		return trim( (string) $this->store->get( $key, $default ) );
	}
656646
public function get($key, $default = null) {
        if (strpos($key, '.') === false) {
            $value = isset($this->_data[$key]) ? $this->_data[$key] : null;
        } else {
            $value = Hash::get($this->_data, $key);
        }

        if ($value === null) {
            return $default;
        }

        return $value;
    }
770044
public function getParameter($key, $default_value = NULL) {
    if (isset($this->params[$key])) {
      return $this->params[$key];
    }

    $defaults = $this->sandbox()
      ->getPolicy()
      ->getParameterDefaults();

    if (isset($defaults[$key])) {
      $default_value = $defaults[$key];
    }

    // Ensure default values are recorded for use as tokens.
    $this->setParameter($key, $default_value);
    return $default_value;
  }
452554
public function get($key, $default_value = null)
    {
        if (strpos($key, '.') !== false) {
            $setting = $this->getSubValue($key);
        } else {
            if ($this->hasByKey($key)) {
                $setting = $this->getByKey($key);
            } else {
                $setting = $default_value;
            }
        }
        $this->resetLang();

        if (is_null($setting)) {
            $setting = $default_value;
        }

        return $setting;
    }
31322
public function get($key, $default = null)
    {
        try {
            $value = $this->find($key);

            return is_string($value) ? $this->replace($value) : $value;
        } catch (\Exception $exception) {
            return $default;
        }
    }
953380
public function getSession($key, $default_val = null)
    {

        if (isset($_SESSION[$key])) {
            return $_SESSION[$key];
        }

        return $default_val;
    }
724222
public function value($key, $default = null)
    {
        return array_key_exists($key, $this->values)
            ? $this->values[$key]
            : $default;
    }
948471
public static function getStr(string $key, ?string $default = null): ?string
    {
        $value = ini_get($key);

        return $value === false || $value === '' ? $default : $value;
    }
793172
public static function getSessionValue($key, $default=null) {
		if(!isset($_SESSION)){
			session_start();
		}
		return (isset($_SESSION[$key]) ? $_SESSION[$key] : $default);
	}
1068350
public function getInt($key, $default = 0, $hash = 'input')
	{
		$str = $this->getVar($key, $default, $hash);
		$str = is_array($str) ? implode('', $str) : $str;
		preg_match('/-?[0-9]+/', $str, $matches);
		$result = @ $matches[0];
		return (!is_null($result) ? (int) $result : $default);
	}
789407
public function get($key, $defaultValue = null)
    {
        if (!isset($this->keyToIndexMap[$key]) && 2 === func_num_args()) {
            return $defaultValue;
        }

        return $this->value($key);
    }
1061446
public function get($key = null, $default = null)
    {
        if ($this->has($key)) {
            return $this->getValueAtKey($key, $this->payload());
        }
        return $default;
    }
680970
def to_string_with_default(value, default_value):
        
        result = StringConverter.to_nullable_string(value)
        return result if result != None else default_value
1349250
public function getParam($key, $default = null)
        {
            $key = (string) $key;
            if (isset($this->_params[$key])) {
                return $this->_params[$key];
            }

            return $default;
        }