Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. HandlerStack.php

function HandlerStack::resolve

Compose the middleware and handler into a single callable function.

Return value

callable(RequestInterface, array): PromiseInterface

1 call to HandlerStack::resolve()
HandlerStack::__invoke in vendor/guzzlehttp/guzzle/src/HandlerStack.php
Invokes the handler stack as a composed handler

File

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

Class

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

Namespace

GuzzleHttp

Code

public function resolve() : callable {
    if ($this->cached === null) {
        if (($prev = $this->handler) === null) {
            throw new \LogicException('No handler has been specified');
        }
        foreach (\array_reverse($this->stack) as $fn) {
            
            /** @var callable(RequestInterface, array): PromiseInterface $prev */
            $prev = $fn[0]($prev);
        }
        $this->cached = $prev;
    }
    return $this->cached;
}

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal