src/main/php/ehough/shortstop/impl/decoding/AbstractDecodingChain.php
public final function needsToBeDecoded(ehough_shortstop_api_HttpResponse $response)
    {
        $entity         = $response->getEntity();
        $isDebugEnabled = $this->_logger->isHandling(ehough_epilog_Logger::DEBUG);

        if ($entity === null) {

            if ($isDebugEnabled) {

                $this->_logger->debug('Response contains no entity');
            }

            return false;
        }

        $content = $entity->getContent();

        if ($content == '' || $content == null) {

            if ($isDebugEnabled) {

                $this->_logger->debug('Response entity contains no content');
            }

            return false;
        }

        $expectedHeaderName = $this->getHeaderName();
        $actualHeaderValue  = $response->getHeaderValue($expectedHeaderName);

        if ($actualHeaderValue === null) {

            if ($isDebugEnabled) {

                $this->_logger->debug(sprintf('Response does not contain %s header. No need to decode.', $expectedHeaderName));
            }

            return false;
        }

        if ($isDebugEnabled) {

            $this->_logger->debug(sprintf('Response contains %s header. Will attempt decode.', $expectedHeaderName));
        }

        return true;
    }
public final function needsToBeDecoded(ehough_shortstop_api_HttpResponse $response)
    {
        $entity         = $response->getEntity();
        $isDebugEnabled = $this->_logger->isHandling(ehough_epilog_Logger::DEBUG);

        if ($entity === null) {

            if ($isDebugEnabled) {

                $this->_logger->debug('Response contains no entity');
            }

            return false;
        }

        $content = $entity->getContent();

        if ($content == '' || $content == null) {

            if ($isDebugEnabled) {

                $this->_logger->debug('Response entity contains no content');
            }

            return false;
        }

        $expectedHeaderName = $this->getHeaderName();
        $actualHeaderValue  = $response->getHeaderValue($expectedHeaderName);

        if ($actualHeaderValue === null) {

            if ($isDebugEnabled) {

                $this->_logger->debug(sprintf('Response does not contain %s header. No need to decode.', $expectedHeaderName));
            }

            return false;
        }

        if ($isDebugEnabled) {

            $this->_logger->debug(sprintf('Response contains %s header. Will attempt decode.', $expectedHeaderName));
        }

        return true;
    }
public final function needsToBeDecoded ( ehough_shortstop_api_HttpResponse $ response ) { $ entity = $ response -> getEntity ( ) ; $ isDebugEnabled = $ this -> _logger -> isHandling ( ehough_epilog_Logger :: DEBUG ) ; if ( $ entity === null ) { if ( $ isDebugEnabled ) { $ this -> _logger -> debug ( 'Response contains no entity' ) ; } return false ; } $ content = $ entity -> getContent ( ) ; if ( $ content == '' || $ content == null ) { if ( $ isDebugEnabled ) { $ this -> _logger -> debug ( 'Response entity contains no content' ) ; } return false ; } $ expectedHeaderName = $ this -> getHeaderName ( ) ; $ actualHeaderValue = $ response -> getHeaderValue ( $ expectedHeaderName ) ; if ( $ actualHeaderValue === null ) { if ( $ isDebugEnabled ) { $ this -> _logger -> debug ( sprintf ( 'Response does not contain %s header. No need to decode.' , $ expectedHeaderName ) ) ; } return false ; } if ( $ isDebugEnabled ) { $ this -> _logger -> debug ( sprintf ( 'Response contains %s header. Will attempt decode.' , $ expectedHeaderName ) ) ; } return true ; }
Determines if this response needs to be decoded.

@param ehough_shortstop_api_HttpResponse $response The HTTP response.

@return boolean True if this response should be decoded. False otherwise.
Determines if this response needs to be decoded .