protected function handle($result, $httpCode)
    {
        // Check for non-OK statuses
        $codes = explode(",", static::ACCEPTED_CODES);

        if (!in_array($httpCode, $codes)) {
            // Decode JSON if possible, if this can't be decoded...something fatal went wrong
            // and we will just return the entire body as an exception.
            if ($error = json_decode($result, true)) {
                $error = $error['error'];
            } else {
                $error = $result;
            }

            throw new \Clickatell\ClickatellException($error);
        } else {
            return json_decode($result, true);
        }
    }
protected function handle($result, $httpCode)
    {
        // Check for non-OK statuses
        $codes = explode(",", static::ACCEPTED_CODES);

        if (!in_array($httpCode, $codes)) {
            // Decode JSON if possible, if this can't be decoded...something fatal went wrong
            // and we will just return the entire body as an exception.
            if ($error = json_decode($result, true)) {
                $error = $error['error'];
            } else {
                $error = $result;
            }

            throw new \Clickatell\ClickatellException($error);
        } else {
            return json_decode($result, true);
        }
    }
protected function handle ( $ result , $ httpCode ) { // Check for non-OK statuses $ codes = explode ( "," , static :: ACCEPTED_CODES ) ; if ( ! in_array ( $ httpCode , $ codes ) ) { // Decode JSON if possible, if this can't be decoded...something fatal went wrong // and we will just return the entire body as an exception. if ( $ error = json_decode ( $ result , true ) ) { $ error = $ error [ 'error' ] ; } else { $ error = $ result ; } throw new \ Clickatell \ ClickatellException ( $ error ) ; } else { return json_decode ( $ result , true ) ; } }
Handle CURL response from Clickatell APIs

@param string $result   The API response
@param int    $httpCode The HTTP status code

@throws Exception
@return array
Handle CURL response from Clickatell APIs