Correct a parameter order swap in "diffusion.historyquery" for Mercurial
[phabricator.git] / src / applications / pholio / herald / HeraldPholioMockAdapter.php
blob5520a60cdcb33102a286a7d4104e4a210956b6e8
1 <?php
3 final class HeraldPholioMockAdapter extends HeraldAdapter {
5 private $mock;
7 public function getAdapterApplicationClass() {
8 return 'PhabricatorPholioApplication';
11 public function getAdapterContentDescription() {
12 return pht('React to mocks being created or updated.');
15 protected function initializeNewAdapter() {
16 $this->mock = $this->newObject();
19 protected function newObject() {
20 return new PholioMock();
23 public function isTestAdapterForObject($object) {
24 return ($object instanceof PholioMock);
27 public function getAdapterTestDescription() {
28 return pht(
29 'Test rules which run when a mock is created or updated.');
32 public function setObject($object) {
33 $this->mock = $object;
34 return $this;
37 public function getObject() {
38 return $this->mock;
41 public function setMock(PholioMock $mock) {
42 $this->mock = $mock;
43 return $this;
46 public function getMock() {
47 return $this->mock;
50 public function getAdapterContentName() {
51 return pht('Pholio Mocks');
54 public function supportsRuleType($rule_type) {
55 switch ($rule_type) {
56 case HeraldRuleTypeConfig::RULE_TYPE_GLOBAL:
57 case HeraldRuleTypeConfig::RULE_TYPE_PERSONAL:
58 return true;
59 case HeraldRuleTypeConfig::RULE_TYPE_OBJECT:
60 default:
61 return false;
65 public function getHeraldName() {
66 return 'M'.$this->getMock()->getID();