Page Menu
Home
DevCentral
Search
Configure Global Search
Log In
Files
F10190357
NotificationListener.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
2 KB
Referenced Files
None
Subscribers
None
NotificationListener.php
View Options
<?php
namespace
Nasqueron\Notifications\Listeners
;
use
Nasqueron\Notifications\Events\DockerHubPayloadEvent
;
use
Nasqueron\Notifications\Events\GitHubPayloadEvent
;
use
Nasqueron\Notifications\Events\PhabricatorPayloadEvent
;
use
Nasqueron\Notifications\Jobs\FireDockerHubNotification
;
use
Nasqueron\Notifications\Jobs\FireGitHubNotification
;
use
Nasqueron\Notifications\Jobs\FirePhabricatorNotification
;
class
NotificationListener
{
///
/// Distill services' payloads into notifications
///
/**
* Handles a Docker Hub payload event.
*
* @param DockerHubPayloadEvent $event
* @return void
*/
public
function
onDockerHubPayload
(
DockerHubPayloadEvent
$event
)
{
$job
=
new
FireDockerHubNotification
(
$event
);
$job
->
handle
();
}
/**
* Handles a GitHub payload event.
*
* @param GitHubPayloadEvent $event
* @return void
*/
public
function
onGitHubPayload
(
GitHubPayloadEvent
$event
)
{
$job
=
new
FireGitHubNotification
(
$event
);
$job
->
handle
();
}
/**
* Handles a Phabricator payload event.
*
* @param PhabricatorPayloadEvent $event
* @return void
*/
public
function
onPhabricatorPayload
(
PhabricatorPayloadEvent
$event
)
{
$job
=
new
FirePhabricatorNotification
(
$event
);
$job
->
handle
();
}
///
/// Events listening
///
/**
* Register the listeners for the subscriber.
*
* @param Illuminate\Events\Dispatcher $events
*/
public
function
subscribe
(
\Illuminate\Events\Dispatcher
$events
)
{
$class
=
'Nasqueron
\N
otifications
\L
isteners
\N
otificationListener'
;
$events
->
listen
(
'Nasqueron
\N
otifications
\E
vents
\D
ockerHubPayloadEvent'
,
"$class@onDockerHubPayload"
);
$events
->
listen
(
'Nasqueron
\N
otifications
\E
vents
\G
itHubPayloadEvent'
,
"$class@onGitHubPayload"
);
$events
->
listen
(
'Nasqueron
\N
otifications
\E
vents
\P
habricatorPayloadEvent'
,
"$class@onPhabricatorPayload"
);
}
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Thu, Jun 26, 05:11 (1 d, 19 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2759850
Default Alt Text
NotificationListener.php (2 KB)
Attached To
Mode
rNOTIF Notifications center
Attached
Detach File
Event Timeline
Log In to Comment