protected function parseSendResults($result, array $extra_result_data = array())
    {
        $result = trim($result);

        $this->checkForUnrecoverableError($result);

        if (!$this->isMessageSent($result)) {
            return array_merge($this->getDefaults(), $extra_result_data);
        }

        // The message was successfully sent!
        $sms_data = array(
            'status' => ResultInterface::STATUS_SENT,
        );
        $arr = explode(' ', $result);
        if (3 === count($arr)) {
            // eg. OK 375055 UR:LO_5
            list($_, $ref) = explode(':', $arr[2]);
            $sms_data['id'] = $arr[1];
            $sms_data['user_ref'] = $ref;
        } elseif (2 === count($arr)) {
            // eg. OK 375056
            $sms_data['id'] = $arr[1];
        }

        return array_merge($this->getDefaults(), $extra_result_data, $sms_data);
    }
protected function parseSendResults($result, array $extra_result_data = array())
    {
        $result = trim($result);

        $this->checkForUnrecoverableError($result);

        if (!$this->isMessageSent($result)) {
            return array_merge($this->getDefaults(), $extra_result_data);
        }

        // The message was successfully sent!
        $sms_data = array(
            'status' => ResultInterface::STATUS_SENT,
        );
        $arr = explode(' ', $result);
        if (3 === count($arr)) {
            // eg. OK 375055 UR:LO_5
            list($_, $ref) = explode(':', $arr[2]);
            $sms_data['id'] = $arr[1];
            $sms_data['user_ref'] = $ref;
        } elseif (2 === count($arr)) {
            // eg. OK 375056
            $sms_data['id'] = $arr[1];
        }

        return array_merge($this->getDefaults(), $extra_result_data, $sms_data);
    }
protected function parseSendResults ( $ result , array $ extra_result_data = array ( ) ) { $ result = trim ( $ result ) ; $ this -> checkForUnrecoverableError ( $ result ) ; if ( ! $ this -> isMessageSent ( $ result ) ) { return array_merge ( $ this -> getDefaults ( ) , $ extra_result_data ) ; } // The message was successfully sent! $ sms_data = array ( 'status' => ResultInterface :: STATUS_SENT , ) ; $ arr = explode ( ' ' , $ result ) ; if ( 3 === count ( $ arr ) ) { // eg. OK 375055 UR:LO_5 list ( $ _ , $ ref ) = explode ( ':' , $ arr [ 2 ] ) ; $ sms_data [ 'id' ] = $ arr [ 1 ] ; $ sms_data [ 'user_ref' ] = $ ref ; } elseif ( 2 === count ( $ arr ) ) { // eg. OK 375056 $ sms_data [ 'id' ] = $ arr [ 1 ] ; } return array_merge ( $ this -> getDefaults ( ) , $ extra_result_data , $ sms_data ) ; }
Parses the data returned by the API for a "send" request.

@param string $result            The raw result string.
@param array  $extra_result_data

@return array
Parses the data returned by the API for a send request .