Validate if given input is boolean.

@param $key
@return bool
162905
protected function isBool($key) : bool
    {
        $allowed = [true, false, 0, 1, '0', '1'];

        if (isset($this->param[$key]) && in_array(strtolower($this->param[$key]), $allowed, true)) {
            return true;
        }

        $this->errors[$key.self::ERROR] = $this->convertToFieldName($key).' must be boolean.';

        return false;
    }
4839
public function __isset($key)
	{
		if (isset($this->$key) && (!is_null($this->$key))) {
			return true;
		}
		if (!isset($this->specificationExtensions[$key])) {
			return false;
		}
		return !is_null($this->specificationExtensions[$key]);
	}
106725
public function validateId($key): bool
    {
        if (\preg_match('/^[a-zA-Z0-9-]{127}+$/', $key) !== 1) {
            return false;
        }

        $sql = 'SELECT COUNT(id) FROM sessions WHERE id=:id';
        $params = ['id' => $key];
        $count = $this->db->count($sql, $params);

        return $count === 1;
    }
905121
protected function _validateOption($key)
    {
        switch ($key) {
            case self::OPTION_SEARCH_TYPE:
            case self::OPTION_ROUTING:
            case self::OPTION_PREFERENCE:
            case self::OPTION_VERSION:
            case self::OPTION_TIMEOUT:
            case self::OPTION_FROM:
            case self::OPTION_SIZE:
            case self::OPTION_SCROLL:
            case self::OPTION_SCROLL_ID:
            case self::OPTION_SEARCH_TYPE_SUGGEST:
            case self::OPTION_SEARCH_IGNORE_UNAVAILABLE:
            case self::OPTION_QUERY_CACHE:
            case self::OPTION_TERMINATE_AFTER:
            case self::OPTION_SHARD_REQUEST_CACHE:
            case self::OPTION_FILTER_PATH:
            case self::OPTION_TYPED_KEYS:
                return true;
        }

        throw new InvalidException('Invalid option '.$key);
    }
810038
public static function getBoolean($key) {
		$ret = false;
		if (isset ( $_REQUEST [$key] )) {
			$ret = UString::isBooleanTrue ( $_REQUEST [$key] );
		}
		return $ret;
	}
863193
protected function validateForbidden($input, $key)
    {
        $flat = NestedArray::flat($input);
        return !array_key_exists($key, $flat);
    }
62067
public function __isset($key)
    {
        $format = $this->validateFormat($key);

        if (!$format) {
            list($op, $format) = $this->validateDiff($key);
        }

        return (bool) $format;
    }
1137923
public function is(string $key): bool
    {
        return isset($this->meta[$key]) && (bool)$this->meta[$key];
    }
1075553
public function has($key): bool
    {
        $this->checkKey($key);
        return (bool) $this->getRedis()->keys($this->filterKey($key));
    }
544432
public function isValid(string $key) : bool
    {
        if (!$this->headers->has($this->algorithmHeader)) {
            return false;
        }

        if (!$this->headers->has($this->signatureHeader)) {
            return false;
        }

        $signature = new Signature(new Payload($this->request), $this->getAlgorithm(), $key);

        return $signature->equals($this->getSignature());
    }
1281719
public function setSubmittedBool($key)
    {
        $bool = (bool) $this->getSubmitted($key);
        $this->setSubmitted($key, $bool);
        return $bool;
    }
1193634
public static function issetValue(string $key): bool
    {
        $key = \mb_strtolower($key);
        return isset(self::$_data[$key]);
    }
1257464
public function hasVal($key) {
        return isset($this->field[$key]) || (is_array($this->field) && array_key_exists($key, $this->field));
    }
720766
public function has($key)
    {
        // For performance, we can use isset,
        // but it will not match if value == 0
        return isset($this->values[$key]) || array_key_exists($key, $this->values);
    }
224072
public function isValid($key)
    {
        if (! isset ($this['sso'], $this['sig'])) {
            return false;
        }

        return $this['sig'] === Secret::create($key)->sign($this['sso']);
    }
854266
public function isCheckbox($key)
    {
        $fieldMeta = $this->getMeta();
        return isset($fieldMeta[$key]) && $fieldMeta[$key]->type === 'checkbox';
    }
520839
public function checkLanguage(string $key): bool
    {
        $locale = $this->getOption('locale', []);

        if (array_key_exists($key, Arr::wrap($locale))) {
            return filter_var($locale[$key], FILTER_VALIDATE_BOOLEAN);
        }

        return false;
    }