public function send() { $sender = new Sender($this->apiKey); $responseBody = $sender->send($this->message); $response = new Response($this->message, $responseBody); foreach ($response->getUpdate() as $oldId => $newId) { $this->updateRegistrationIds($oldId, $newId); } foreach ($response->getRemove() as $id) { $this->removeInvalidRegistrationId($id); } foreach ($response->getUnavailable() as $id) { $this->unavailableRegistration($id); } return $responseBody; }