public function connect(): bool {
        if (!$this->hasMinimumCredentials()) {
            throw new InvalidCredentialsException();
        }
        $host = $this->credentials["servername"];
        $db = $this->credentials["dbname"];
        $dsn = "mysql:host=$host;dbname=$db;charset=utf8";
        $this->pdo = new \PDO($dsn,
            $this->credentials["username"],
            $this->credentials["password"]
        );
        $this->pdo->setAttribute(\PDO::ATTR_ERRMODE, \PDO::ERRMODE_EXCEPTION);
        return $this->pdo !== null;
    }