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

Breadcrumb

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

function HandlerStack::remove

Remove a middleware by instance or name from the stack.

Parameters

callable|string $remove Middleware to remove by instance or name.:

File

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

Class

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

Namespace

GuzzleHttp

Code

public function remove($remove) : void {
    if (!is_string($remove) && !is_callable($remove)) {
        trigger_deprecation('guzzlehttp/guzzle', '7.4', 'Not passing a callable or string to %s::%s() is deprecated and will cause an error in 8.0.', __CLASS__, __FUNCTION__);
    }
    $this->cached = null;
    $idx = \is_callable($remove) ? 0 : 1;
    $this->stack = \array_values(\array_filter($this->stack, static function ($tuple) use ($idx, $remove) {
        return $tuple[$idx] !== $remove;
    }));
}

API Navigation

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