@param \Psr\Http\Message\ServerRequestInterface     $request
@param \Psr\Http\Server\RequestHandlerInterface $handler

@return \Psr\Http\Message\ResponseInterface
350349
public function process(ServerRequestInterface $request, RequestHandlerInterface $handler): ResponseInterface
    {
        /* @var ValidatorInterface $validator */
        $serviceHandler = $request->getAttribute(RouterMiddleware::ATTRIBUTE);
        $serviceData    = $request->getAttribute(PackerMiddleware::ATTRIBUTE_DATA);
        $validator      = App::getBean(ServiceValidator::class);

        list($className, $validatorKey) = $serviceHandler;
        $collector = ValidatorCollector::getCollector();
        if (isset($collector[$className][$validatorKey]['validator'])) {
            $validators = $collector[$className][$validatorKey]['validator'];
            $validator->validate($validators, $serviceHandler, $serviceData);
        }

        return $handler->handle($request);
    }
279601
public function process(ServerRequestInterface $request, RequestHandlerInterface $handler): ResponseInterface
    {
        $serviceHandler = $request->getAttribute(RouterMiddleware::ATTRIBUTE);

        /* @var \Swoft\Rpc\Server\Router\HandlerAdapter $handlerAdapter */
        $handlerAdapter = App::getBean('serviceHandlerAdapter');
        $response       = $handlerAdapter->doHandler($request, $serviceHandler);

        return $response;
    }
20440
public function process(ServerRequestInterface $request, RequestHandlerInterface $handler): ResponseInterface
    {
        $errorPageConfig = Config::getInstance()->get('errorPage');
        $controllerClass = '\\app\\Controllers\\' . $errorPageConfig[0];
        $route = new Route('404', $errorPageConfig[0], $errorPageConfig[1]);
        $controller = new $controllerClass($route, $request);
        $response = new Response;
        ob_start();
        $controller->execute();
        $responseController = ob_get_clean();
        $response->getBody()->write($responseController);
        $response = $response->withStatus(404);
        $logger = new Logger();
        $logger->info('Error 404, NotFoundMiddleware');
        return $response;
    }
648332
public function process(ServerRequestInterface $request, RequestHandlerInterface $handler) : ResponseInterface
    {
        $this->startTransaction();
        $response = $handler->handle($request);
        $this->endTransaction();

        return $response;
    }
240825
public function process(ServerRequestInterface $request, RequestHandlerInterface $handler): ResponseInterface
	{
		[
			'Request-Type' => $type,
			'Response-Headers' => $headers,
		] = $this->analyze($request);

		switch ($type) {
			case self::ERROR_NO_HOST_HEADER:
			case self::ERROR_ORIGIN_NOT_ALLOWED:
			case self::ERROR_METHOD_NOT_SUPPORTED:
			case self::ERROR_HEADERS_NOT_SUPPORTED:
				return Factory::response(403);

			case self::TYPE_REQUEST_OUT_OF_CORS_SCOPE:
				return $handler->handle($request);

			case self::TYPE_PRE_FLIGHT_REQUEST:
				$response = Factory::response(200);

				return self::withCorsHeaders($response, $headers);

			default:
				$response = $handler->handle($request);

				return self::withCorsHeaders($response, $headers);
		}
	}
1232631
public function process(RequestInterface $request, RequestHandlerInterface $handler)
    {
        $url = $request->getNamedParam('server', 'REQUEST_URI');
        $method = $request->getNamedParam('server', 'REQUEST_METHOD');

        $this->router->route($url, $method);

        return $handler->handle($request);
    }
105765
public function process(ServerRequestInterface $request, RequestHandlerInterface $handler): ResponseInterface
    {
        define('WT_DATA_DIR', realpath(Site::getPreference('INDEX_DIRECTORY', 'data/')) . DIRECTORY_SEPARATOR);

        $filesystem = new Filesystem(new CachedAdapter(new Local(WT_DATA_DIR), new Memory()));
        app()->instance(FilesystemInterface::class, $filesystem);

        return $handler->handle($request);
    }
904370
public function process(ServerRequestInterface $request, RequestHandlerInterface $handler): ResponseInterface
    {
        $requestPath = $this->getNormalizedPath($request);

        foreach ($this->middlewares as $pathPrefix => $middleware) {
            if (strpos($requestPath, $pathPrefix) === 0) {
                return $handler->handle(
                    $this->unprefixedRequest($request, $pathPrefix)
                        ->withAttribute($this->attribute, $middleware)
                );
            }
        }

        if ($this->continueOnError) {
            return $handler->handle($request);
        }

        return $this->responseFactory->createResponse(404);
    }
71889
public function process(ServerRequestInterface $request, RequestHandlerInterface $handler): ResponseInterface
    {
        $this->migration_service
            ->updateSchema('\Fisharebest\Webtrees\Schema', 'WT_SCHEMA_VERSION', Webtrees::SCHEMA_VERSION);

        return $handler->handle($request);
    }
706818
public function process(ServerRequestInterface $request, RequestHandlerInterface $handler): ResponseInterface
    {
        $response = new \GuzzleHttp\Psr7\Response();
        $controller = $this->getController(
            new \phpGone\Router\Routeur(),
            $request
        );
        if (is_null($controller)) {
            return $handler->handle($request);
        }
        ob_start();
        $controller->execute();
        $responseController = ob_get_clean();
        $response->getBody()->write($responseController);
        return $response;
    }
233054
public function process(RequestInterface $request, RequestHandlerInterface $handler)
    {
        $response = $handler->handle($request);

        $response->body()->write('World!');

        return $response;
    }
1083525
public function process(ServerRequestInterface $request, RequestHandlerInterface $handler): ResponseInterface
    {
        $request = $request->withAttribute(self::ORIGINAL_REQUEST, $request);

        set_error_handler($this->createErrorHandler());

        try {
            $response = $handler->handle($request);
        } catch (Throwable $exception) {
            $response = $this->handleThrowable($exception, $request);
        }

        restore_error_handler();

        return $response;
    }
261021
public function process(ServerRequestInterface $request, RequestHandlerInterface $handler): ResponseInterface
    {
        $response = $handler->handle($request);
        $response = $this->responseView($request, $response);

        return $response;
    }
838116
public function process(ServerRequestInterface $request, RequestHandlerInterface $handler): ResponseInterface
    {
        $uuid = UuidFactory::uuid4()->toString();

        return $handler->handle($request->withHeader($this->header, $uuid))
            ->withHeader($this->header, $uuid);
    }
342431
public function process(ServerRequestInterface $request, RequestHandlerInterface $handler): ResponseInterface
    {
        if ($this->cors->onlyPreflight()) {
            if ($this->cors->isPreflightRequest('psr-7', $request)) {
                if (!(($response = $this->getResponse()) instanceof ResponseInterface)) {
                    $response = $handler->handle($request);
                }

                return $this
                    ->handle($request, $response)
                    ->withStatus(204);
            }

            return $handler->handle($request);
        }

        return $this->handle($request, $handler->handle($request));
    }
1037646
protected function setHandler(ServerRequestInterface $request, $handler): ServerRequestInterface
    {
        return $request->withAttribute($this->attribute, $handler);
    }
1145100
public function process(ServerRequestInterface $request, RequestHandlerInterface $handler): ResponseInterface
    {
        $httpHandler = $request->getAttribute(AttributeEnum::ROUTER_ATTRIBUTE);
        $info = $httpHandler[2];

        $actionMiddlewares = [];
        if (isset($info['handler']) && \is_string($info['handler'])) {
            // Extract action info from router handler
            $exploded             = explode('@', $info['handler']);
            $controllerClass      = $exploded[0] ?? '';
            $action               = $exploded[1] ?? '';

            $collector = MiddlewareCollector::getCollector();
            $collectedMiddlewares = $collector[$controllerClass]['middlewares']??[];

            // Get group middleware from Collector
            if ($controllerClass) {
                $collect = $collectedMiddlewares['group'] ?? [];
                $collect && $actionMiddlewares = array_merge($actionMiddlewares, $collect);
            }
            // Get the specified action middleware from Collector
            if ($action) {
                $collect = $collectedMiddlewares['actions'][$action]??[];
                $collect && $actionMiddlewares = array_merge($actionMiddlewares, $collect ?? []);
            }
        }
        if (!empty($actionMiddlewares) && $handler instanceof RequestHandler) {
            $handler->insertMiddlewares($actionMiddlewares);
        }

        return $handler->handle($request);
    }