Get as bool value

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

@return bool|NULL
345268
public  function getBoolean( $key, bool $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 boolval($value);
    }
772879
public function get($key, $default_value = null)
        {
            if (!$this->enabled) return $default_value;

            switch ($this->type) {
                case self::TYPE_APC:
                    $success = false;
                    $var = apc_fetch($key, $success);

                    return ($success) ? $var : $default_value;
                case self::TYPE_FILE:
                    $filename = $this->path . $key . '.cache';
                    if (!file_exists($filename)) return $default_value;

                    $value = unserialize(file_get_contents($filename));
                    return $value;
                case self::TYPE_DUMMY:
                default:
                    return $default_value;
            }
        }
1347732
public function get($property, $default_value = null)
    {
        if (property_exists($this, $property)) {
            return $this->$property;
        }

        return $default_value;
    }
1044462
public function get($key, $default = null)
	{
        $value = $this->settings;
        $value = set_nested_array_value($value, $key);

        if ( ! is_null($value))
        {
            return $value;
        }

        return $default;
	}
239798
final protected function getBooleanValue(string $key, bool $default = false): bool
    {
        $value = $this->getConfigValue($key);
        if (!$value) {
            return $default;
        }

        return \boolval($value);
    }
466891
public function get($key, $default = false)
    {
        $this->initializeOnDemand();

        if ($this->has($key)) {
            return $this->cache[$key][ConstProviderInterface::CACHE_PARAM_VALUE];
        } else {
            return $default;
        }
    }
952199
public static boolean getBoolean(String key, boolean defaultValue) {
		String value = get(key);
		if (value == null) {
			return defaultValue;
		}

		value = value.trim().toLowerCase();
		if (value.isEmpty()) {
			return true;
		}

		if ("true".equals(value) || "yes".equals(value) || "1".equals(value)) {
			return true;
		}

		if ("false".equals(value) || "no".equals(value) || "0".equals(value)) {
			return false;
		}

		return defaultValue;
	}
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;
  }
953380
public function getSession($key, $default_val = null)
    {

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

        return $default_val;
    }
1002396
function get($key, $default = null)
    {
        $index = array_search($key, $this->keys);

        if ($index !== false) {
            return $this->values[$index];
        } else {
            return $default;
        }
    }
484224
public function get($key, $default_val = null)
    {
        $key = $this->normalizeKey($key);

        return parent::get($key, $default_val);
    }
329215
public function get($key, $default = NULL) {
    $value = parent::get($key);

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

    return $default;
  }
1000185
public function get(string $key, $default = null)
    {
        if ($this->has($key)) {
            return parent::get($key)['value'];
        }

        return $default;
    }
278116
public static function get($key, $default = null)
    {
        return isset(self::$variables[$key]) ? self::$variables[$key] : $default;
    }
734168
public  function getHashMap($key, array $default_value = NULL)
    {
        $value = $this->getPropertyNodeValue( $key );

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

        return new HashMap($value);
    }
693716
public boolean getBoolean(String key, boolean defaultValue) {
    String value = get(key);
    // We can't use `Boolean.parseBoolean` here, as it returns false for invalid strings.
    if (value == null) {
      return defaultValue;
    } else if (value.equalsIgnoreCase("true")) {
      return true;
    } else if (value.equalsIgnoreCase("false")) {
      return false;
    } else {
      throw new IllegalArgumentException(value + " is not a boolean string.");
    }
  }
537777
public function getValue(string $key, $defaultValue = null)
    {
        if ($this->offsetExists($key)) {
            return $this->offsetGet($key);
        } else {
            return $defaultValue;
        }
    }