kriswallsmith / Buzz

PHP's lightweight HTTP client

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

troubles upgrading to 0.17.0

hjanuschka opened this issue Β· comments

hey 🀚

we are in the progress to upgrade to 0.17.0

the following issues have arrived:

use Buzz\Message\Response as BuzzResponse;

not found, can be fixed with:

use Nyholm\Psr7\Response as BuzzResponse;

is that correct ❓

the bigger one is:
in our symfony app we have the following:

    krn_bridge.browser.client.curl:
        class: Buzz\Client\Curl
        public: false
        calls:
          - [setTimeout , ["%krn_bridge.client_timeout%"]]

    krn_bridge.browser:
        class: KRN\BridgeBundle\Services\KrnBridgeBrowser
        public: false
        arguments: ["@krn_bridge.browser.client.curl"]

the method setTimeout has been removed, and we currently have no clou how to provide options
can you help me with this one?

using krn_bridge.browser with e.g: $browser->get()

You are correct. 0.17.0 removed the Buzz\Message\Response. Instead we use PSR7 requests and responses. Until PSR17 (message factories) are stable we use nyholm/psr7 as default implementation.

We also removed all setters for options. Instead all clients takes an array as first constructor argument. See https://github.com/kriswallsmith/Buzz/blob/master/doc/client.md

Also, see the flex recipe: https://github.com/symfony/recipes-contrib/blob/master/kriswallsmith/buzz/0.17/config/packages/buzz.yaml

@Nyholm thx - seems to work. would have been nice if the changelog - that mentions the BC changes, showed some samples on how to use it from now on!

anyway keep up the good work 🍺