3 final class PhabricatorProjectTriggerInvalidRule
4 extends PhabricatorProjectTriggerRule
{
6 const TRIGGERTYPE
= 'invalid';
10 public function setException(Exception
$exception) {
11 $this->exception
= $exception;
15 public function getException() {
16 return $this->exception
;
19 public function getSelectControlName() {
20 return pht('(Invalid Rule)');
23 protected function isSelectableRule() {
27 protected function assertValidRuleRecordFormat($value) {
31 protected function newDropTransactions($object, $value) {
35 protected function newDropEffects($value) {
39 protected function isValidRule() {
43 protected function newInvalidView() {
45 id(new PHUIIconView())
46 ->setIcon('fa-exclamation-triangle red'),
49 'This is a trigger rule with a valid type ("%s") but an invalid '.
51 $this->getRecord()->getType()),
55 protected function getDefaultValue() {
59 protected function getPHUIXControlType() {
63 protected function getPHUIXControlSpecification() {
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();
78 'This rule (of type "%s") is invalid: %s',
80 $exception->getMessage());
83 'This rule (of type "%s") is invalid.',
88 public function getRuleViewIcon($value) {
89 return id(new PHUIIconView())
90 ->setIcon('fa-exclamation-triangle', 'red');