Page MenuHomeDevCentral

No OneTemporary

diff --git a/app/Analyzers/Phabricator/PhabricatorPayloadAnalyzer.php b/app/Analyzers/Phabricator/PhabricatorPayloadAnalyzer.php
index b00fd62..6d6be8a 100644
--- a/app/Analyzers/Phabricator/PhabricatorPayloadAnalyzer.php
+++ b/app/Analyzers/Phabricator/PhabricatorPayloadAnalyzer.php
@@ -1,77 +1,77 @@
<?php
namespace Nasqueron\Notifications\Analyzers\Phabricator;
use Nasqueron\Notifications\Analyzers\BasePayloadAnalyzer;
use Nasqueron\Notifications\Phabricator\PhabricatorStory;
class PhabricatorPayloadAnalyzer extends BasePayloadAnalyzer {
/**
* The name of the service, used to get specific classes and config
*/
const SERVICE_NAME = "Phabricator";
///
/// Private members
///
/**
* The story
* @var PhabricatorStory
*/
private $story;
///
/// Constructor
///
/**
* Creates a new PhabricatorPayloadAnalyzer instance.
*
* @param string $project
* @param PhabricatorStory $story
*/
public function __construct($project, PhabricatorStory $story) {
$this->project = $project;
$this->story = $story;
$this->loadConfiguration($project);
}
///
/// Qualification of the story
///
/**
* Gets the group for a specific story.
*
* @return string the group, central part of the routing key
*/
public function getGroup () {
// If the payload is about some repository matching a table of
// symbols, we need to sort it to the right group.
foreach ($this->configuration->map as $mapping) {
foreach ($this->story->getProjects() as $project) {
if ($mapping->doesItemBelong($project)) {
return $mapping->group;
}
}
}
// Words
foreach ($this->configuration->map as $mapping) {
if ($mapping->doesStoryBelong($this->story)) {
return $mapping->group;
}
}
// By default, fallback group is the project name or a specified value.
if (empty($this->configuration->defaultGroup)) {
return strtolower($this->project);
}
return $this->configuration->defaultGroup;
}
-}
\ No newline at end of file
+}

File Metadata

Mime Type
text/x-diff
Expires
Mon, Feb 2, 15:13 (1 d, 2 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
3410430
Default Alt Text
(2 KB)

Event Timeline