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