@param ReactRequest $reactRequest

@return ServerRequestInterface
772912
private function transformServerRequest(ReactRequest $reactRequest)
    {
        return $this->psr7Factory->createServerRequest(
            $this->transformServerParams($reactRequest),
            $this->transformUpladedFiles($reactRequest),
            $this->transformUri($reactRequest),
            $reactRequest->getMethod(),
            $this->transformBody($reactRequest),
            $reactRequest->getHeaders()
        )
            ->withParsedBody($reactRequest->getPost())
            ->withCookieParams($this->transformCookies($reactRequest))
            ->withProtocolVersion($reactRequest->getHttpVersion())
        ;
    }
73436
protected function _getService(ServerRequest $request)
    {
        if ($this->_service !== null) {
            return $this->_service;
        }

        $serviceConfig = $this->getConfig('serviceConfig');
        if (empty($serviceConfig)) {
            Configure::load('social_auth');
            $serviceConfig = Configure::consume('SocialAuth');
        }

        $serviceConfig['redirectUri'] = Router::url([
            'plugin' => 'ADmad/SocialAuth',
            'controller' => 'Auth',
            'action' => 'callback',
        ], true);

        $request->getSession()->start();

        $httpClient = $this->getConfig('httpClient');
        if (is_string($httpClient)) {
            $httpClient = new $httpClient();
        }

        $this->_service = new Service(
            $httpClient,
            new Session(),
            $serviceConfig
        );

        return $this->_service;
    }
178066
public function dispatch(ServerRequestInterface $request)
    {
        parse_str($request->getUri()->getQuery(), $args);
        $uri = '/';
        if (isset($args['page'])) {
            $uri .= $args['page'];
        }

        return $this->createDispatcher()->dispatch(
            $request->getMethod(),
            $uri
        );
    }
725965
private function createRequest(InternalRequestInterface $internalRequest)
    {
        return new Request(
            $internalRequest->getMethod(),
            $internalRequest->getUri(),
            $this->prepareHeaders($internalRequest),
            $this->prepareBody($internalRequest),
            $internalRequest->getProtocolVersion()
        );
    }
1014203
public function dispatchRequest(ServerRequestInterface $request) : ResponseInterface
    {
        $match = $this->dispatch($request->getMethod(), $request->getUri()->getPath());

        switch ($match[0]) {
            case FastRoute::NOT_FOUND:
                $this->setNotFoundDecoratorMiddleware();
                break;
            case FastRoute::METHOD_NOT_ALLOWED:
                $allowed = (array) $match[1];
                $this->setMethodNotAllowedDecoratorMiddleware($allowed);
                break;
            case FastRoute::FOUND:
                $match[1]->setVars($match[2]);
                $this->setFoundMiddleware($match[1]);
                break;
        }

        return $this->handle($request);
    }
744087
public function modify(ServerRequestInterface $request) : ServerRequestInterface
    {
        /** @var ServerRequestModifierInterface $modifier */
        foreach ($this->collection as $modifier) {
            $request = $modifier->modify($request);
        }

        return $request;
    }
1009634
public function wizard(ServerRequestInterface $request): ResponseInterface
    {
        $continue = $request->getQueryParams()['continue'] ?? '';

        $title = I18N::translate('Upgrade wizard');

        if ($continue === '1') {
            return $this->viewResponse('admin/upgrade/steps', [
                'steps' => $this->wizardSteps(),
                'title' => $title,
            ]);
        }

        return $this->viewResponse('admin/upgrade/wizard', [
            'current_version' => Webtrees::VERSION,
            'latest_version'  => $this->upgrade_service->latestVersion(),
            'title'           => $title,
        ]);
    }
1195658
public function handle(ServerRequestInterface $request): ResponseInterface
    {
        return $this->middleware->process($request, $this->delegate);
    }
1331261
public function handleRequest(ServerRequestInterface $request)
    {
        $applicationEvent = $this->getApplicationEvent();
        $applicationEvent->setName(self::EVENT_REQUEST_RECEIVED);
        $this->emit($applicationEvent, $request);

        return $applicationEvent->getRequest();
    }
353341
public function handle(ServerRequestInterface $request): ResponseInterface
    {
        if (false === $this->booted) {
            $this->boot();
        }

        try {
            return $this->pipe->handle($request);
        } catch (Exception $e) {
            $this->getContainer()->get('logger')->error($e);
        }
    }
625495
public function handle(ServerRequestInterface $request): ResponseInterface
    {
        $language = $request->getParsedBody()['language'];

        Session::put('language', $language);

        $this->user->setPreference('language', $language);

        return response('', self::STATUS_NO_CONTENT);
    }
787838
public static function createFromServerRequest(ServerRequestInterface $request)
    {
        $data = $request->getCookieParams();
        $cookies = [];
        foreach ($data as $name => $value) {
            $cookies[] = new Cookie($name, $value);
        }

        return new static($cookies);
    }
1202864
public function updateMenus(ServerRequestInterface $request): ResponseInterface
    {
        $modules = $this->module_service->findByInterface(ModuleMenuInterface::class, true);

        $this->updateStatus($modules, $request);
        $this->updateOrder($modules, 'menu_order', $request);
        $this->updateAccessLevel($modules, ModuleMenuInterface::class, $request);

        return redirect(route('menus'));
    }
665117
public function fromRequest(HttpRequestInterface $request)
    {
        return $this->createRequest(
            $request->getMethod(),
            $request->getUri(),
            $request->getHeaders(),
            JsonRpc\json_decode((string) $request->getBody(), true) ?: []
        );
    }
142141
private function transformRequest(ReactRequest $reactRequest)
    {
        return $this->psr7Factory->createRequest(
            $this->transformUri($reactRequest),
            $reactRequest->getMethod(),
            $this->transformBody($reactRequest),
            $reactRequest->getHeaders()
        )
            ->withProtocolVersion($reactRequest->getHttpVersion())
            ;
    }
1109249
public function edit(ServerRequestInterface $request)
    {
        if ($this->isReadOnly()) {
            return new NotFoundStatusResponse();
        }

        if ($this->active_object && $this->active_object->isLoaded()) {
            $authenticated_user = $this->getAuthenticatedUser($request);

            if ($this->shouldCheckPermissions() && !$this->canEdit($this->active_object, $authenticated_user)) {
                return new ForbiddenStatusResponse();
            }

            $request_body = $request->getParsedBody();

            if (empty($request_body)) {
                $request_body = [];
            }

            if ($this->requestBodyContainsProtectedFields($this->active_object, $request_body)) {
                return new BadRequestStatusResponse();
            }

            $this->cleanUpRequestBodyForEdit($request_body, $authenticated_user);

            try {
                return $this->pool->modify($this->active_object, $request_body);
            } catch (ValidationException $e) {
                return $e;
            }
        } else {
            return new NotFoundStatusResponse();
        }
    }
963927
public static function convert(ServerRequestInterface $serverRequest)
    {
        $stream = fopen('php://temp', 'rw');

        foreach ($serverRequest->getHeaders() as $key => $values) {
            foreach ($values as $value) {
                fwrite($stream, "$key: $value\r\n");
            }
        }
        fwrite($stream, "\r\n");

        $body = $serverRequest->getBody();
        $body->rewind();

        while (!$body->eof()) {
            fwrite($stream, $body->read(1024));
        }

        rewind($stream);

        return new StreamedPart($stream);
    }