@@ -35,19 +35,20 @@ abstract public function getMaxMessagesPerRequest(): int;
3535 /**
3636 * Send a message.
3737 *
38- * @param Message $message The message to send.
38+ * @param Message $message The message to send.
3939 * @return string The response body.
4040 */
4141 abstract public function send (Message $ message ): string ;
4242
4343 /**
4444 * Send an HTTP request.
4545 *
46- * @param string $method The HTTP method to use.
47- * @param string $url The URL to send the request to.
48- * @param array $headers An array of headers to send with the request.
49- * @param string|null $body The body of the request.
46+ * @param string $method The HTTP method to use.
47+ * @param string $url The URL to send the request to.
48+ * @param array $headers An array of headers to send with the request.
49+ * @param string|null $body The body of the request.
5050 * @return string The response body.
51+ *
5152 * @throws \Exception If the request fails.
5253 */
5354 protected function request (
@@ -56,7 +57,7 @@ protected function request(
5657 array $ headers = [],
5758 mixed $ body = null ,
5859 ): string {
59- $ headers [] = 'Content-length: ' . \strlen ($ body );
60+ $ headers [] = 'Content-length: ' . \strlen ($ body );
6061
6162 $ ch = \curl_init ();
6263
@@ -66,14 +67,14 @@ protected function request(
6667 \curl_setopt ($ ch , CURLOPT_HTTPHEADER , $ headers );
6768 \curl_setopt ($ ch , CURLOPT_USERAGENT , "Appwrite {$ this ->getName ()} Message Sender " );
6869
69- if (!is_null ($ body )) {
70+ if (! is_null ($ body )) {
7071 \curl_setopt ($ ch , CURLOPT_POSTFIELDS , $ body );
7172 }
7273
7374 $ response = \curl_exec ($ ch );
7475
7576 if (\curl_errno ($ ch )) {
76- throw new \Exception ('Error: ' . \curl_error ($ ch ));
77+ throw new \Exception ('Error: ' . \curl_error ($ ch ));
7778 }
7879 if (\curl_getinfo ($ ch , CURLINFO_HTTP_CODE ) >= 400 ) {
7980 throw new \Exception ($ response );
0 commit comments