You are here

public function HandlerStack::unshift in Zircon Profile 8

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

Unshift a middleware to the bottom of the stack.

Parameters

callable $middleware Middleware function:

string $name Name to register for this middleware.:

File

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

Class

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

Namespace

GuzzleHttp

Code

public function unshift(callable $middleware, $name = null) {
  array_unshift($this->stack, [
    $middleware,
    $name,
  ]);
  $this->cached = null;
}