<commit_before><?php
namespace CodeDay\Clear\Services;

use CodeDay\Clear\Models\Batch\Event;
use CodeDay\Clear\Models\Batch\Event\Registration;

class Notifications {
  public static function SendNotificationsForAnnouncement($announcement) {
    $event = $announcement->event;
    $registrations = $event->registrations;

    foreach($registrations as $registration) {
      $devices = $registration->devices;

      foreach($devices as $device) {
        switch($device->service) {
          case "messenger":
            FacebookMessenger::SendMessage("An announcement from the CodeDay organizers:\n\n" . $announcement->body, $device->token);
            break;
          case "sms":
            Telephony\Sms::send($device->token, "CodeDay Announcement: " . $announcement->body);
            break;
          case "app":
            // TODO companion implementation
            break;
        }
      }
    }

    $job->delete();
  }
}<commit_msg>Get rid of some bad no-no code<commit_after><?php
namespace CodeDay\Clear\Services;

use CodeDay\Clear\Models\Batch\Event;
use CodeDay\Clear\Models\Batch\Event\Registration;

class Notifications {
  public static function SendNotificationsForAnnouncement($announcement) {
    $event = $announcement->event;
    $registrations = $event->registrations;

    foreach($registrations as $registration) {
      $devices = $registration->devices;

      foreach($devices as $device) {
        switch($device->service) {
          case "messenger":
            FacebookMessenger::SendMessage("An announcement from the CodeDay organizers:\n\n" . $announcement->body, $device->token);
            break;
          case "sms":
            Telephony\Sms::send($device->token, "CodeDay Announcement: " . $announcement->body);
            break;
          case "app":
            // TODO companion implementation
            break;
        }
      }
    }
  }
}
{'fraction_non_alphanumeric': 0.12170706006322445, 'fraction_numerical': 0.0, 'mean_word_length': 2.658959537572254, 'pattern_counts': {'":': 6, '<': 5, '<?xml version=': 0, '>': 20, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6249528', 'n_tokens_mistral': 539, 'n_tokens_neox': 524, 'n_words': 107}