src/main/php/ehough/shortstop/impl/decoding/AbstractDecodingChain.php
public final function decode(ehough_shortstop_api_HttpResponse $response)
    {
        $context = new ehough_chaingang_impl_StandardContext();
        $context->put('response', $response);

        $status = $this->_chain->execute($context);

        if ($status === false) {

            return;
        }

        $entity  = $response->getEntity();
        $decoded = $context->get('response');

        $entity->setContent($decoded);
        $entity->setContentLength(strlen($decoded));

        $contentType = $response->getHeaderValue(ehough_shortstop_api_HttpMessage::HTTP_HEADER_CONTENT_TYPE);

        if ($contentType !== null) {

            $entity->setContentType($contentType);
        }

        $response->setEntity($entity);
    }
public final function decode(ehough_shortstop_api_HttpResponse $response)
    {
        $context = new ehough_chaingang_impl_StandardContext();
        $context->put('response', $response);

        $status = $this->_chain->execute($context);

        if ($status === false) {

            return;
        }

        $entity  = $response->getEntity();
        $decoded = $context->get('response');

        $entity->setContent($decoded);
        $entity->setContentLength(strlen($decoded));

        $contentType = $response->getHeaderValue(ehough_shortstop_api_HttpMessage::HTTP_HEADER_CONTENT_TYPE);

        if ($contentType !== null) {

            $entity->setContentType($contentType);
        }

        $response->setEntity($entity);
    }
public final function decode ( ehough_shortstop_api_HttpResponse $ response ) { $ context = new ehough_chaingang_impl_StandardContext ( ) ; $ context -> put ( 'response' , $ response ) ; $ status = $ this -> _chain -> execute ( $ context ) ; if ( $ status === false ) { return ; } $ entity = $ response -> getEntity ( ) ; $ decoded = $ context -> get ( 'response' ) ; $ entity -> setContent ( $ decoded ) ; $ entity -> setContentLength ( strlen ( $ decoded ) ) ; $ contentType = $ response -> getHeaderValue ( ehough_shortstop_api_HttpMessage :: HTTP_HEADER_CONTENT_TYPE ) ; if ( $ contentType !== null ) { $ entity -> setContentType ( $ contentType ) ; } $ response -> setEntity ( $ entity ) ; }
Decodes an HTTP response.

@param ehough_shortstop_api_HttpResponse $response The HTTP response.

@return void
Decodes an HTTP response .