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

Breadcrumb

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

function Middleware::mapRequest

Middleware that applies a map function to the request before passing to the next handler.

Parameters

callable $fn Function that accepts a RequestInterface and returns: a RequestInterface.

File

vendor/guzzlehttp/guzzle/src/Middleware.php, line 244

Class

Middleware
Functions used to create and wrap handlers with handler middleware.

Namespace

GuzzleHttp

Code

public static function mapRequest(callable $fn) : callable {
    return static function (callable $handler) use ($fn) : callable {
        return static function (RequestInterface $request, array $options) use ($handler, $fn) {
            return $handler($fn($request), $options);
        };
    };
}

API Navigation

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