src/ArtaxServiceBuilder/Service/Oauth1.php
public function signRequest(Request $request) {

        $requestParams = $this->getRequestParamsToSign($request);
        $oauthParams = $this->getOauthParams($this->generateNonce($request));
        $params = array_merge($requestParams, $oauthParams);

        ksort($params);
        
        $baseString = $this->createBaseString(
            $request,
            $this->prepareParameters($params)
        );

        uksort($oauthParams, 'strcmp');

        $oauthParams['oauth_signature'] = $this->getSignature($baseString, $params);

        if ($this->oauthConfig->request_method === self::REQUEST_METHOD_HEADER) {
            return $this->createHeaderSignedRequest($request, $oauthParams);
        }

        if ($this->oauthConfig->request_method === self::REQUEST_METHOD_QUERY) {
            return $this->createQuerySignedRequest($request, $oauthParams);
        }

        throw new ArtaxServiceException(sprintf(
            'Invalid request_method "%s"',
            $this->oauthConfig->request_method
        ));
    }
public function signRequest(Request $request) {

        $requestParams = $this->getRequestParamsToSign($request);
        $oauthParams = $this->getOauthParams($this->generateNonce($request));
        $params = array_merge($requestParams, $oauthParams);

        ksort($params);
        
        $baseString = $this->createBaseString(
            $request,
            $this->prepareParameters($params)
        );

        uksort($oauthParams, 'strcmp');

        $oauthParams['oauth_signature'] = $this->getSignature($baseString, $params);

        if ($this->oauthConfig->request_method === self::REQUEST_METHOD_HEADER) {
            return $this->createHeaderSignedRequest($request, $oauthParams);
        }

        if ($this->oauthConfig->request_method === self::REQUEST_METHOD_QUERY) {
            return $this->createQuerySignedRequest($request, $oauthParams);
        }

        throw new ArtaxServiceException(sprintf(
            'Invalid request_method "%s"',
            $this->oauthConfig->request_method
        ));
    }
TODO make this return a new Request
@param Request $request
@return Request