private function checkMessageResult($message, \ArrayIterator $recipients)
    {
        $hasDeviceError = false;

        $recipientCount = $recipients->count();

        for ($i = 0; $i <= $recipientCount; $i++) {
            if (isset($message->results[$i]['registration_id'])) {
                $hasDeviceError = true;
                $recipients->offsetGet($i)->setIdentifierToReplaceTo($message->results[$i]['registration_id']);
            }

            if (isset($message->results[$i]['error'])) {
                $hasDeviceError = true;
                $error = $message->results[$i]['error'];
                $this->processError($error, $recipients->offsetGet($i));
            }
        }

        if ($hasDeviceError) {
            throw new InvalidRecipientException("Device identifier error status", $recipients);
        }
    }
private function checkMessageResult($message, \ArrayIterator $recipients)
    {
        $hasDeviceError = false;

        $recipientCount = $recipients->count();

        for ($i = 0; $i <= $recipientCount; $i++) {
            if (isset($message->results[$i]['registration_id'])) {
                $hasDeviceError = true;
                $recipients->offsetGet($i)->setIdentifierToReplaceTo($message->results[$i]['registration_id']);
            }

            if (isset($message->results[$i]['error'])) {
                $hasDeviceError = true;
                $error = $message->results[$i]['error'];
                $this->processError($error, $recipients->offsetGet($i));
            }
        }

        if ($hasDeviceError) {
            throw new InvalidRecipientException("Device identifier error status", $recipients);
        }
    }
private function checkMessageResult ( $ message , \ ArrayIterator $ recipients ) { $ hasDeviceError = false ; $ recipientCount = $ recipients -> count ( ) ; for ( $ i = 0 ; $ i <= $ recipientCount ; $ i ++ ) { if ( isset ( $ message -> results [ $ i ] [ 'registration_id' ] ) ) { $ hasDeviceError = true ; $ recipients -> offsetGet ( $ i ) -> setIdentifierToReplaceTo ( $ message -> results [ $ i ] [ 'registration_id' ] ) ; } if ( isset ( $ message -> results [ $ i ] [ 'error' ] ) ) { $ hasDeviceError = true ; $ error = $ message -> results [ $ i ] [ 'error' ] ; $ this -> processError ( $ error , $ recipients -> offsetGet ( $ i ) ) ; } } if ( $ hasDeviceError ) { throw new InvalidRecipientException ( "Device identifier error status" , $ recipients ) ; } }
Check message result

@param \stdClass $message
@param \ArrayIterator $recipients
Check message result