@@ -124,7 +124,7 @@ public function getRequestTarget(): string
124
124
$ target = '/ ' ;
125
125
}
126
126
if ($ this ->uri ->getQuery () !== '' ) {
127
- $ target .= '? ' . $ this ->uri ->getQuery ();
127
+ $ target .= '? ' . $ this ->uri ->getQuery ();
128
128
}
129
129
130
130
return $ target ;
@@ -459,10 +459,10 @@ public function multipart(array $data): self
459
459
* Create an SSE connection with automatic reconnection.
460
460
* Inherits all configured request options (headers, auth, timeouts, etc.)
461
461
*
462
- * @param string $url The SSE endpoint URL
463
- * @param callable(SSEEvent): void|null $onEvent Optional callback for each SSE event
464
- * @param callable(string): void|null $onError Optional callback for connection errors
465
- * @param SSEReconnectConfig|null $reconnectConfig Optional reconnection configuration
462
+ * @param string $url The SSE endpoint URL
463
+ * @param callable(SSEEvent): void|null $onEvent Optional callback for each SSE event
464
+ * @param callable(string): void|null $onError Optional callback for connection errors
465
+ * @param SSEReconnectConfig|null $reconnectConfig Optional reconnection configuration
466
466
* @return CancellablePromiseInterface<SSEResponse>
467
467
*/
468
468
public function sse (
@@ -485,16 +485,15 @@ public function sse(
485
485
/**
486
486
* Configure SSE reconnection behavior.
487
487
*
488
- * @param bool $enabled Whether reconnection is enabled
489
- * @param int $maxAttempts Maximum reconnection attempts
490
- * @param float $initialDelay Initial delay before first reconnection
491
- * @param float $maxDelay Maximum delay between attempts
492
- * @param float $backoffMultiplier Exponential backoff multiplier
493
- * @param bool $jitter Add random jitter to delays
494
- * @param array $retryableErrors List of retryable error messages
495
- * @param callable|null $onReconnect Callback called before each reconnection attempt
496
- * @param callable|null $shouldReconnect Custom logic to determine if reconnection should occur
497
- * @return self
488
+ * @param bool $enabled Whether reconnection is enabled
489
+ * @param int $maxAttempts Maximum reconnection attempts
490
+ * @param float $initialDelay Initial delay before first reconnection
491
+ * @param float $maxDelay Maximum delay between attempts
492
+ * @param float $backoffMultiplier Exponential backoff multiplier
493
+ * @param bool $jitter Add random jitter to delays
494
+ * @param array $retryableErrors List of retryable error messages
495
+ * @param callable|null $onReconnect Callback called before each reconnection attempt
496
+ * @param callable|null $shouldReconnect Custom logic to determine if reconnection should occur
498
497
*/
499
498
public function sseReconnect (
500
499
bool $ enabled = true ,
@@ -534,8 +533,7 @@ public function sseReconnect(
534
533
/**
535
534
* Configure SSE reconnection using a custom configuration object.
536
535
*
537
- * @param SSEReconnectConfig $config The reconnection configuration
538
- * @return self
536
+ * @param SSEReconnectConfig $config The reconnection configuration
539
537
*/
540
538
public function sseReconnectWith (SSEReconnectConfig $ config ): self
541
539
{
@@ -546,8 +544,6 @@ public function sseReconnectWith(SSEReconnectConfig $config): self
546
544
547
545
/**
548
546
* Disable SSE reconnection.
549
- *
550
- * @return self
551
547
*/
552
548
public function noSseReconnect (): self
553
549
{
@@ -620,7 +616,7 @@ public function streamPost(string $url, $body = null, ?callable $onChunk = null)
620
616
public function get (string $ url , array $ query = []): PromiseInterface
621
617
{
622
618
if (count ($ query ) > 0 ) {
623
- $ url .= (strpos ($ url , '? ' ) !== false ? '& ' : '? ' ) . http_build_query ($ query );
619
+ $ url .= (strpos ($ url , '? ' ) !== false ? '& ' : '? ' ). http_build_query ($ query );
624
620
}
625
621
626
622
return $ this ->send ('GET ' , $ url );
@@ -831,10 +827,10 @@ function ($asyncResponse) use ($interceptors, $resolve, $reject) {
831
827
public function cookie (string $ name , string $ value ): self
832
828
{
833
829
$ existingCookies = $ this ->getHeaderLine ('Cookie ' );
834
- $ newCookie = $ name . '= ' . urlencode ($ value );
830
+ $ newCookie = $ name. '= ' . urlencode ($ value );
835
831
836
832
if ($ existingCookies !== '' ) {
837
- return $ this ->header ('Cookie ' , $ existingCookies . '; ' . $ newCookie );
833
+ return $ this ->header ('Cookie ' , $ existingCookies. '; ' . $ newCookie );
838
834
} else {
839
835
return $ this ->header ('Cookie ' , $ newCookie );
840
836
}
@@ -1156,7 +1152,7 @@ private function buildCurlOptions(string $method, string $url): array
1156
1152
if ($ cookieHeader !== '' ) {
1157
1153
$ existingCookies = $ this ->getHeaderLine ('Cookie ' );
1158
1154
if ($ existingCookies !== '' ) {
1159
- $ this ->header ('Cookie ' , $ existingCookies . '; ' . $ cookieHeader );
1155
+ $ this ->header ('Cookie ' , $ existingCookies. '; ' . $ cookieHeader );
1160
1156
} else {
1161
1157
$ this ->header ('Cookie ' , $ cookieHeader );
1162
1158
}
@@ -1197,13 +1193,13 @@ private function addProxyOptions(array &$options): void
1197
1193
return ;
1198
1194
}
1199
1195
1200
- $ options [CURLOPT_PROXY ] = $ this ->proxyConfig ->host . ': ' . $ this ->proxyConfig ->port ;
1196
+ $ options [CURLOPT_PROXY ] = $ this ->proxyConfig ->host . ': ' . $ this ->proxyConfig ->port ;
1201
1197
$ options [CURLOPT_PROXYTYPE ] = $ this ->proxyConfig ->getCurlProxyType ();
1202
1198
1203
1199
if ($ this ->proxyConfig ->username !== null ) {
1204
1200
$ proxyAuth = $ this ->proxyConfig ->username ;
1205
1201
if ($ this ->proxyConfig ->password !== null ) {
1206
- $ proxyAuth .= ': ' . $ this ->proxyConfig ->password ;
1202
+ $ proxyAuth .= ': ' . $ this ->proxyConfig ->password ;
1207
1203
}
1208
1204
$ options [CURLOPT_PROXYUSERPWD ] = $ proxyAuth ;
1209
1205
}
@@ -1225,7 +1221,7 @@ private function addHeaderOptions(array &$options): void
1225
1221
if (count ($ this ->headers ) > 0 ) {
1226
1222
$ headerStrings = [];
1227
1223
foreach ($ this ->headers as $ name => $ value ) {
1228
- $ headerStrings [] = "{$ name }: " . implode (', ' , $ value );
1224
+ $ headerStrings [] = "{$ name }: " . implode (', ' , $ value );
1229
1225
}
1230
1226
$ options [CURLOPT_HTTPHEADER ] = $ headerStrings ;
1231
1227
}
@@ -1272,7 +1268,7 @@ private function updateHostFromUri(): void
1272
1268
}
1273
1269
1274
1270
if (($ port = $ this ->uri ->getPort ()) !== null ) {
1275
- $ host .= ': ' . $ port ;
1271
+ $ host .= ': ' . $ port ;
1276
1272
}
1277
1273
1278
1274
if (isset ($ this ->headerNames ['host ' ])) {
0 commit comments