protected function parseResponse($rawResponse, $infoList, $command)
    {
        $httpStatusCode = isset($infoList['http_code']) ? $infoList['http_code'] : 0;
        $messageList = [
            "HTTP Response Status Code: {$httpStatusCode}",
            WebDriver_Exception_Protocol::getCommandDescription($command)
        ];
        switch ($httpStatusCode) {
            case 0:
                $message = $this->buildResponseErrorMessage("No response or broken.", $messageList);
                throw new WebDriver_NoSeleniumException($message);
            case WebDriver_Http::SUCCESS_OK:
                $decodedJsonList = json_decode($rawResponse, true);
                if ($decodedJsonList === null) {
                    $errorList = ["Can't decode response JSON:", json_last_error_msg()];
                    $message = $this->buildResponseErrorMessage($errorList, $messageList);
                    throw new WebDriver_Exception_Protocol($message);
                }
                if (isset($decodedJsonList['status']) &&
                    !WebDriver_Exception_FailedCommand::isOk($decodedJsonList['status'])) {
                    throw WebDriver_Exception_FailedCommand::factory(
                        $command,
                        $infoList,
                        $rawResponse,
                        $decodedJsonList
                    );
                }
                return $decodedJsonList;
            default:
                if (WebDriver_Http::isError($httpStatusCode)) {
                    throw WebDriver_Exception_Protocol::factory($command, $infoList, $rawResponse);
                }
                $errorMessage = "Unexpected HTTP status code: {$httpStatusCode}";
                $message = $this->buildResponseErrorMessage($errorMessage, $messageList);
                throw new WebDriver_Exception($message);
        }
    }
protected function parseResponse($rawResponse, $infoList, $command)
    {
        $httpStatusCode = isset($infoList['http_code']) ? $infoList['http_code'] : 0;
        $messageList = [
            "HTTP Response Status Code: {$httpStatusCode}",
            WebDriver_Exception_Protocol::getCommandDescription($command)
        ];
        switch ($httpStatusCode) {
            case 0:
                $message = $this->buildResponseErrorMessage("No response or broken.", $messageList);
                throw new WebDriver_NoSeleniumException($message);
            case WebDriver_Http::SUCCESS_OK:
                $decodedJsonList = json_decode($rawResponse, true);
                if ($decodedJsonList === null) {
                    $errorList = ["Can't decode response JSON:", json_last_error_msg()];
                    $message = $this->buildResponseErrorMessage($errorList, $messageList);
                    throw new WebDriver_Exception_Protocol($message);
                }
                if (isset($decodedJsonList['status']) &&
                    !WebDriver_Exception_FailedCommand::isOk($decodedJsonList['status'])) {
                    throw WebDriver_Exception_FailedCommand::factory(
                        $command,
                        $infoList,
                        $rawResponse,
                        $decodedJsonList
                    );
                }
                return $decodedJsonList;
            default:
                if (WebDriver_Http::isError($httpStatusCode)) {
                    throw WebDriver_Exception_Protocol::factory($command, $infoList, $rawResponse);
                }
                $errorMessage = "Unexpected HTTP status code: {$httpStatusCode}";
                $message = $this->buildResponseErrorMessage($errorMessage, $messageList);
                throw new WebDriver_Exception($message);
        }
    }
protected function parseResponse ( $ rawResponse , $ infoList , $ command ) { $ httpStatusCode = isset ( $ infoList [ 'http_code' ] ) ? $ infoList [ 'http_code' ] : 0 ; $ messageList = [ "HTTP Response Status Code: {$httpStatusCode}" , WebDriver_Exception_Protocol :: getCommandDescription ( $ command ) ] ; switch ( $ httpStatusCode ) { case 0 : $ message = $ this -> buildResponseErrorMessage ( "No response or broken." , $ messageList ) ; throw new WebDriver_NoSeleniumException ( $ message ) ; case WebDriver_Http :: SUCCESS_OK : $ decodedJsonList = json_decode ( $ rawResponse , true ) ; if ( $ decodedJsonList === null ) { $ errorList = [ "Can't decode response JSON:" , json_last_error_msg ( ) ] ; $ message = $ this -> buildResponseErrorMessage ( $ errorList , $ messageList ) ; throw new WebDriver_Exception_Protocol ( $ message ) ; } if ( isset ( $ decodedJsonList [ 'status' ] ) && ! WebDriver_Exception_FailedCommand :: isOk ( $ decodedJsonList [ 'status' ] ) ) { throw WebDriver_Exception_FailedCommand :: factory ( $ command , $ infoList , $ rawResponse , $ decodedJsonList ) ; } return $ decodedJsonList ; default : if ( WebDriver_Http :: isError ( $ httpStatusCode ) ) { throw WebDriver_Exception_Protocol :: factory ( $ command , $ infoList , $ rawResponse ) ; } $ errorMessage = "Unexpected HTTP status code: {$httpStatusCode}" ; $ message = $ this -> buildResponseErrorMessage ( $ errorMessage , $ messageList ) ; throw new WebDriver_Exception ( $ message ) ; } }
Returns parsed response.

@param string $rawResponse
@param array $infoList
@param WebDriver_Command $command
@throws WebDriver_Exception
@throws WebDriver_NoSeleniumException
@return array
Returns parsed response .