ackintosh / ganesha

:elephant: A Circuit Breaker pattern implementation for PHP applications.
https://ackintosh.github.io/ganesha/
MIT License
585 stars 42 forks source link

feat: Add Symfony HttpClient integration (closes #68) #69

Closed pvgnd closed 3 years ago

pvgnd commented 3 years ago

Add a GaneshaHttpClient to decorate HttpClientInterface

Remaining tasks:

pvgnd commented 3 years ago

@ackintosh curl_info: data are missing from VCR responses.yml. How can I re-record them with required informations for Symfony HttpClient implementation?

pvgnd commented 3 years ago

php-vcr does not seems to work with Symfony HttpClient. I opened an issue https://github.com/php-vcr/php-vcr/issues/329 to investigate

pvgnd commented 3 years ago

Since php-vcr does not work with Symfony HttpClient and I have difficulties to make it works, I updated my tests to use MockHttpClient implementation and MockResponse provided by Symfony. In my opinion this is more explicit like this because the server response is explicitly specified in the test, that way there is no need to open an other file (the fixture file) associated to the test.

coveralls commented 3 years ago

Coverage Status

Coverage decreased (-0.08%) to 91.769% when pulling 5d10f8cac7dfbe41396314e6140f61af866aed71 on pvgnd:symfony-http-client into e2b78135db124794685b187f2e4ef12e06115d90 on ackintosh:master.

pvgnd commented 3 years ago

@ackintosh is it ok for you?

ackintosh commented 3 years ago

Hmm... the TravisCI jobs (PHP >= 7.3) are failing. https://travis-ci.org/github/ackintosh/ganesha/jobs/748114417

Use of undefined constant XDEBUG_CC_UNUSED - assumed 'XDEBUG_CC_UNUSED' (this will throw an Error in a future version of PHP) The command "vendor/bin/phpunit" exited with 2.

I found out by investigating:


Anyway I've checked that the tests has passed on my local machine.

ackintosh commented 3 years ago

This feature has been released as v1.2.0. 🎉 https://github.com/ackintosh/ganesha/releases/tag/1.2.0