Page MenuHomeDevCentral

FireGitHubNotification.php
No OneTemporary

FireGitHubNotification.php

<?php
namespace Nasqueron\Notifications\Jobs;
use Nasqueron\Notifications\Events\GitHubPayloadEvent;
use Nasqueron\Notifications\Events\NotificationEvent;
use Nasqueron\Notifications\Notifications\GitHubNotification;
use Illuminate\Support\Facades\Event;
class FireGitHubNotification extends Job {
/**
* @var GitHubPayloadEvent
*/
private $event;
/**
* Initializes a new instance of FireGitHubNotification
*
* @param GitHubPayloadEvent $event The event to notify
*/
public function __construct (GitHubPayloadEvent $event) {
$this->event = $event;
}
///
/// Task
///
/**
* Executes the job.
*/
public function handle() : void {
$notification = $this->createNotification();
Event::dispatch(new NotificationEvent($notification));
}
protected function createNotification() : GitHubNotification {
return new GitHubNotification(
$this->event->door, // project
$this->event->event, // event type
$this->event->payload // raw content
);
}
}

File Metadata

Mime Type
text/x-php
Expires
Tue, May 13, 16:50 (21 h, 3 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2644206
Default Alt Text
FireGitHubNotification.php (1 KB)

Event Timeline