Page Menu
Home
DevCentral
Search
Configure Global Search
Log In
Files
F3769899
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
2 KB
Referenced Files
None
Subscribers
None
View Options
diff --git a/app/Analyzers/GitHubPayloadAnalyzerConfiguration.php b/app/Analyzers/GitHubPayloadAnalyzerConfiguration.php
index 6c41cb5..f0eef2b 100644
--- a/app/Analyzers/GitHubPayloadAnalyzerConfiguration.php
+++ b/app/Analyzers/GitHubPayloadAnalyzerConfiguration.php
@@ -1,26 +1,26 @@
<?php
namespace Nasqueron\Notifications\Analyzers;
class GitHubPayloadAnalyzerConfiguration {
/**
* The group for organization only events
*
* @var string
*/
public $administrativeGroup;
/**
* The default group to fallback for any event not mapped in another group
*
* @var string
*/
public $defaultGroup;
/**
* An array of RepositoryGroupMapping objects to match repositories & groups
*
* @var RepositoryGroupMapping[]
*/
public $repositoryMapping;
-}
\ No newline at end of file
+}
diff --git a/app/Notifications/GitHubNotification.php b/app/Notifications/GitHubNotification.php
index dbdf6a5..58e56b1 100644
--- a/app/Notifications/GitHubNotification.php
+++ b/app/Notifications/GitHubNotification.php
@@ -1,69 +1,69 @@
<?php
namespace Nasqueron\Notifications\Notifications;
use Nasqueron\Notifications\Analyzers\GitHubPayloadAnalyzer;
use Nasqueron\Notifications\Notification;
class GitHubNotification extends Notification {
/**
* @var GitHubPayloadAnalyzer
*/
private $analyzer = null;
public function __construct ($project, $event, $payload) {
// Straightforward properties
$this->service = "GitHub";
$this->project = $project;
$this->type = $event;
$this->rawContent = $payload;
// Analyzes and fills
$this->group = $this->getGroup();
$this->text = $this->getText();
$this->link = $this->getLink();
}
/**
* Gets analyzer
*/
private function getAnalyzer () {
if ($this->analyzer === null) {
$this->analyzer = new GitHubPayloadAnalyzer(
$this->project,
$this->type,
$this->rawContent
);
}
return $this->analyzer;
}
/**
* Gets the target notificatrion group
*
* @return string the target group for the notification
*/
public function getGroup () {
return $this->getAnalyzer()->getGroup();
}
/**
* Gets the notification text. Intended to convey a short message (thing Twitter or IRC).
*
* @return string
*/
public function getText () {
return $this->getAnalyzer()->getDescription();
}
/**
* Gets the notification URL. Intended to be a widget or icon link.
*
* @return string
*/
public function getLink () {
return $this->getAnalyzer()->getLink();
}
-}
\ No newline at end of file
+}
File Metadata
Details
Attached
Mime Type
text/x-diff
Expires
Mon, Nov 25, 17:49 (11 h, 26 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2260670
Default Alt Text
(2 KB)
Attached To
Mode
rNOTIF Notifications center
Attached
Detach File
Event Timeline
Log In to Comment