@@ -45,7 +45,7 @@ class Connection
4545 /**
4646 * Create a new connection instance.
4747 *
48- * @param array<string, int|string> $requestHeaders
48+ * @param array<string, int|string> $requestHeaders
4949 */
5050 public function __construct (public string $ url , public array $ requestHeaders = [])
5151 {
@@ -183,7 +183,7 @@ protected function createThreads(): void
183183
184184 if ($ byte === "\r" ) {
185185 // Expecting "\n" after "\r"
186- $ nextByte = $ this ->socket ? fread ($ this ->socket , 1 ) : false ;
186+ $ nextByte = $ this ->socket ? fread ($ this ->socket , 1 ) : false ;
187187
188188 if ($ nextByte === "\n" ) {
189189 break ;
@@ -214,7 +214,7 @@ protected function createThreads(): void
214214
215215 while ($ bytesRead < $ chunkSize ) {
216216 $ remainingBytes = $ chunkSize - $ bytesRead ;
217- $ readLength = max (1 , (int )$ remainingBytes );
217+ $ readLength = max (1 , (int ) $ remainingBytes );
218218
219219 $ data = $ this ->socket && $ remainingBytes > 0 ?
220220 fread ($ this ->socket , $ readLength ) :
@@ -357,7 +357,7 @@ public function open(): void
357357 stream_set_timeout ($ this ->socket , 5 );
358358
359359 $ error = fwrite ($ this ->socket , "POST {$ this ->path } HTTP/1.1 \r\n" );
360- $ error = fwrite ($ this ->socket , implode ("\r\n" , $ this ->headers ) . "\r\n" );
360+ $ error = fwrite ($ this ->socket , implode ("\r\n" , $ this ->headers ). "\r\n" );
361361 $ error = fwrite ($ this ->socket , "\r\n" );
362362
363363 if ($ error === false ) {
@@ -367,7 +367,7 @@ public function open(): void
367367 $ this ->open = true ;
368368
369369 $ this ->messages = [
370- pack ('C ' , QueryStreamMessageType::OPEN_CONNECTION ->value . pack ('V ' , 0 )),
370+ pack ('C ' , QueryStreamMessageType::OPEN_CONNECTION ->value . pack ('V ' , 0 )),
371371 ...$ this ->messages ,
372372 ];
373373
@@ -381,7 +381,7 @@ public function send(Query $query): QueryResult
381381 {
382382 $ queryRequest = $ this ->queryRequestEncoder ->encode ($ query );
383383
384- $ frame = pack ('C ' , QueryStreamMessageType::FRAME ->value ) . pack ('V ' , strlen ($ queryRequest )) . $ queryRequest ;
384+ $ frame = pack ('C ' , QueryStreamMessageType::FRAME ->value ). pack ('V ' , strlen ($ queryRequest )). $ queryRequest ;
385385
386386 $ this ->messages [] = $ frame ;
387387
@@ -410,7 +410,7 @@ public function send(Query $query): QueryResult
410410
411411 continue ;
412412 } catch (Exception $ reconnectException ) {
413- throw new Exception ('[Litebase Client Error]: Failed to reconnect after connection loss: ' . $ reconnectException ->getMessage ());
413+ throw new Exception ('[Litebase Client Error]: Failed to reconnect after connection loss: ' . $ reconnectException ->getMessage ());
414414 }
415415 }
416416 }
@@ -565,7 +565,7 @@ protected function writeMessage(string $message): void
565565 $ chunkSize = dechex (strlen ($ message ));
566566
567567 $ n = $ this ->socket ?
568- fwrite ($ this ->socket , $ chunkSize . "\r\n" . $ message . "\r\n" ) :
568+ fwrite ($ this ->socket , $ chunkSize. "\r\n" . $ message. "\r\n" ) :
569569 false ;
570570
571571 if ($ n === false ) {
0 commit comments