Jake Vanderwerf
2026-07-10 f94860aacd6200fb24c9e7431eb379a368cb392d
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