You are here

public function HandlerStack::__invoke in Zircon Profile 8.0

Same name and namespace in other branches
  1. 8 vendor/guzzlehttp/guzzle/src/HandlerStack.php \GuzzleHttp\HandlerStack::__invoke()

Invokes the handler stack as a composed handler

Parameters

RequestInterface $request:

array $options:

File

vendor/guzzlehttp/guzzle/src/HandlerStack.php, line 63

Class

HandlerStack
Creates a composed Guzzle handler function by stacking middlewares on top of an HTTP handler function.

Namespace

GuzzleHttp

Code

public function __invoke(RequestInterface $request, array $options) {
  if (!$this->cached) {
    $this->cached = $this
      ->resolve();
  }
  $handler = $this->cached;
  return $handler($request, $options);
}