Page MenuHomeDevCentral

FireJenkinsNotification.php
No OneTemporary

FireJenkinsNotification.php

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

File Metadata

Mime Type
text/x-php
Expires
Sat, Oct 11, 20:00 (2 h, 26 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
3063796
Default Alt Text
FireJenkinsNotification.php (1 KB)

Event Timeline