protected function resolve(ContainerInterface $container, ServerRequestInterface $request, ResponseInterface $response)
    {
        if (class_exists('Zend\Diactoros\ServerRequestFactory')) {
            $response = new ZendResponse;

            $request = ServerRequestFactory::fromGlobals();
        }

        $container->set('Psr\Http\Message\ServerRequestInterface', $request);

        return $container->set('Psr\Http\Message\ResponseInterface', $response);
    }