src/RequestBridge.php
final public static function toOAuth2(ServerRequestInterface $request)
    {
        $contents = $request->getBody()->getContents();
        $request->getBody()->rewind();

        return new OAuth2\Request(
            (array)$request->getQueryParams(),
            (array)$request->getParsedBody(),
            $request->getAttributes(),
            $request->getCookieParams(),
            self::convertUploadedFiles($request->getUploadedFiles()),
            $request->getServerParams(),
            $contents,
            self::cleanupHeaders($request->getHeaders())
        );
    }
final public static function toOAuth2(ServerRequestInterface $request)
    {
        $contents = $request->getBody()->getContents();
        $request->getBody()->rewind();

        return new OAuth2\Request(
            (array)$request->getQueryParams(),
            (array)$request->getParsedBody(),
            $request->getAttributes(),
            $request->getCookieParams(),
            self::convertUploadedFiles($request->getUploadedFiles()),
            $request->getServerParams(),
            $contents,
            self::cleanupHeaders($request->getHeaders())
        );
    }
final public static function toOAuth2 ( ServerRequestInterface $ request ) { $ contents = $ request -> getBody ( ) -> getContents ( ) ; $ request -> getBody ( ) -> rewind ( ) ; return new OAuth2 \ Request ( ( array ) $ request -> getQueryParams ( ) , ( array ) $ request -> getParsedBody ( ) , $ request -> getAttributes ( ) , $ request -> getCookieParams ( ) , self :: convertUploadedFiles ( $ request -> getUploadedFiles ( ) ) , $ request -> getServerParams ( ) , $ contents , self :: cleanupHeaders ( $ request -> getHeaders ( ) ) ) ; }
Returns a new instance of \OAuth2\Request based on the given \Slim\Http\Request

@param ServerRequestInterface $request The psr-7 request.

@return OAuth2\Request
Returns a new instance of \ OAuth2 \ Request based on the given \ Slim \ Http \ Request