Page MenuHomeDevCentral
Paste P235

Explicit variables vs methods calls in methods
ActivePublic

Authored by dereckson on Jan 7 2017, 21:15.
Tags
None
Referenced Files
F250529: Explicit variables vs methods calls in methods
Jan 7 2017, 21:25
F250508: Explicit variables vs methods calls in methods
Jan 7 2017, 21:15
Subscribers
None
/**
* Sends the notification to the broker target for distilled notifications
*
* @param Notification The notification to send
*/
protected function sendNotification(Notification $notification) : void {
$target = Config::get('broker.targets.notifications');
$routingKey = static::getNotificationRoutingKey($notification);
$message = json_encode($notification);
$job = new SendMessageToBroker($target, $routingKey, $message);
$job->handle();
}
/**
* Sends the notification to the broker target for distilled notifications
*
* @param Notification The notification to send
*/
protected function sendNotificationAlt(Notification $notification) : void {
(new SendMessageToBroker(
Config::get('broker.targets.notifications'), // Target
static::getNotificationRoutingKey($notification), // Routing key
json_encode($notification) // Message
))->handle();
}