diff --git a/src/UserGroup.php b/src/UserGroup.php index 30efbf5..62c7cca 100644 --- a/src/UserGroup.php +++ b/src/UserGroup.php @@ -28,7 +28,10 @@ public function attach($user_id, $group_id) $httpcode = curl_getinfo($curl, CURLINFO_HTTP_CODE); curl_close($curl); - return array($response, $httpcode); + return array( + 'data' => json_decode($response, true), + 'code' => (int) $httpcode + ); } public function detach($user_id, $group_id) @@ -53,6 +56,9 @@ public function detach($user_id, $group_id) $httpcode = curl_getinfo($curl, CURLINFO_HTTP_CODE); curl_close($curl); - return array($response, $httpcode); + return array( + 'data' => json_decode($response, true), + 'code' => (int) $httpcode + ); } } \ No newline at end of file