public function buildHandlerStack(): HandlerStack
    {
        static $handler;

        if (!$handler) {
            $handler = $this->handler ?? \GuzzleHttp\choose_handler();
        }

        if ($handler instanceof HandlerStack) {
            $stack = $handler;
        }

        return tap($stack ?? HandlerStack::create(), function ($stack) {
            $stack->push($this->buildBeforeSendingHandler());
        });
    }
public function buildHandlerStack(): HandlerStack
    {
        static $handler;

        if (!$handler) {
            $handler = $this->handler ?? \GuzzleHttp\choose_handler();
        }

        if ($handler instanceof HandlerStack) {
            $stack = $handler;
        }

        return tap($stack ?? HandlerStack::create(), function ($stack) {
            $stack->push($this->buildBeforeSendingHandler());
        });
    }
public function buildHandlerStack ( ) : HandlerStack { static $ handler ; if ( ! $ handler ) { $ handler = $ this -> handler ?? \ GuzzleHttp \ choose_handler ( ) ; } if ( $ handler instanceof HandlerStack ) { $ stack = $ handler ; } return tap ( $ stack ?? HandlerStack :: create ( ) , function ( $ stack ) { $ stack -> push ( $ this -> buildBeforeSendingHandler ( ) ) ; } ) ; }
Create a new Guzzle HandlerStack instance.

@return \GuzzleHttp\HandlerStack
Create a new Guzzle HandlerStack instance .