Page MenuHomeDevCentral

PhabricatorListener.php
No OneTemporary

PhabricatorListener.php

<?php
namespace Nasqueron\Notifications\Listeners;
use Nasqueron\Notifications\Events\GitHubPayloadEvent;
use Nasqueron\Notifications\Jobs\NotifyNewCommitsToDiffusion;
/**
* Listens to events Phabricator is interested by.
*/
class PhabricatorListener {
///
/// GitHub → Phabricator
///
/**
* Handles payload events.
*
* @param GitHubPayloadEvent $event The GitHub payload event
*/
public function handle (GitHubPayloadEvent $event) : void {
if ($event->event === 'push') {
$this->notifyNewCommits($event);
}
}
/**
* Notifies Phabricator there are new commits to pull.
*
* @param GitHubPayloadEvent $event The GitHub payload event
*/
public function notifyNewCommits (GitHubPayloadEvent $event) : void {
$job = new NotifyNewCommitsToDiffusion(
$event->door,
$event->payload->repository->clone_url
);
$job->handle();
}
}

File Metadata

Mime Type
text/x-php
Expires
Sat, Oct 11, 20:07 (4 h, 8 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
3063898
Default Alt Text
PhabricatorListener.php (981 B)

Event Timeline