Page MenuHomeDevCentral

Explicit variables vs methods calls in methods

Authored By
dereckson
Jan 7 2017, 21:15
Size
986 B
Referenced Files
None
Subscribers
None

Explicit variables vs methods calls in methods

/**
* This is our gateway specialized 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();
}
/**
* This is our gateway specialized 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();
}

File Metadata

Mime Type
text/plain; charset=utf-8
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
70969
Default Alt Text
Explicit variables vs methods calls in methods (986 B)

Event Timeline