Page MenuHomeDevCentral

FireDockerHubNotification.php
No OneTemporary

FireDockerHubNotification.php

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

File Metadata

Mime Type
text/x-php
Expires
Sat, Oct 11, 20:05 (8 h, 19 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
3063876
Default Alt Text
FireDockerHubNotification.php (1 KB)

Event Timeline