src/Graviton/ProxyBundle/Service/TransformationHandler.php
public function transformRequest($api, $endpoint, Request $requestIn, Request $requestOut)
    {
        $transformations = $this->getRequestTransformations($api, $endpoint);

        if (!empty($transformations)) {
            foreach ($transformations as $transformation) {
                $transformedRequest = $transformation->transformRequest($requestIn, $requestOut);
                $requestOut = $transformedRequest instanceof Request ? $transformedRequest : $requestOut;
            }

            return $requestOut;
        }

        // TODO [taafeba2]: add logging
        return $requestOut;
    }
public function transformRequest($api, $endpoint, Request $requestIn, Request $requestOut)
    {
        $transformations = $this->getRequestTransformations($api, $endpoint);

        if (!empty($transformations)) {
            foreach ($transformations as $transformation) {
                $transformedRequest = $transformation->transformRequest($requestIn, $requestOut);
                $requestOut = $transformedRequest instanceof Request ? $transformedRequest : $requestOut;
            }

            return $requestOut;
        }

        // TODO [taafeba2]: add logging
        return $requestOut;
    }
public function transformRequest ( $ api , $ endpoint , Request $ requestIn , Request $ requestOut ) { $ transformations = $ this -> getRequestTransformations ( $ api , $ endpoint ) ; if ( ! empty ( $ transformations ) ) { foreach ( $ transformations as $ transformation ) { $ transformedRequest = $ transformation -> transformRequest ( $ requestIn , $ requestOut ) ; $ requestOut = $ transformedRequest instanceof Request ? $ transformedRequest : $ requestOut ; } return $ requestOut ; } // TODO [taafeba2]: add logging return $ requestOut ; }
Applies all transformations defined for the given API and endpoint on a request.

@param  string  $api        The API name
@param  string  $endpoint   The endpoint
@param  Request $requestIn  The original request object.
@param  Request $requestOut The request object to use for transformations
@return Request The transformed request
@throws TransformationException
Applies all transformations defined for the given API and endpoint on a request .