src/Middleware/MiddlewarePipe.php
public function add(MiddlewareInterface $middleware): self
    {
        $pipe = clone $this;
        array_push($pipe->middlewares, $middleware);
        return $pipe;
    }
public function add(MiddlewareInterface $middleware): self
    {
        $pipe = clone $this;
        array_push($pipe->middlewares, $middleware);
        return $pipe;
    }
public function add ( MiddlewareInterface $ middleware ) : self { $ pipe = clone $ this ; array_push ( $ pipe -> middlewares , $ middleware ) ; return $ pipe ; }
Creates a new pipe with the given middleware connected.

@param MiddlewareInterface $middleware
@return self
Creates a new pipe with the given middleware connected .