src/Middleware/MiddlewareStack.php
public function push(MiddlewareInterface $middleware): self
    {
        $stack = clone $this;
        array_unshift($stack->middlewares, $middleware);
        return $stack;
    }
public function push(MiddlewareInterface $middleware): self
    {
        $stack = clone $this;
        array_unshift($stack->middlewares, $middleware);
        return $stack;
    }
public function push ( MiddlewareInterface $ middleware ) : self { $ stack = clone $ this ; array_unshift ( $ stack -> middlewares , $ middleware ) ; return $ stack ; }
Creates a new stack with the given middleware pushed.

@param MiddlewareInterface $middleware
@return self
Creates a new stack with the given middleware pushed .