@recaptime-dev's working patches + fork for Phorge, a community fork of Phabricator. (Upstream dev and stable branches are at upstream/main and upstream/stable respectively.) hq.recaptime.dev/wiki/Phorge
phorge phabricator
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

at recaptime-dev/main 59 lines 1.3 kB view raw
1<?php 2 3final class PhabricatorProjectHeraldAdapter extends HeraldAdapter { 4 5 private $project; 6 7 protected function newObject() { 8 return new PhabricatorProject(); 9 } 10 11 public function getAdapterApplicationClass() { 12 return PhabricatorProjectApplication::class; 13 } 14 15 public function getAdapterContentDescription() { 16 return pht('React to projects being created or updated.'); 17 } 18 19 protected function initializeNewAdapter() { 20 $this->project = $this->newObject(); 21 } 22 23 public function supportsApplicationEmail() { 24 return true; 25 } 26 27 public function supportsRuleType($rule_type) { 28 switch ($rule_type) { 29 case HeraldRuleTypeConfig::RULE_TYPE_GLOBAL: 30 case HeraldRuleTypeConfig::RULE_TYPE_PERSONAL: 31 return true; 32 case HeraldRuleTypeConfig::RULE_TYPE_OBJECT: 33 default: 34 return false; 35 } 36 } 37 38 public function setProject(PhabricatorProject $project) { 39 $this->project = $project; 40 return $this; 41 } 42 43 public function getProject() { 44 return $this->project; 45 } 46 47 public function getObject() { 48 return $this->project; 49 } 50 51 public function getAdapterContentName() { 52 return pht('Projects'); 53 } 54 55 public function getHeraldName() { 56 return pht('Project %s', $this->getProject()->getName()); 57 } 58 59}