src/VK/CallbackApi/LongPoll/VKCallbackApiLongPollExecutor.php
private function parseResponse(array $params, TransportClientResponse $response) {
        $this->checkHttpStatus($response);

        $body = $response->getBody();
        $decode_body = $this->decodeBody($body);

        if (isset($decode_body[static::EVENTS_FAILED])) {
            switch ($decode_body[static::EVENTS_FAILED]) {
                case static::ERROR_CODE_INCORRECT_TS_VALUE:
                    $ts = $params[static::PARAM_TS];
                    $msg = '\'ts\' value is incorrect, minimal value is 1, maximal value is ' . $ts;
                    throw new VKLongPollServerTsException($msg);

                case static::ERROR_CODE_TOKEN_EXPIRED:
                    throw new VKLongPollServerKeyExpiredException('Try to generate a new key.');

                default:
                    throw new VKClientException('Unknown LongPollServer exception, something went wrong. ' . $decode_body);
            }
        }

        return $decode_body;
    }
private function parseResponse(array $params, TransportClientResponse $response) {
        $this->checkHttpStatus($response);

        $body = $response->getBody();
        $decode_body = $this->decodeBody($body);

        if (isset($decode_body[static::EVENTS_FAILED])) {
            switch ($decode_body[static::EVENTS_FAILED]) {
                case static::ERROR_CODE_INCORRECT_TS_VALUE:
                    $ts = $params[static::PARAM_TS];
                    $msg = '\'ts\' value is incorrect, minimal value is 1, maximal value is ' . $ts;
                    throw new VKLongPollServerTsException($msg);

                case static::ERROR_CODE_TOKEN_EXPIRED:
                    throw new VKLongPollServerKeyExpiredException('Try to generate a new key.');

                default:
                    throw new VKClientException('Unknown LongPollServer exception, something went wrong. ' . $decode_body);
            }
        }

        return $decode_body;
    }
private function parseResponse ( array $ params , TransportClientResponse $ response ) { $ this -> checkHttpStatus ( $ response ) ; $ body = $ response -> getBody ( ) ; $ decode_body = $ this -> decodeBody ( $ body ) ; if ( isset ( $ decode_body [ static :: EVENTS_FAILED ] ) ) { switch ( $ decode_body [ static :: EVENTS_FAILED ] ) { case static :: ERROR_CODE_INCORRECT_TS_VALUE : $ ts = $ params [ static :: PARAM_TS ] ; $ msg = '\'ts\' value is incorrect, minimal value is 1, maximal value is ' . $ ts ; throw new VKLongPollServerTsException ( $ msg ) ; case static :: ERROR_CODE_TOKEN_EXPIRED : throw new VKLongPollServerKeyExpiredException ( 'Try to generate a new key.' ) ; default : throw new VKClientException ( 'Unknown LongPollServer exception, something went wrong. ' . $ decode_body ) ; } } return $ decode_body ; }
Decodes the LongPoll response and checks its status code and whether it has a failed key.

@param array $params
@param TransportClientResponse $response
@return mixed
@throws VKLongPollServerTsException
@throws VKLongPollServerKeyExpiredException
@throws VKClientException
Decodes the LongPoll response and checks its status code and whether it has a failed key .