},
{
"name": "guzzlehttp/guzzle",
- "version": "7.4.5",
+ "version": "7.5.0",
"source": {
"type": "git",
"url": "https://github.com/guzzle/guzzle.git",
- "reference": "1dd98b0564cb3f6bd16ce683cb755f94c10fbd82"
+ "reference": "b50a2a1251152e43f6a37f0fa053e730a67d25ba"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/guzzle/guzzle/zipball/1dd98b0564cb3f6bd16ce683cb755f94c10fbd82",
- "reference": "1dd98b0564cb3f6bd16ce683cb755f94c10fbd82",
+ "url": "https://api.github.com/repos/guzzle/guzzle/zipball/b50a2a1251152e43f6a37f0fa053e730a67d25ba",
+ "reference": "b50a2a1251152e43f6a37f0fa053e730a67d25ba",
"shasum": ""
},
"require": {
"psr/http-client-implementation": "1.0"
},
"require-dev": {
- "bamarni/composer-bin-plugin": "^1.4.1",
+ "bamarni/composer-bin-plugin": "^1.8.1",
"ext-curl": "*",
"php-http/client-integration-tests": "^3.0",
- "phpunit/phpunit": "^8.5.5 || ^9.3.5",
+ "phpunit/phpunit": "^8.5.29 || ^9.5.23",
"psr/log": "^1.1 || ^2.0 || ^3.0"
},
"suggest": {
},
"type": "library",
"extra": {
+ "bamarni-bin": {
+ "bin-links": true,
+ "forward-command": false
+ },
"branch-alias": {
- "dev-master": "7.4-dev"
+ "dev-master": "7.5-dev"
}
},
"autoload": {
],
"support": {
"issues": "https://github.com/guzzle/guzzle/issues",
- "source": "https://github.com/guzzle/guzzle/tree/7.4.5"
+ "source": "https://github.com/guzzle/guzzle/tree/7.5.0"
},
"funding": [
{
"type": "tidelift"
}
],
- "time": "2022-06-20T22:16:13+00:00"
+ "time": "2022-08-28T15:39:27+00:00"
},
{
"name": "guzzlehttp/promises",
- "version": "1.5.1",
+ "version": "1.5.2",
"source": {
"type": "git",
"url": "https://github.com/guzzle/promises.git",
- "reference": "fe752aedc9fd8fcca3fe7ad05d419d32998a06da"
+ "reference": "b94b2807d85443f9719887892882d0329d1e2598"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/guzzle/promises/zipball/fe752aedc9fd8fcca3fe7ad05d419d32998a06da",
- "reference": "fe752aedc9fd8fcca3fe7ad05d419d32998a06da",
+ "url": "https://api.github.com/repos/guzzle/promises/zipball/b94b2807d85443f9719887892882d0329d1e2598",
+ "reference": "b94b2807d85443f9719887892882d0329d1e2598",
"shasum": ""
},
"require": {
],
"support": {
"issues": "https://github.com/guzzle/promises/issues",
- "source": "https://github.com/guzzle/promises/tree/1.5.1"
+ "source": "https://github.com/guzzle/promises/tree/1.5.2"
},
"funding": [
{
"type": "tidelift"
}
],
- "time": "2021-10-22T20:56:57+00:00"
+ "time": "2022-08-28T14:55:35+00:00"
},
{
"name": "guzzlehttp/psr7",
- "version": "2.4.0",
+ "version": "2.4.1",
"source": {
"type": "git",
"url": "https://github.com/guzzle/psr7.git",
- "reference": "13388f00956b1503577598873fffb5ae994b5737"
+ "reference": "69568e4293f4fa993f3b0e51c9723e1e17c41379"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/guzzle/psr7/zipball/13388f00956b1503577598873fffb5ae994b5737",
- "reference": "13388f00956b1503577598873fffb5ae994b5737",
+ "url": "https://api.github.com/repos/guzzle/psr7/zipball/69568e4293f4fa993f3b0e51c9723e1e17c41379",
+ "reference": "69568e4293f4fa993f3b0e51c9723e1e17c41379",
"shasum": ""
},
"require": {
"psr/http-message-implementation": "1.0"
},
"require-dev": {
- "bamarni/composer-bin-plugin": "^1.4.1",
+ "bamarni/composer-bin-plugin": "^1.8.1",
"http-interop/http-factory-tests": "^0.9",
- "phpunit/phpunit": "^8.5.8 || ^9.3.10"
+ "phpunit/phpunit": "^8.5.29 || ^9.5.23"
},
"suggest": {
"laminas/laminas-httphandlerrunner": "Emit PSR-7 responses"
},
"type": "library",
"extra": {
+ "bamarni-bin": {
+ "bin-links": true,
+ "forward-command": false
+ },
"branch-alias": {
"dev-master": "2.4-dev"
}
],
"support": {
"issues": "https://github.com/guzzle/psr7/issues",
- "source": "https://github.com/guzzle/psr7/tree/2.4.0"
+ "source": "https://github.com/guzzle/psr7/tree/2.4.1"
},
"funding": [
{
"type": "tidelift"
}
],
- "time": "2022-06-20T21:43:11+00:00"
+ "time": "2022-08-28T14:45:39+00:00"
},
{
"name": "laminas/laminas-diactoros",
"issues": "https://github.com/true/php-punycode/issues",
"source": "https://github.com/true/php-punycode/tree/master"
},
+ "abandoned": true,
"time": "2016-11-16T10:37:54+00:00"
}
],
},
{
"name": "guzzlehttp/guzzle",
- "version": "7.4.5",
- "version_normalized": "7.4.5.0",
+ "version": "7.5.0",
+ "version_normalized": "7.5.0.0",
"source": {
"type": "git",
"url": "https://github.com/guzzle/guzzle.git",
- "reference": "1dd98b0564cb3f6bd16ce683cb755f94c10fbd82"
+ "reference": "b50a2a1251152e43f6a37f0fa053e730a67d25ba"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/guzzle/guzzle/zipball/1dd98b0564cb3f6bd16ce683cb755f94c10fbd82",
- "reference": "1dd98b0564cb3f6bd16ce683cb755f94c10fbd82",
+ "url": "https://api.github.com/repos/guzzle/guzzle/zipball/b50a2a1251152e43f6a37f0fa053e730a67d25ba",
+ "reference": "b50a2a1251152e43f6a37f0fa053e730a67d25ba",
"shasum": ""
},
"require": {
"psr/http-client-implementation": "1.0"
},
"require-dev": {
- "bamarni/composer-bin-plugin": "^1.4.1",
+ "bamarni/composer-bin-plugin": "^1.8.1",
"ext-curl": "*",
"php-http/client-integration-tests": "^3.0",
- "phpunit/phpunit": "^8.5.5 || ^9.3.5",
+ "phpunit/phpunit": "^8.5.29 || ^9.5.23",
"psr/log": "^1.1 || ^2.0 || ^3.0"
},
"suggest": {
"ext-intl": "Required for Internationalized Domain Name (IDN) support",
"psr/log": "Required for using the Log middleware"
},
- "time": "2022-06-20T22:16:13+00:00",
+ "time": "2022-08-28T15:39:27+00:00",
"type": "library",
"extra": {
+ "bamarni-bin": {
+ "bin-links": true,
+ "forward-command": false
+ },
"branch-alias": {
- "dev-master": "7.4-dev"
+ "dev-master": "7.5-dev"
}
},
"installation-source": "dist",
],
"support": {
"issues": "https://github.com/guzzle/guzzle/issues",
- "source": "https://github.com/guzzle/guzzle/tree/7.4.5"
+ "source": "https://github.com/guzzle/guzzle/tree/7.5.0"
},
"funding": [
{
},
{
"name": "guzzlehttp/promises",
- "version": "1.5.1",
- "version_normalized": "1.5.1.0",
+ "version": "1.5.2",
+ "version_normalized": "1.5.2.0",
"source": {
"type": "git",
"url": "https://github.com/guzzle/promises.git",
- "reference": "fe752aedc9fd8fcca3fe7ad05d419d32998a06da"
+ "reference": "b94b2807d85443f9719887892882d0329d1e2598"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/guzzle/promises/zipball/fe752aedc9fd8fcca3fe7ad05d419d32998a06da",
- "reference": "fe752aedc9fd8fcca3fe7ad05d419d32998a06da",
+ "url": "https://api.github.com/repos/guzzle/promises/zipball/b94b2807d85443f9719887892882d0329d1e2598",
+ "reference": "b94b2807d85443f9719887892882d0329d1e2598",
"shasum": ""
},
"require": {
"require-dev": {
"symfony/phpunit-bridge": "^4.4 || ^5.1"
},
- "time": "2021-10-22T20:56:57+00:00",
+ "time": "2022-08-28T14:55:35+00:00",
"type": "library",
"extra": {
"branch-alias": {
},
"installation-source": "dist",
"autoload": {
- "psr-4": {
- "GuzzleHttp\\Promise\\": "src/"
- },
"files": [
"src/functions_include.php"
- ]
+ ],
+ "psr-4": {
+ "GuzzleHttp\\Promise\\": "src/"
+ }
},
"notification-url": "https://packagist.org/downloads/",
"license": [
],
"support": {
"issues": "https://github.com/guzzle/promises/issues",
- "source": "https://github.com/guzzle/promises/tree/1.5.1"
+ "source": "https://github.com/guzzle/promises/tree/1.5.2"
},
"funding": [
{
},
{
"name": "guzzlehttp/psr7",
- "version": "2.4.0",
- "version_normalized": "2.4.0.0",
+ "version": "2.4.1",
+ "version_normalized": "2.4.1.0",
"source": {
"type": "git",
"url": "https://github.com/guzzle/psr7.git",
- "reference": "13388f00956b1503577598873fffb5ae994b5737"
+ "reference": "69568e4293f4fa993f3b0e51c9723e1e17c41379"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/guzzle/psr7/zipball/13388f00956b1503577598873fffb5ae994b5737",
- "reference": "13388f00956b1503577598873fffb5ae994b5737",
+ "url": "https://api.github.com/repos/guzzle/psr7/zipball/69568e4293f4fa993f3b0e51c9723e1e17c41379",
+ "reference": "69568e4293f4fa993f3b0e51c9723e1e17c41379",
"shasum": ""
},
"require": {
"psr/http-message-implementation": "1.0"
},
"require-dev": {
- "bamarni/composer-bin-plugin": "^1.4.1",
+ "bamarni/composer-bin-plugin": "^1.8.1",
"http-interop/http-factory-tests": "^0.9",
- "phpunit/phpunit": "^8.5.8 || ^9.3.10"
+ "phpunit/phpunit": "^8.5.29 || ^9.5.23"
},
"suggest": {
"laminas/laminas-httphandlerrunner": "Emit PSR-7 responses"
},
- "time": "2022-06-20T21:43:11+00:00",
+ "time": "2022-08-28T14:45:39+00:00",
"type": "library",
"extra": {
+ "bamarni-bin": {
+ "bin-links": true,
+ "forward-command": false
+ },
"branch-alias": {
"dev-master": "2.4-dev"
}
],
"support": {
"issues": "https://github.com/guzzle/psr7/issues",
- "source": "https://github.com/guzzle/psr7/tree/2.4.0"
+ "source": "https://github.com/guzzle/psr7/tree/2.4.1"
},
"funding": [
{
'dev_requirement' => false,
),
'guzzlehttp/guzzle' => array(
- 'pretty_version' => '7.4.5',
- 'version' => '7.4.5.0',
- 'reference' => '1dd98b0564cb3f6bd16ce683cb755f94c10fbd82',
+ 'pretty_version' => '7.5.0',
+ 'version' => '7.5.0.0',
+ 'reference' => 'b50a2a1251152e43f6a37f0fa053e730a67d25ba',
'type' => 'library',
'install_path' => __DIR__ . '/../guzzlehttp/guzzle',
'aliases' => array(),
'dev_requirement' => false,
),
'guzzlehttp/promises' => array(
- 'pretty_version' => '1.5.1',
- 'version' => '1.5.1.0',
- 'reference' => 'fe752aedc9fd8fcca3fe7ad05d419d32998a06da',
+ 'pretty_version' => '1.5.2',
+ 'version' => '1.5.2.0',
+ 'reference' => 'b94b2807d85443f9719887892882d0329d1e2598',
'type' => 'library',
'install_path' => __DIR__ . '/../guzzlehttp/promises',
'aliases' => array(),
'dev_requirement' => false,
),
'guzzlehttp/psr7' => array(
- 'pretty_version' => '2.4.0',
- 'version' => '2.4.0.0',
- 'reference' => '13388f00956b1503577598873fffb5ae994b5737',
+ 'pretty_version' => '2.4.1',
+ 'version' => '2.4.1.0',
+ 'reference' => '69568e4293f4fa993f3b0e51c9723e1e17c41379',
'type' => 'library',
'install_path' => __DIR__ . '/../guzzlehttp/psr7',
'aliases' => array(),
Please refer to [UPGRADING](UPGRADING.md) guide for upgrading to a major version.
+## 7.5.0 - 2022-08-28
+
+### Added
+
+- Support PHP 8.2
+- Add request to delay closure params
+
## 7.4.5 - 2022-06-20
* Fix change in port should be considered a change in origin
},
"require-dev": {
"ext-curl": "*",
- "bamarni/composer-bin-plugin": "^1.4.1",
+ "bamarni/composer-bin-plugin": "^1.8.1",
"php-http/client-integration-tests": "^3.0",
- "phpunit/phpunit": "^8.5.5 || ^9.3.5",
+ "phpunit/phpunit": "^8.5.29 || ^9.5.23",
"psr/log": "^1.1 || ^2.0 || ^3.0"
},
"suggest": {
"sort-packages": true
},
"extra": {
+ "bamarni-bin": {
+ "bin-links": true,
+ "forward-command": false
+ },
"branch-alias": {
- "dev-master": "7.4-dev"
+ "dev-master": "7.5-dev"
}
},
"autoload": {
// Resolve conflicts with previously set cookies
foreach ($this->cookies as $i => $c) {
-
// Two cookies are identical, when their path, and domain are
// identical.
if ($c->getPath() != $cookie->getPath() ||
*
* @final
*/
+#[\AllowDynamicProperties]
class CurlMultiHandler
{
/**
private function doRetry(RequestInterface $request, array $options, ResponseInterface $response = null): PromiseInterface
{
- $options['delay'] = ($this->delay)(++$options['retries'], $response);
+ $options['delay'] = ($this->delay)(++$options['retries'], $response, $request);
return $this($request, $options);
}
public static function chooseHandler(): callable
{
$handler = null;
- if (\function_exists('curl_multi_exec') && \function_exists('curl_exec')) {
- $handler = Proxy::wrapSync(new CurlMultiHandler(), new CurlHandler());
- } elseif (\function_exists('curl_exec')) {
- $handler = new CurlHandler();
- } elseif (\function_exists('curl_multi_exec')) {
- $handler = new CurlMultiHandler();
+
+ if (\defined('CURLOPT_CUSTOMREQUEST')) {
+ if (\function_exists('curl_multi_exec') && \function_exists('curl_exec')) {
+ $handler = Proxy::wrapSync(new CurlMultiHandler(), new CurlHandler());
+ } elseif (\function_exists('curl_exec')) {
+ $handler = new CurlHandler();
+ } elseif (\function_exists('curl_multi_exec')) {
+ $handler = new CurlMultiHandler();
+ }
}
if (\ini_get('allow_url_fopen')) {
# CHANGELOG
+## 1.5.2 - 2022-08-07
+
+### Changed
+
+- Officially support PHP 8.2
+
## 1.5.1 - 2021-10-22
### Fixed
### Changed
- Call handler when waiting on fulfilled/rejected Promise
+- Officially support PHP 8.1
### Fixed
-- Fix manually settle promises generated with Utils::task
+- Fix manually settle promises generated with `Utils::task`
## 1.4.1 - 2021-02-18
+++ /dev/null
-all: clean test
-
-test:
- vendor/bin/phpunit
-
-coverage:
- vendor/bin/phpunit --coverage-html=artifacts/coverage
-
-view-coverage:
- open artifacts/coverage/index.html
-
-clean:
- rm -rf artifacts/*
- [Implementation notes](#implementation-notes)
-# Features
+## Features
- [Promises/A+](https://promisesaplus.com/) implementation.
- Promise resolution and chaining is handled iteratively, allowing for
`GuzzleHttp\Promise\Coroutine::of()`.
-# Quick start
+## Quick Start
A *promise* represents the eventual result of an asynchronous operation. The
primary way of interacting with a promise is through its `then` method, which
registers callbacks to receive either a promise's eventual value or the reason
why the promise cannot be fulfilled.
-
-## Callbacks
+### Callbacks
Callbacks are registered with the `then` method by providing an optional
`$onFulfilled` followed by an optional `$onRejected` function.
```
*Resolving* a promise means that you either fulfill a promise with a *value* or
-reject a promise with a *reason*. Resolving a promises triggers callbacks
-registered with the promises's `then` method. These callbacks are triggered
+reject a promise with a *reason*. Resolving a promise triggers callbacks
+registered with the promise's `then` method. These callbacks are triggered
only once and in the order in which they were added.
-
-## Resolving a promise
+### Resolving a Promise
Promises are fulfilled using the `resolve($value)` method. Resolving a promise
with any value other than a `GuzzleHttp\Promise\RejectedPromise` will trigger
$promise->resolve('reader.');
```
-
-## Promise forwarding
+### Promise Forwarding
Promises can be chained one after the other. Each then in the chain is a new
promise. The return value of a promise is what's forwarded to the next
$nextPromise->resolve('B');
```
-## Promise rejection
+### Promise Rejection
When a promise is rejected, the `$onRejected` callbacks are invoked with the
rejection reason.
// Outputs "Error!"
```
-## Rejection forwarding
+### Rejection Forwarding
If an exception is thrown in an `$onRejected` callback, subsequent
`$onRejected` callbacks are invoked with the thrown exception as the reason.
$promise->reject('Error!');
```
-# Synchronous wait
+
+## Synchronous Wait
You can synchronously force promises to complete using a promise's `wait`
method. When creating a promise, you can provide a wait function that is used
> PHP Fatal error: Uncaught exception 'GuzzleHttp\Promise\RejectionException' with message 'The promise was rejected with value: foo'
-
-## Unwrapping a promise
+### Unwrapping a Promise
When synchronously waiting on a promise, you are joining the state of the
promise into the current state of execution (i.e., return the value of the
**Note**: when you do not unwrap the promise, no value is returned.
-# Cancellation
+## Cancellation
You can cancel a promise that has not yet been fulfilled using the `cancel()`
method of a promise. When creating a promise you can provide an optional
of the promise.
-# API
+## API
-
-## Promise
+### Promise
When creating a promise object, you can provide an optional `$waitFn` and
`$cancelFn`. `$waitFn` is a function that is invoked with no arguments and is
Rejects the promise with the given `$reason`.
-## FulfilledPromise
+### FulfilledPromise
A fulfilled promise can be created to represent a promise that has been
fulfilled.
```
-## RejectedPromise
+### RejectedPromise
A rejected promise can be created to represent a promise that has been
rejected.
```
-# Promise interop
+## Promise Interoperability
This library works with foreign promises that have a `then` method. This means
you can use Guzzle promises with [React promises](https://github.com/reactphp/promise)
promise in order to utilize wait and cancel functions with foreign promises.
-## Event Loop Integration
+### Event Loop Integration
In order to keep the stack size constant, Guzzle promises are resolved
asynchronously using a task queue. When waiting on promises synchronously, the
*TODO*: Perhaps adding a `futureTick()` on each tick would be faster?
-# Implementation notes
-
+## Implementation Notes
-## Promise resolution and chaining is handled iteratively
+### Promise Resolution and Chaining is Handled Iteratively
By shuffling pending handlers from one owner to another, promises are
resolved iteratively, allowing for "infinite" then chaining.
eventually resolved, all of the pending handlers are delivered the forwarded
value.
-
-## A promise is the deferred.
+### A Promise is the Deferred
Some promise libraries implement promises using a deferred object to represent
a computation and a promise object to represent the delivery of the result of
## Upgrading from Function API
-A static API was first introduced in 1.4.0, in order to mitigate problems with functions conflicting between global and local copies of the package. The function API will be removed in 2.0.0. A migration table has been provided here for your convenience:
+A static API was first introduced in 1.4.0, in order to mitigate problems with
+functions conflicting between global and local copies of the package. The
+function API will be removed in 2.0.0. A migration table has been provided here
+for your convenience:
| Original Function | Replacement Method |
|----------------|----------------|
If you discover a security vulnerability within this package, please send an email to security@tidelift.com. All security vulnerabilities will be promptly addressed. Please do not disclose security-related issues publicly until a fix has been announced. Please see [Security Policy](https://github.com/guzzle/promises/security/policy) for more information.
+
## License
Guzzle is made available under the MIT License (MIT). Please see [License File](LICENSE) for more information.
+
## For Enterprise
Available as part of the Tidelift Subscription
$this->iterable->rewind();
$this->refillPending();
} catch (\Throwable $e) {
- /**
- * @psalm-suppress NullReference
- * @phpstan-ignore-next-line
- */
$this->aggregate->reject($e);
} catch (\Exception $e) {
- /**
- * @psalm-suppress NullReference
- * @phpstan-ignore-next-line
- */
$this->aggregate->reject($e);
}
## Unreleased
+## 2.4.1 - 2022-08-28
+
+### Fixed
+
+- Rewind body before reading in `Message::bodySummary`
+
## 2.4.0 - 2022-06-20
### Added
"psr/http-message-implementation": "1.0"
},
"require-dev": {
- "bamarni/composer-bin-plugin": "^1.4.1",
+ "bamarni/composer-bin-plugin": "^1.8.1",
"http-interop/http-factory-tests": "^0.9",
- "phpunit/phpunit": "^8.5.8 || ^9.3.10"
+ "phpunit/phpunit": "^8.5.29 || ^9.5.23"
},
"suggest": {
"laminas/laminas-httphandlerrunner": "Emit PSR-7 responses"
}
},
"extra": {
+ "bamarni-bin": {
+ "bin-links": true,
+ "forward-command": false
+ },
"branch-alias": {
"dev-master": "2.4-dev"
}
$progressToNext = false;
while ($remaining > 0) {
-
// Progress to the next stream if needed.
if ($progressToNext || $this->streams[$this->current]->eof()) {
$progressToNext = false;
return null;
}
+ $body->rewind();
$summary = $body->read($truncateAt);
$body->rewind();