src/ContainerMiddleware.php
public function process(ServerRequestInterface $request, RequestHandlerInterface $handler): ResponseInterface
    {
        $middleware = $this->container->get($this->middleware);

        if ($middleware instanceof MiddlewareInterface) {

            return $middleware->process($request, $handler);

        }

        throw new ContainedMiddlewareTypeException($this->middleware, $middleware);
    }
public function process(ServerRequestInterface $request, RequestHandlerInterface $handler): ResponseInterface
    {
        $middleware = $this->container->get($this->middleware);

        if ($middleware instanceof MiddlewareInterface) {

            return $middleware->process($request, $handler);

        }

        throw new ContainedMiddlewareTypeException($this->middleware, $middleware);
    }
Get a middleware from the container then proxy its ->process() method.

@param \Psr\Http\Message\ServerRequestInterface  $request
@param \Psr\Http\Server\RequestHandlerInterface  $handler
@return \Psr\Http\Message\ResponseInterface
@throws \Ellipse\Middleware\Exceptions\ContainedMiddlewareTypeException