gmponos / guzzle-log-middleware

A Guzzle middleware to log request and responses automatically
MIT License
73 stars 24 forks source link

guzzle_logger v2.2.0 incompatible with Guzzle >= 7.7.0 #48

Open mwolff-fn opened 1 year ago

mwolff-fn commented 1 year ago

Using Guzzle 7.7.0 and gmponos/guzzle_logger 2.2.0, we recently ran into this error:

Error: Call to undefined function GuzzleHttp\Promise\rejection_for()

/project/vendor/gmponos/guzzle_logger/src/LogMiddleware.php:115
/project/vendor/guzzlehttp/promises/src/Promise.php:209
/project/vendor/guzzlehttp/promises/src/Promise.php:158
/project/vendor/guzzlehttp/promises/src/TaskQueue.php:52
/project/vendor/guzzlehttp/promises/src/Promise.php:251
/project/vendor/guzzlehttp/promises/src/Promise.php:227
/project/vendor/guzzlehttp/promises/src/Promise.php:272
/project/vendor/guzzlehttp/promises/src/Promise.php:229
/project/vendor/guzzlehttp/promises/src/Promise.php:69
/project/vendor/guzzlehttp/guzzle/src/Client.php:189
/project/vendor/guzzlehttp/guzzle/src/ClientTrait.php:44

I suspect it might have to do with Guzzle 7.7.0 now supporting guzzlehttp/promises v2, which removes all functions in favour of static methods (https://github.com/guzzle/promises/blob/2.0.0/CHANGELOG.md).

SvenRtbg commented 1 year ago

Alternatively make this library depend on guzzlehttp/promises ^1.5 explicitly, that will prevent installing the newer library with the removed functions.

mwolff-fn commented 1 year ago

I created a PR to fix the issue: https://github.com/gmponos/guzzle-log-middleware/pull/50

EmanSalla commented 1 year ago

We need this PR to be merged https://github.com/gmponos/guzzle-log-middleware/pull/50

ossycodes commented 1 year ago

@gmponos we still waiting for this to be merged https://github.com/gmponos/guzzle-log-middleware/pull/52