aboutsummaryrefslogtreecommitdiff
path: root/vendor/guzzlehttp/guzzle/src/Handler
diff options
context:
space:
mode:
authorwn_ <invalid@email.com>2025-08-24 14:40:07 +0000
committerwn_ <invalid@email.com>2025-08-24 14:40:07 +0000
commit618cb5bf7830d90e670e8cd1fd114b06173ab374 (patch)
treef74a50e6f5e2579af2c962892e91534725054c9d /vendor/guzzlehttp/guzzle/src/Handler
parentf7fc00326e2f51f269f26b24a54d34e07a36846e (diff)
Bump Guzzle to 7.10.0 for PHP 8.5 compatibility.
https://github.com/guzzle/guzzle/compare/7.9.2...7.10.0
Diffstat (limited to 'vendor/guzzlehttp/guzzle/src/Handler')
-rw-r--r--vendor/guzzlehttp/guzzle/src/Handler/CurlFactory.php9
-rw-r--r--vendor/guzzlehttp/guzzle/src/Handler/CurlMultiHandler.php5
-rw-r--r--vendor/guzzlehttp/guzzle/src/Handler/Proxy.php12
-rw-r--r--vendor/guzzlehttp/guzzle/src/Handler/StreamHandler.php19
4 files changed, 33 insertions, 12 deletions
diff --git a/vendor/guzzlehttp/guzzle/src/Handler/CurlFactory.php b/vendor/guzzlehttp/guzzle/src/Handler/CurlFactory.php
index fe3613751..3c1fa9c13 100644
--- a/vendor/guzzlehttp/guzzle/src/Handler/CurlFactory.php
+++ b/vendor/guzzlehttp/guzzle/src/Handler/CurlFactory.php
@@ -125,7 +125,9 @@ class CurlFactory implements CurlFactoryInterface
unset($easy->handle);
if (\count($this->handles) >= $this->maxHandles) {
- \curl_close($resource);
+ if (PHP_VERSION_ID < 80000) {
+ \curl_close($resource);
+ }
} else {
// Remove all callback functions as they can hold onto references
// and are not cleaned up by curl_reset. Using curl_setopt_array
@@ -729,7 +731,10 @@ class CurlFactory implements CurlFactoryInterface
public function __destruct()
{
foreach ($this->handles as $id => $handle) {
- \curl_close($handle);
+ if (PHP_VERSION_ID < 80000) {
+ \curl_close($handle);
+ }
+
unset($this->handles[$id]);
}
}
diff --git a/vendor/guzzlehttp/guzzle/src/Handler/CurlMultiHandler.php b/vendor/guzzlehttp/guzzle/src/Handler/CurlMultiHandler.php
index 73a6abe33..21abbedf3 100644
--- a/vendor/guzzlehttp/guzzle/src/Handler/CurlMultiHandler.php
+++ b/vendor/guzzlehttp/guzzle/src/Handler/CurlMultiHandler.php
@@ -240,7 +240,10 @@ class CurlMultiHandler
$handle = $this->handles[$id]['easy']->handle;
unset($this->delays[$id], $this->handles[$id]);
\curl_multi_remove_handle($this->_mh, $handle);
- \curl_close($handle);
+
+ if (PHP_VERSION_ID < 80000) {
+ \curl_close($handle);
+ }
return true;
}
diff --git a/vendor/guzzlehttp/guzzle/src/Handler/Proxy.php b/vendor/guzzlehttp/guzzle/src/Handler/Proxy.php
index f045b526c..9df70cf23 100644
--- a/vendor/guzzlehttp/guzzle/src/Handler/Proxy.php
+++ b/vendor/guzzlehttp/guzzle/src/Handler/Proxy.php
@@ -17,10 +17,10 @@ class Proxy
* Sends synchronous requests to a specific handler while sending all other
* requests to another handler.
*
- * @param callable(\Psr\Http\Message\RequestInterface, array): \GuzzleHttp\Promise\PromiseInterface $default Handler used for normal responses
- * @param callable(\Psr\Http\Message\RequestInterface, array): \GuzzleHttp\Promise\PromiseInterface $sync Handler used for synchronous responses.
+ * @param callable(RequestInterface, array): PromiseInterface $default Handler used for normal responses
+ * @param callable(RequestInterface, array): PromiseInterface $sync Handler used for synchronous responses.
*
- * @return callable(\Psr\Http\Message\RequestInterface, array): \GuzzleHttp\Promise\PromiseInterface Returns the composed handler.
+ * @return callable(RequestInterface, array): PromiseInterface Returns the composed handler.
*/
public static function wrapSync(callable $default, callable $sync): callable
{
@@ -37,10 +37,10 @@ class Proxy
* performance benefits of curl while still supporting true streaming
* through the StreamHandler.
*
- * @param callable(\Psr\Http\Message\RequestInterface, array): \GuzzleHttp\Promise\PromiseInterface $default Handler used for non-streaming responses
- * @param callable(\Psr\Http\Message\RequestInterface, array): \GuzzleHttp\Promise\PromiseInterface $streaming Handler used for streaming responses
+ * @param callable(RequestInterface, array): PromiseInterface $default Handler used for non-streaming responses
+ * @param callable(RequestInterface, array): PromiseInterface $streaming Handler used for streaming responses
*
- * @return callable(\Psr\Http\Message\RequestInterface, array): \GuzzleHttp\Promise\PromiseInterface Returns the composed handler.
+ * @return callable(RequestInterface, array): PromiseInterface Returns the composed handler.
*/
public static function wrapStreaming(callable $default, callable $streaming): callable
{
diff --git a/vendor/guzzlehttp/guzzle/src/Handler/StreamHandler.php b/vendor/guzzlehttp/guzzle/src/Handler/StreamHandler.php
index 1d89a8fbc..f24921f47 100644
--- a/vendor/guzzlehttp/guzzle/src/Handler/StreamHandler.php
+++ b/vendor/guzzlehttp/guzzle/src/Handler/StreamHandler.php
@@ -53,8 +53,14 @@ class StreamHandler
$request = $request->withoutHeader('Expect');
// Append a content-length header if body size is zero to match
- // cURL's behavior.
- if (0 === $request->getBody()->getSize()) {
+ // the behavior of `CurlHandler`
+ if (
+ (
+ 0 === \strcasecmp('PUT', $request->getMethod())
+ || 0 === \strcasecmp('POST', $request->getMethod())
+ )
+ && 0 === $request->getBody()->getSize()
+ ) {
$request = $request->withHeader('Content-Length', '0');
}
@@ -327,8 +333,15 @@ class StreamHandler
);
return $this->createResource(
- function () use ($uri, &$http_response_header, $contextResource, $context, $options, $request) {
+ function () use ($uri, $contextResource, $context, $options, $request) {
$resource = @\fopen((string) $uri, 'r', false, $contextResource);
+
+ // See https://wiki.php.net/rfc/deprecations_php_8_5#deprecate_the_http_response_header_predefined_variable
+ if (function_exists('http_get_last_response_headers')) {
+ /** @var array|null */
+ $http_response_header = \http_get_last_response_headers();
+ }
+
$this->lastHeaders = $http_response_header ?? [];
if (false === $resource) {