From f94860aacd6200fb24c9e7431eb379a368cb392d Mon Sep 17 00:00:00 2001
From: Jake Vanderwerf <get@jakevanderwerf.ca>
Date: Fri, 10 Jul 2026 00:35:44 +0000
Subject: [PATCH] =Refactored CredentialsManager.php to utilize a CustomTable instance instead

---
 JVBase.php |   27 +++++++++++++++------------
 1 files changed, 15 insertions(+), 12 deletions(-)

diff --git a/JVBase.php b/JVBase.php
index 90f903d..e771147 100644
--- a/JVBase.php
+++ b/JVBase.php
@@ -86,7 +86,7 @@
 	}
 
 
-	public function __construct()
+	private function __construct()
 	{
 		$this->customBlocks = new CustomBlocks();
 		$this->managers = [
@@ -296,17 +296,20 @@
 
 	public function connect(string $service, ?int $userID = null): mixed
 	{
-		if ($userID) {
-			if (!$this->userCanConnect($service, $userID)) {
-				return null;
-			}
-
-			if (!array_key_exists($service, $this->integrations)) {
-				return null;
-			}
-			return $this->serviceMap[$service]::getInstance($userID);
-		}
-		return (array_key_exists($service, $this->integrations)) ? $this->integrations[$service] : null;
+//		if ($userID) {
+//			if (!$this->userCanConnect($service, $userID)) {
+//				return null;
+//			}
+//
+//			if (!array_key_exists($service, $this->integrations)) {
+//				return null;
+//			}
+//
+//			return $this->serviceMap[$service]::getInstance($userID);
+//		}
+		return is_null($userID) ?
+			$this->integrations[$service]??null :
+			(array_key_exists($service, $this->integrations) ? $this->serviceMap[$service]::getInstance($userID) : null);
 	}
 
 	public function userCanConnect(string $service, int $userID): bool

--
Gitblit v1.10.0