public function withoutMiddleware(MiddlewareInterface $middleware)
    {
        if (!($middleware instanceof ServerMiddlewareInterface)) {
            throw new \InvalidArgumentException('ServerMiddlewareInterface request expected.');
        }

        foreach ($this->middlewares as $k => $m) {
            if ($m === $middleware) {
                unset($this->middlewares[$k]);
                break;
            }
        }
        // breaking **** immutability by intention ^^~>
        return $this;
    }
public function withoutMiddleware(MiddlewareInterface $middleware)
    {
        if (!($middleware instanceof ServerMiddlewareInterface)) {
            throw new \InvalidArgumentException('ServerMiddlewareInterface request expected.');
        }

        foreach ($this->middlewares as $k => $m) {
            if ($m === $middleware) {
                unset($this->middlewares[$k]);
                break;
            }
        }
        // breaking **** immutability by intention ^^~>
        return $this;
    }
public function withoutMiddleware ( MiddlewareInterface $ middleware ) { if ( ! ( $ middleware instanceof ServerMiddlewareInterface ) ) { throw new \ InvalidArgumentException ( 'ServerMiddlewareInterface request expected.' ) ; } foreach ( $ this -> middlewares as $ k => $ m ) { if ( $ m === $ middleware ) { unset ( $ this -> middlewares [ $ k ] ) ; break ; } } // breaking **** immutability by intention ^^~> return $ this ; }
Return an instance without the specified middleware.
This method MUST be implemented in such a way as to retain the
immutability of the stack, and MUST return an instance that does not
contain the specified middleware.

@param MiddlewareInterface $middleware
@return self
Return an instance without the specified middleware . This method MUST be implemented in such a way as to retain the immutability of the stack and MUST return an instance that does not contain the specified middleware .