Use each instead of map

This commit is contained in:
James Brooks
2017-01-04 20:44:00 +00:00
parent c20a66ed48
commit 12b93e1d5b
4 changed files with 7 additions and 7 deletions

View File

@@ -56,7 +56,7 @@ class SendComponentUpdateEmailNotificationHandler
// First notify all global subscribers.
$globalSubscribers = $this->subscriber->isVerified()->isGlobal()->get();
$globalSubscribers->map(function ($subscriber) use ($component, $event) {
$globalSubscribers->each(function ($subscriber) use ($component, $event) {
$subscriber->notify(new ComponentStatusChangedNotification($component, $event->new_status));
});
@@ -71,7 +71,7 @@ class SendComponentUpdateEmailNotificationHandler
return in_array($subscriber->id, $notified);
});
$componentSubscribers->map(function ($subscriber) use ($component, $event) {
$componentSubscribers->each(function ($subscriber) use ($component, $event) {
$subscriber->notify(new ComponentStatusChangedNotification($component, $event->new_status));
});
}

View File

@@ -59,7 +59,7 @@ class SendIncidentEmailNotificationHandler
// First notify all global subscribers.
$globalSubscribers = $this->subscriber->isVerified()->isGlobal()->get();
$globalSubscribers->map(function ($subscriber) use ($incident) {
$globalSubscribers->each(function ($subscriber) use ($incident) {
$subscriber->notify(new NewIncidentNotification($incident));
});
@@ -76,7 +76,7 @@ class SendIncidentEmailNotificationHandler
->get()
->reject(function ($subscriber) use ($notified) {
return in_array($subscriber->id, $notified);
})->map(function ($subscriber) use ($incident) {
})->each(function ($subscriber) use ($incident) {
$subscriber->notify(new NewIncidentNotification($incident));
});
}

View File

@@ -56,7 +56,7 @@ class SendIncidentUpdateEmailNotificationHandler
// First notify all global subscribers.
$globalSubscribers = $this->subscriber->isVerified()->isGlobal()->get();
$globalSubscribers->map(function ($subscriber) use ($update) {
$globalSubscribers->each(function ($subscriber) use ($update) {
$subscriber->notify(new IncidentUpdatedNotification($update));
});
@@ -73,7 +73,7 @@ class SendIncidentUpdateEmailNotificationHandler
->get()
->reject(function ($subscriber) use ($notified) {
return in_array($subscriber->id, $notified);
})->map(function ($subscriber) use ($incident) {
})->each(function ($subscriber) use ($incident) {
$subscriber->notify(new IncidentUpdatedNotification($incident));
});
}

View File

@@ -53,7 +53,7 @@ class SendScheduleEmailNotificationHandler
$schedule = $event->schedule;
// First notify all global subscribers.
$globalSubscribers = $this->subscriber->isVerified()->isGlobal()->get()->map(function ($subscriber) use ($schedule) {
$globalSubscribers = $this->subscriber->isVerified()->isGlobal()->get()->each(function ($subscriber) use ($schedule) {
$subscriber->notify(new NewScheduleNotification($schedule));
});
}