Correct a parameter order swap in "diffusion.historyquery" for Mercurial
[phabricator.git] / src / applications / diffusion / herald / DiffusionBlockHeraldAction.php
blob32656d78fe291ae421ec7baf0ae55e879f40eaa6
1 <?php
3 final class DiffusionBlockHeraldAction
4 extends HeraldAction {
6 const ACTIONCONST = 'diffusion.block';
8 const DO_BLOCK = 'do.block';
10 public function getHeraldActionName() {
11 return pht('Block push with message');
14 public function getActionGroupKey() {
15 return HeraldApplicationActionGroup::ACTIONGROUPKEY;
18 public function supportsObject($object) {
19 return ($object instanceof PhabricatorRepositoryPushLog);
22 public function supportsRuleType($rule_type) {
23 return ($rule_type != HeraldRuleTypeConfig::RULE_TYPE_PERSONAL);
26 public function applyEffect($object, HeraldEffect $effect) {
27 // This rule intentionally has no direct effect: the caller handles it
28 // after executing Herald.
29 $this->logEffect(self::DO_BLOCK);
32 public function getHeraldActionStandardType() {
33 return self::STANDARD_TEXT;
36 public function renderActionDescription($value) {
37 return pht('Block push with message: %s', $value);
40 protected function getActionEffectMap() {
41 return array(
42 self::DO_BLOCK => array(
43 'icon' => 'fa-stop',
44 'color' => 'red',
45 'name' => pht('Blocked Push'),
50 protected function renderActionEffectDescription($type, $data) {
51 switch ($type) {
52 case self::DO_BLOCK:
53 return pht('Blocked push.');