From 10ba077ccea0988450f076ef614c3b1ff41ff00e Mon Sep 17 00:00:00 2001
From: Thibault Dockx <thibault.dockx@fusiondirectory.org>
Date: Mon, 24 Mar 2025 23:58:18 +0000
Subject: [PATCH] :sparkles: Feat(webservice) - adds exec methods

Allowing generic call to exec curl
---
 src/FusionDirectory/Rest/WebServiceCall.php | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)

diff --git a/src/FusionDirectory/Rest/WebServiceCall.php b/src/FusionDirectory/Rest/WebServiceCall.php
index dcd6d51..232e855 100644
--- a/src/FusionDirectory/Rest/WebServiceCall.php
+++ b/src/FusionDirectory/Rest/WebServiceCall.php
@@ -198,5 +198,22 @@ class WebServiceCall
     curl_close($this->ch);
     return $response;
   }
+
+  /**
+ * @return array
+ * @throws Exception
+ */
+public function execute(): array
+{
+    $this->setCurlSettings();
+    $response = curl_exec($this->ch);
+    $this->handleCurlError($this->ch);
+    
+    $decoded = json_decode($response, true);
+    curl_close($this->ch);
+    
+    return $decoded;
+}
+
 }
 
-- 
GitLab