1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-11-23 15:22:41 +01:00

Remove getApplicationObjectTypeName from ApplicationTransactions

Summary:
We can get this out of PHIDType reasonably in all cases and simplify implementation here.

None of these translate correctly anyway so they're basically debugging/development strings.

Test Plan: `grep`, browsed some transactions

Reviewers: btrahan

Reviewed By: btrahan

CC: aran

Differential Revision: https://secure.phabricator.com/D6786
This commit is contained in:
epriestley 2013-08-20 10:04:33 -07:00
parent 8769759c15
commit f034fd80db
21 changed files with 11 additions and 82 deletions

View file

@ -34,10 +34,6 @@ final class PhabricatorAuthProviderConfigTransaction
return null; return null;
} }
public function getApplicationObjectTypeName() {
return pht('authentication provider');
}
public function getIcon() { public function getIcon() {
$old = $this->getOldValue(); $old = $this->getOldValue();
$new = $this->getNewValue(); $new = $this->getNewValue();

View file

@ -17,11 +17,6 @@ final class PhabricatorConfigTransaction
return null; return null;
} }
public function getApplicationObjectTypeName() {
return pht('config');
}
public function getTitle() { public function getTitle() {
$author_phid = $this->getAuthorPHID(); $author_phid = $this->getAuthorPHID();

View file

@ -17,10 +17,6 @@ final class ConpherenceTransaction extends PhabricatorApplicationTransaction {
return new ConpherenceTransactionComment(); return new ConpherenceTransactionComment();
} }
public function getApplicationObjectTypeName() {
return pht('conpherence');
}
public function getNoEffectDescription() { public function getNoEffectDescription() {
switch ($this->getTransactionType()) { switch ($this->getTransactionType()) {
case ConpherenceTransactionType::TYPE_PARTICIPANTS: case ConpherenceTransactionType::TYPE_PARTICIPANTS:

View file

@ -14,8 +14,4 @@ final class DifferentialTransaction extends PhabricatorApplicationTransaction {
return new DifferentialTransactionComment(); return new DifferentialTransactionComment();
} }
public function getApplicationObjectTypeName() {
return pht('revision');
}
} }

View file

@ -17,9 +17,5 @@ final class HeraldRuleTransaction
return new HeraldRuleTransactionComment(); return new HeraldRuleTransactionComment();
} }
public function getApplicationObjectTypeName() {
return pht('rule');
}
} }

View file

@ -21,10 +21,6 @@ final class LegalpadTransaction extends PhabricatorApplicationTransaction {
return new LegalpadTransactionView(); return new LegalpadTransactionView();
} }
public function getApplicationObjectTypeName() {
return pht('document');
}
public function shouldHide() { public function shouldHide() {
$old = $this->getOldValue(); $old = $this->getOldValue();

View file

@ -19,10 +19,6 @@ final class PhabricatorMacroTransaction
return new PhabricatorMacroTransactionComment(); return new PhabricatorMacroTransactionComment();
} }
public function getApplicationObjectTypeName() {
return pht('macro');
}
public function getRequiredHandlePHIDs() { public function getRequiredHandlePHIDs() {
$phids = parent::getRequiredHandlePHIDs(); $phids = parent::getRequiredHandlePHIDs();

View file

@ -22,10 +22,6 @@ final class PhabricatorPasteTransaction
return new PhabricatorPasteTransactionComment(); return new PhabricatorPasteTransactionComment();
} }
public function getApplicationObjectTypeName() {
return pht('paste');
}
public function getRequiredHandlePHIDs() { public function getRequiredHandlePHIDs() {
$phids = parent::getRequiredHandlePHIDs(); $phids = parent::getRequiredHandlePHIDs();

View file

@ -15,9 +15,5 @@ final class PhabricatorUserTransaction
return null; return null;
} }
public function getApplicationObjectTypeName() {
return pht('user');
}
} }

View file

@ -17,10 +17,6 @@ final class PhluxTransaction extends PhabricatorApplicationTransaction {
return null; return null;
} }
public function getApplicationObjectTypeName() {
return pht('variable');
}
public function getTitle() { public function getTitle() {
$author_phid = $this->getAuthorPHID(); $author_phid = $this->getAuthorPHID();

View file

@ -21,10 +21,6 @@ final class PholioTransaction extends PhabricatorApplicationTransaction {
return new PholioTransactionView(); return new PholioTransactionView();
} }
public function getApplicationObjectTypeName() {
return pht('mock');
}
public function getRequiredHandlePHIDs() { public function getRequiredHandlePHIDs() {
$phids = parent::getRequiredHandlePHIDs(); $phids = parent::getRequiredHandlePHIDs();
$phids[] = $this->getObjectPHID(); $phids[] = $this->getObjectPHID();

View file

@ -17,10 +17,6 @@ final class PhortuneAccountTransaction
return null; return null;
} }
public function getApplicationObjectTypeName() {
return pht('account');
}
public function getTitle() { public function getTitle() {
$author_phid = $this->getAuthorPHID(); $author_phid = $this->getAuthorPHID();

View file

@ -19,10 +19,6 @@ final class PhortuneProductTransaction
return null; return null;
} }
public function getApplicationObjectTypeName() {
return pht('product');
}
public function getTitle() { public function getTitle() {
$author_phid = $this->getAuthorPHID(); $author_phid = $this->getAuthorPHID();

View file

@ -21,10 +21,6 @@ final class PonderAnswerTransaction
return new PonderAnswerTransactionComment(); return new PonderAnswerTransactionComment();
} }
public function getApplicationObjectTypeName() {
return pht('answer');
}
public function getTitleForFeed() { public function getTitleForFeed() {
$author_phid = $this->getAuthorPHID(); $author_phid = $this->getAuthorPHID();
$object_phid = $this->getObjectPHID(); $object_phid = $this->getObjectPHID();

View file

@ -24,10 +24,6 @@ final class PonderQuestionTransaction
return new PonderQuestionTransactionComment(); return new PonderQuestionTransactionComment();
} }
public function getApplicationObjectTypeName() {
return pht('question');
}
public function getTitle() { public function getTitle() {
$author_phid = $this->getAuthorPHID(); $author_phid = $this->getAuthorPHID();

View file

@ -11,9 +11,5 @@ final class ReleephBranchTransaction
return ReleephPHIDTypeBranch::TYPECONST; return ReleephPHIDTypeBranch::TYPECONST;
} }
public function getApplicationObjectTypeName() {
return pht('branch');
}
} }

View file

@ -11,9 +11,5 @@ final class ReleephProjectTransaction
return ReleephPHIDTypeProject::TYPECONST; return ReleephPHIDTypeProject::TYPECONST;
} }
public function getApplicationObjectTypeName() {
return pht('project');
}
} }

View file

@ -23,10 +23,6 @@ final class ReleephRequestTransaction
return new ReleephRequestTransactionComment(); return new ReleephRequestTransactionComment();
} }
public function getApplicationObjectTypeName() {
return pht('releeph request');
}
public function hasChangeDetails() { public function hasChangeDetails() {
switch ($this->getTransactionType()) { switch ($this->getTransactionType()) {
default; default;

View file

@ -19,10 +19,6 @@ final class PhabricatorRepositoryTransaction
return null; return null;
} }
public function getApplicationObjectTypeName() {
return pht('repository');
}
public function getTitle() { public function getTitle() {
$author_phid = $this->getAuthorPHID(); $author_phid = $this->getAuthorPHID();

View file

@ -20,10 +20,6 @@ final class PhabricatorSlowvoteTransaction
return new PhabricatorSlowvoteTransactionComment(); return new PhabricatorSlowvoteTransactionComment();
} }
public function getApplicationObjectTypeName() {
return pht('vote');
}
public function shouldHide() { public function shouldHide() {
$old = $this->getOldValue(); $old = $this->getOldValue();
$new = $this->getNewValue(); $new = $this->getNewValue();

View file

@ -30,7 +30,17 @@ abstract class PhabricatorApplicationTransaction
private $transactionGroup = array(); private $transactionGroup = array();
abstract public function getApplicationTransactionType(); abstract public function getApplicationTransactionType();
abstract public function getApplicationObjectTypeName();
private function getApplicationObjectTypeName() {
$types = PhabricatorPHIDType::getAllTypes();
$type = idx($types, $this->getApplicationTransactionType());
if ($type) {
return $type->getTypeName();
}
return pht('Object');
}
public function getApplicationTransactionCommentObject() { public function getApplicationTransactionCommentObject() {
throw new Exception("Not implemented!"); throw new Exception("Not implemented!");