Correct a parameter order swap in "diffusion.historyquery" for Mercurial
[phabricator.git] / src / applications / project / trigger / PhabricatorProjectTriggerInvalidRule.php
blob07aa6e079262f1076374d39d05c536998764aa51
1 <?php
3 final class PhabricatorProjectTriggerInvalidRule
4 extends PhabricatorProjectTriggerRule {
6 const TRIGGERTYPE = 'invalid';
8 private $exception;
10 public function setException(Exception $exception) {
11 $this->exception = $exception;
12 return $this;
15 public function getException() {
16 return $this->exception;
19 public function getSelectControlName() {
20 return pht('(Invalid Rule)');
23 protected function isSelectableRule() {
24 return false;
27 protected function assertValidRuleRecordFormat($value) {
28 return;
31 protected function newDropTransactions($object, $value) {
32 return array();
35 protected function newDropEffects($value) {
36 return array();
39 protected function isValidRule() {
40 return false;
43 protected function newInvalidView() {
44 return array(
45 id(new PHUIIconView())
46 ->setIcon('fa-exclamation-triangle red'),
47 ' ',
48 pht(
49 'This is a trigger rule with a valid type ("%s") but an invalid '.
50 'value.',
51 $this->getRecord()->getType()),
55 protected function getDefaultValue() {
56 return null;
59 protected function getPHUIXControlType() {
60 return null;
63 protected function getPHUIXControlSpecification() {
64 return null;
67 public function getRuleViewLabel() {
68 return pht('Invalid Rule');
71 public function getRuleViewDescription($value) {
72 $record = $this->getRecord();
73 $type = $record->getType();
75 $exception = $this->getException();
76 if ($exception) {
77 return pht(
78 'This rule (of type "%s") is invalid: %s',
79 $type,
80 $exception->getMessage());
81 } else {
82 return pht(
83 'This rule (of type "%s") is invalid.',
84 $type);
88 public function getRuleViewIcon($value) {
89 return id(new PHUIIconView())
90 ->setIcon('fa-exclamation-triangle', 'red');