Returns type of variable value (with/without allowable analyze)
@param $var
@param array $allowTypesArr
@param null $default
@return mixed|null|string
775773
public static function detectVarType($var, $allowTypesArr=[], $default=null)
    {
        $type = gettype($var);
        if (!empty($allowTypesArr)){
            if (false !== $r = array_search(ucfirst($type), $allowTypesArr)) {
                return $r;
            } elseif(!is_null($default)) {
                return $default;
            }
        }
        return $type;
    }
105555
public static function getType($var)
    {
        if (is_object($var)) {
            return get_class($var);
        }
        if ($var === null) {
            return 'null';
        }
        if (is_string($var)) {
            return 'string';
        }
        if (is_array($var)) {
            return 'array';
        }
        if (is_int($var)) {
            return 'integer';
        }
        if (is_bool($var)) {
            return 'boolean';
        }
        if (is_float($var)) {
            return 'float';
        }
        if (is_resource($var)) {
            return 'resource';
        }

        return 'unknown';
    }
814182
protected function cast($value = null, int $type = Variables::TYPE_STRING)
    {
        if ($value === null) {
            return $this->getDefault($type);
        }
        switch ($type) {
            case Variables::TYPE_INT:
                $value = @\intval($value);
                break;
            case Variables::TYPE_FLOAT:
                $value = @\floatval($value);
                break;
            case Variables::TYPE_STRING:
                $value = @\strval($value);
                break;
            case Variables::TYPE_ARRAY:
                $value = (array)$value;
                break;
            case Variables::TYPE_JSON_DECODED:
                $value = @\json_decode(@\strval($value), true, 512) ?: '';
                break;
            case Variables::TYPE_AUTO:
                break;
            default:
                throw new DomainException('Invalid variable type specified');
                break;
        }
        return $value;
    }
57441
public function GetResultType($vars)
	{
		if ( is_null( $this->resultType ) )
			$this->resultType = $this->exprTree->GetReturnType( $this->BindExpr( $vars ) );
		return $this->resultType;
	}
1276902
public function getCookie($varname, $default = false)
    {
        if(isset($this->cookievars[$varname])) {
            return $this->cookievars[$varname]['value'];
        } else {
            return $default;
        }
    }
1126628
public function getDefault(string $type)
    {
        switch ($type) {
            case self::TYPE_NULL:
                return null;
            case self::TYPE_BOOLEAN:
                return false;
            case self::TYPE_INTEGER:
            case self::TYPE_FLOAT:
                return 0;
            case self::TYPE_STRING:
            case self::TYPE_BINARY:
                return '';
            case self::TYPE_ARRAY:
            case self::TYPE_OBJECT:
                return [];
        }

        throw new InvalidValueException("Invalid value type: $type");
    }
901829
public static function cast($value, Closure $condition, $type, $default = NULL) {
    return $condition($value) == TRUE ? settype($value, $type) : $default;
  }
502066
public function getTypeConfig($type = self::NORMAL, $default = [])
    {
        if ($this->isTypeAvailable($type)) {
            return $this->pageTypesAvailable[$type];
        }

        return $default;
    }
126954
public static function get($key = null, $type = 'string', $defaultValue = '')
    {
        if (!$key) {
            return $_GET;
        }
        return self::typeConvert(isset($_GET[$key]) ? $_GET[$key] : $defaultValue, $type);
    }
1177027
public static function defaultTypeResolver(
        $value,
        $context,
        ResolveInfo $info,
        AbstractTypeInterface $abstractType
    ) {
        // First, look for `__typename`.
        if (\is_array($value) && isset($value['__typename'])) {
            return $value['__typename'];
        }

        // Otherwise, test each possible type.

        /** @var ObjectType[] $possibleTypes */
        $possibleTypes = $info->getSchema()->getPossibleTypes($abstractType);
        $promises      = [];

        foreach ($possibleTypes as $index => $type) {
            $isTypeOf = $type->isTypeOf($value, $context, $info);

            if ($isTypeOf instanceof PromiseInterface) {
                $promises[$index] = $isTypeOf;
            }

            if (true === $isTypeOf) {
                return $type;
            }
        }

        if (!empty($promises)) {
            return \React\Promise\all($promises)->then(function ($resolvedPromises) use ($possibleTypes) {
                foreach ($resolvedPromises as $index => $result) {
                    if (true === $result) {
                        return $possibleTypes[$index];
                    }
                }

                return null;
            });
        }

        return null;
    }
83047
public function getVariable(string $variable, $default = null)
    {
        if (isset($this->variables[$variable])) {
            return $this->variables[$variable];
        }

        return $default;
    }
988647
public function get($name, $type = self::TYPE_GET, $default = null)
    {
        return (isset($this->vars[$type]) && isset($this->vars[$type][$name])) ? $this->vars[$type][$name] : $default;
    }
1311103
protected function getTypeSwapValue($type, $value)
    {
        switch (strtolower($type)) {
            case 'int':
            case 'integer':
                return (int) $value;
            case 'real':
            case 'float':
            case 'double':
                return (float) $value;
            case 'string':
                return (string) $value;
            default:
                return $value;
        }
    }
240072
private function _collapseType($src, $default) {
        $type = gettype($src);
        $typeTargetd = gettype($default);
        switch ($typeTargetd) {
            case 'integer':
                if ($type == "string" || $type == "integer") {
                    return intval($src);
                }
            break;
            case 'double':
                if ($type == "string" || $type == "integer" || $type == "double") {
                    $src = str_replace(",", ".", $src);
                    return floatval($src);
                }
            break;
            case 'string':
                if ($type == 'string') {
                    return strval($src);
                }
            break;
            case 'boolean':
                if ($type == 'boolean' || $type == 'string' || $type == 'integer') {
                    return boolval($src);
                }
            break;
			case 'object':
				return new RequestClass($src);
			break;
			case 'array':
				return new RequestClass($src);
			break;
            default:

        }

        return $default;
    }
604102
public function getRequestVar($sVarName, $sRequestType = null)
    {
        $sValue = null;
        switch ($sRequestType) {
            case 'post':
                if (isset($_POST[$sVarName])) {
                    $sValue = $_POST[$sVarName];
                }
                break;
            case 'get':
                if (isset($_GET[$sVarName])) {
                    $sValue = $_GET[$sVarName];
                }
                break;
            case 'cookie':
                if (isset($_COOKIE[$sVarName])) {
                    $sValue = $_COOKIE[$sVarName];
                }
                break;
            default:
                if ($sValue === null) {
                    $sValue = $this->getRequestVar($sVarName, 'post');
                }

                if ($sValue === null) {
                    $sValue = $this->getRequestVar($sVarName, 'get');
                }

                if ($sValue === null) {
                    $sValue = $this->getRequestVar($sVarName, 'cookie');
                }
                break;
        }

        return $sValue;
    }
1360506
public function getParam($name, $default = null)
    {
        if (\is_array($this->params)) {
            // Check in params that are arrays or implement array access
            return $this->params[$name] ?? $default;
        } elseif (\is_object($this->params)) {
            // Check in normal objects
            return $this->params->{$name} ?? $default;
        } else {
            // Wrong type, return default value
            return $default;
        }
    }
1066529
public function unsafeGet($varname, $default = false)
	{
		if(isset($this->getvars[$varname])) {
			return $this->getvars[$varname];
		} else {
			return $default;
		}
	}