public static function build(
        $content,
        ExecutionInfos $infos,
        Request\AbstractRequest $request
    ) {
        $response = new Response($request);
        $response->setStatus($infos->status);
        $response->setTransactionTime($infos->transactionTime);
        $response->setExecutionInfos($infos);

        //Populate request headers with all really sent headers
        if (!empty($infos->headers)) {
            self::parseHeaders(
                $infos->headers,
                $request
            );
        }

        //Headers are returned with content, so we extract it
        $content = self::parseHeaders($content, $response);

        $response->setBody($content);

        return $response;
    }
public static function build(
        $content,
        ExecutionInfos $infos,
        Request\AbstractRequest $request
    ) {
        $response = new Response($request);
        $response->setStatus($infos->status);
        $response->setTransactionTime($infos->transactionTime);
        $response->setExecutionInfos($infos);

        //Populate request headers with all really sent headers
        if (!empty($infos->headers)) {
            self::parseHeaders(
                $infos->headers,
                $request
            );
        }

        //Headers are returned with content, so we extract it
        $content = self::parseHeaders($content, $response);

        $response->setBody($content);

        return $response;
    }
public static function build ( $ content , ExecutionInfos $ infos , Request \ AbstractRequest $ request ) { $ response = new Response ( $ request ) ; $ response -> setStatus ( $ infos -> status ) ; $ response -> setTransactionTime ( $ infos -> transactionTime ) ; $ response -> setExecutionInfos ( $ infos ) ; //Populate request headers with all really sent headers if ( ! empty ( $ infos -> headers ) ) { self :: parseHeaders ( $ infos -> headers , $ request ) ; } //Headers are returned with content, so we extract it $ content = self :: parseHeaders ( $ content , $ response ) ; $ response -> setBody ( $ content ) ; return $ response ; }
Build a new reponse object from handle execution result
@param  string                  $content Response content
@param  ExecutionInfos          $infos   Execution details
@param  Request\AbstractRequest $request
@return Response
Build a new reponse object from handle execution result