Check if a key exists

@param $key The key to get. May be repeated to go deeper
@param $type The type check. Defaults to Type::NOTEMPTY
@return boolean If the key exists
422402
public function has($key, $type = Validator::EXISTS)
    {
        $args = WF::flatten_array(func_get_args());

        $last = end($args);     
        $type = Validator::EXISTS;
        if ((is_string($last) && defined(Type::class . '::' . $last)) || $last instanceof Validator)
            $type = array_pop($args);

        foreach ($args as $arg)
            if (!is_scalar($arg))
                throw new \InvalidArgumentException("Keys must be scalar, not: " . WF::str($arg));

        $val = $this->values;
        foreach ($args as $arg)
        {
            if (!WF::is_array_like($val) || !isset($val[$arg]))
                return false;
            $val = $val[$arg];
        }

        // Check type
        if (is_string($type))
        {
            $unstrict = in_array($type, [Type::INT, Type::FLOAT, Type::BOOL]);
            $checker = new Validator($type, ['unstrict' => $unstrict]);
        }
        else
            $checker = $type;

        return $checker->validate($val);
    }
1346603
public function exists($key) {

        $stmt = $this->connection->query("SELECT `key` FROM ".$this->table." WHERE `key`='{$key}';");
        $res  = $stmt->fetch(\PDO::FETCH_ASSOC);

        return isset($res["key"]);
    }
55491
public static function exists($type = 'post')
    {
        switch ($type) {
            case 'post':
                return (!empty($_POST)) ? true : false;
                break;
            case 'get':
                return (!empty($_GET)) ? true : false;
                break;
            default:
                return false;
                break;
        }
    }
1014542
public function has($key)
    {
        if ($key == 'message') {
            return !empty($this->message);
        }

        if ($key == 'exception') {
            return !is_null($this->exception);
        }

        return array_key_exists($key, $this->payload);
    }
16434
public function keyExists($key)
    {
        $exists = true;
        try {
            $this->get($key);
        } catch (Exception $e) {
            $exists = false;
        }
        return $exists;
    }
469164
public function has(string $key): bool
    {
        if (strpos($key, '.') != false) {
            return $this->getNested($key) != null;
        }

        return array_key_exists($key, $this->settings);
    }
447306
private function getFromData($type, $key)
    {
        return $this->hasData($type, $key) ? $this->data[$type][$key] : null;
    }
1029588
protected function exists($key)
    {
        if ($this->enabled && opcache_is_script_cached($this->filePath($key))) {
            return true;
        }
        return file_exists($this->filePath($key));
    }
1207867
public function has(string $key): bool
    {
        $this->assertRead();

        return \array_key_exists($key, $this->data);
    }
1014449
public function get($key, $type = self::NORMAL, $default = null)
    {
        $typeConfig = $this->getTypeConfig($type);

        if (array_key_exists($key, $typeConfig)) {
            return $typeConfig[$key];
        }

        return $default;
    }
1339593
public function has($key = null)
    {
        if ($key === null) {
            return $this->count() > 0;
        }

        $arr = &$this->getStackByReference($key);

        return is_array($arr) ? array_key_exists($key, $arr) : false;
    }
828109
public static function checkSchemaType($type)
    {
        if (isset(self::$_schemaTypes[$type])) {
            return self::$_schemaTypes[$type];
        } else {
            return false;
        }
    }
188633
public function exists($key)
	{
		return isset($this->data[$key]) && ($this->data[$key][1] > time());
	}
928873
public function checkForMutator($key, $type)
    {
        $str = $type.Str::studly($key).'Attribute';

        if (is_callable([$this, $str])) {
            return $str;
        }

        return false;
    }
640656
public function has(string $key): bool
    {
        return !empty(Helper::arrayGet($this->data, $key));
    }
602663
protected function hasKey($key)
    {
        return ($this->mode == self::MODE_INDEXED && $key == '') || \array_key_exists($key, $this->params);
    }
669642
public function exists(string $key): bool
    {
        $key = $this->getKey($key);

        return cache()->has($key);
    }