Differential D20303 Diff 48501 src/applications/project/trigger/PhabricatorProjectTriggerInvalidRule.php
Changeset View
Changeset View
Standalone View
Standalone View
src/applications/project/trigger/PhabricatorProjectTriggerInvalidRule.php
| <?php | <?php | ||||
| final class PhabricatorProjectTriggerInvalidRule | final class PhabricatorProjectTriggerInvalidRule | ||||
| extends PhabricatorProjectTriggerRule { | extends PhabricatorProjectTriggerRule { | ||||
| const TRIGGERTYPE = 'invalid'; | const TRIGGERTYPE = 'invalid'; | ||||
| private $exception; | |||||
| public function setException(Exception $exception) { | |||||
| $this->exception = $exception; | |||||
| return $this; | |||||
| } | |||||
| public function getException() { | |||||
| return $this->exception; | |||||
| } | |||||
| public function getDescription() { | public function getDescription() { | ||||
| return pht( | return pht( | ||||
| 'Invalid rule (of type "%s").', | 'Invalid rule (of type "%s").', | ||||
| $this->getRecord()->getType()); | $this->getRecord()->getType()); | ||||
| } | } | ||||
| public function getSelectControlName() { | public function getSelectControlName() { | ||||
| return pht('(Invalid Rule)'); | return pht('(Invalid Rule)'); | ||||
| Show All 38 Lines | final class PhabricatorProjectTriggerInvalidRule | ||||
| protected function getPHUIXControlType() { | protected function getPHUIXControlType() { | ||||
| return null; | return null; | ||||
| } | } | ||||
| protected function getPHUIXControlSpecification() { | protected function getPHUIXControlSpecification() { | ||||
| return null; | return null; | ||||
| } | } | ||||
| public function getRuleViewLabel() { | |||||
| return pht('Invalid Rule'); | |||||
| } | |||||
| public function getRuleViewDescription($value) { | |||||
| $record = $this->getRecord(); | |||||
| $type = $record->getType(); | |||||
| $exception = $this->getException(); | |||||
| if ($exception) { | |||||
| return pht( | |||||
| 'This rule (of type "%s") is invalid: %s', | |||||
| $type, | |||||
| $exception->getMessage()); | |||||
| } else { | |||||
| return pht( | |||||
| 'This rule (of type "%s") is invalid.', | |||||
| $type); | |||||
| } | |||||
| } | |||||
| public function getRuleViewIcon($value) { | |||||
| return id(new PHUIIconView()) | |||||
| ->setIcon('fa-exclamation-triangle', 'red'); | |||||
| } | |||||
| } | } | ||||