Correct Aphlict websocket URI construction after PHP8 compatibility changes
[phabricator.git] / src / applications / diffusion / xaction / DiffusionCommitVerifyTransaction.php
blobf9f19f429035930831dad3897b618921f1f70cc4
1 <?php
3 final class DiffusionCommitVerifyTransaction
4 extends DiffusionCommitAuditTransaction {
6 const TRANSACTIONTYPE = 'diffusion.commit.verify';
7 const ACTIONKEY = 'verify';
9 protected function getCommitActionLabel() {
10 return pht('Request Verification');
13 protected function getCommitActionDescription() {
14 return pht(
15 'Auditors will be asked to verify that concerns have been addressed.');
18 protected function getCommitActionGroupKey() {
19 return DiffusionCommitEditEngine::ACTIONGROUP_COMMIT;
22 public function getIcon() {
23 return 'fa-refresh';
26 public function getColor() {
27 return 'indigo';
30 protected function getCommitActionOrder() {
31 return 600;
34 public function getActionName() {
35 return pht('Requested Verification');
38 public function applyInternalEffects($object, $value) {
39 $object->setAuditStatus(DiffusionCommitAuditStatus::NEEDS_VERIFICATION);
42 protected function validateAction($object, PhabricatorUser $viewer) {
43 if (!$this->isViewerCommitAuthor($object, $viewer)) {
44 throw new Exception(
45 pht(
46 'You can not request verification of this commit because you '.
47 'are not the author.'));
50 if (!$object->isAuditStatusConcernRaised()) {
51 throw new Exception(
52 pht(
53 'You can not request verification of this commit because no '.
54 'auditors have raised concerns with it.'));
58 public function getTitle() {
59 return pht(
60 '%s requested verification of this commit.',
61 $this->renderAuthor());
64 public function getTitleForFeed() {
65 return pht(
66 '%s requested verification of %s.',
67 $this->renderAuthor(),
68 $this->renderObject());
71 public function getTransactionTypeForConduit($xaction) {
72 return 'request-verification';
75 public function getFieldValuesForConduit($object, $data) {
76 return array();