Commit 97a8700e authored by Joshua Spence's avatar Joshua Spence
Browse files

Rename `PHIDType` classes

Summary: Ref T5655. Rename `PhabricatorPHIDType` subclasses for clarity (see discussion in D9839). I'm not too keen on some of the resulting class names, so feel free to suggest alternatives.

Test Plan: Ran unit tests.

Reviewers: epriestley, #blessed_reviewers

Reviewed By: epriestley, #blessed_reviewers

Subscribers: epriestley, Korvin, hach-que

Maniphest Tasks: T5655

Differential Revision: https://secure.phabricator.com/D9986
parent 9a892dd9
......@@ -27,12 +27,12 @@ foreach ($rows as $row) {
$dst_table = 'differential_inline_comment';
$xaction_phid = PhabricatorPHID::generateNewPHID(
PhabricatorApplicationTransactionPHIDTypeTransaction::TYPECONST,
DifferentialPHIDTypeRevision::TYPECONST);
PhabricatorApplicationTransactionTransactionPHIDType::TYPECONST,
DifferentialRevisionPHIDType::TYPECONST);
$comment_phid = PhabricatorPHID::generateNewPHID(
PhabricatorPHIDConstants::PHID_TYPE_XCMT,
DifferentialPHIDTypeRevision::TYPECONST);
DifferentialRevisionPHIDType::TYPECONST);
queryfx(
$conn_w,
......
......@@ -171,8 +171,8 @@ foreach ($rows as $row) {
$xaction_phid = idx($xaction, 'phid');
if (!$xaction_phid) {
$xaction_phid = PhabricatorPHID::generateNewPHID(
PhabricatorApplicationTransactionPHIDTypeTransaction::TYPECONST,
DifferentialPHIDTypeRevision::TYPECONST);
PhabricatorApplicationTransactionTransactionPHIDType::TYPECONST,
DifferentialRevisionPHIDType::TYPECONST);
}
unset($xaction['phid']);
......
......@@ -43,8 +43,8 @@ foreach ($comments as $comment) {
$comment_phid = PhabricatorPHID::generateNewPHID(
PhabricatorPHIDConstants::PHID_TYPE_XCMT);
$xaction_phid = PhabricatorPHID::generateNewPHID(
PhabricatorApplicationTransactionPHIDTypeTransaction::TYPECONST,
PhabricatorSlowvotePHIDTypePoll::TYPECONST);
PhabricatorApplicationTransactionTransactionPHIDType::TYPECONST,
PhabricatorSlowvotePollPHIDType::TYPECONST);
$source = PhabricatorContentSource::newForSource(
PhabricatorContentSource::SOURCE_LEGACY,
......
......@@ -16,22 +16,22 @@ foreach ($rows as $row) {
$type = phid_get_type($row['targetPHID']);
switch ($type) {
case PonderPHIDTypeQuestion::TYPECONST:
case PonderQuestionPHIDType::TYPECONST:
$table_obj = $qtable;
$comment_obj = new PonderQuestionTransactionComment();
break;
case PonderPHIDTypeAnswer::TYPECONST:
case PonderAnswerPHIDType::TYPECONST:
$table_obj = $atable;
$comment_obj = new PonderAnswerTransactionComment();
break;
}
$comment_phid = PhabricatorPHID::generateNewPHID(
PhabricatorApplicationTransactionPHIDTypeTransaction::TYPECONST,
PhabricatorApplicationTransactionTransactionPHIDType::TYPECONST,
$type);
$xaction_phid = PhabricatorPHID::generateNewPHID(
PhabricatorApplicationTransactionPHIDTypeTransaction::TYPECONST,
PhabricatorApplicationTransactionTransactionPHIDType::TYPECONST,
$type);
queryfx(
......
......@@ -15,7 +15,7 @@ foreach ($rows as $row) {
echo "Adding transactions for paste id {$id}...\n";
$xaction_phid = PhabricatorPHID::generateNewPHID(
PhabricatorApplicationTransactionPHIDTypeTransaction::TYPECONST);
PhabricatorApplicationTransactionTransactionPHIDType::TYPECONST);
queryfx(
$conn_w,
......
......@@ -17,7 +17,7 @@ foreach (new LiskMigrationIterator(new HeraldRule()) as $rule) {
$conn_w,
'UPDATE %T SET phid = %s WHERE id = %d',
$table->getTableName(),
PhabricatorPHID::generateNewPHID(HeraldPHIDTypeRule::TYPECONST),
PhabricatorPHID::generateNewPHID(HeraldRulePHIDType::TYPECONST),
$rule->getID());
}
......
......@@ -62,8 +62,8 @@ foreach ($rows as $row) {
// a comment in addition to an action) we'll insert that below.
if ($row['transactionType'] != 'comment') {
$xaction_phid = PhabricatorPHID::generateNewPHID(
PhabricatorApplicationTransactionPHIDTypeTransaction::TYPECONST,
ManiphestPHIDTypeTask::TYPECONST);
PhabricatorApplicationTransactionTransactionPHIDType::TYPECONST,
ManiphestTaskPHIDType::TYPECONST);
queryfx(
$conn_w,
......@@ -93,12 +93,12 @@ foreach ($rows as $row) {
if ($has_comment) {
$comment_phid = PhabricatorPHID::generateNewPHID(
PhabricatorPHIDConstants::PHID_TYPE_XCMT,
ManiphestPHIDTypeTask::TYPECONST);
ManiphestTaskPHIDType::TYPECONST);
$comment_version = 1;
$comment_xaction_phid = PhabricatorPHID::generateNewPHID(
PhabricatorApplicationTransactionPHIDTypeTransaction::TYPECONST,
ManiphestPHIDTypeTask::TYPECONST);
PhabricatorApplicationTransactionTransactionPHIDType::TYPECONST,
ManiphestTaskPHIDType::TYPECONST);
// Insert the comment data.
queryfx(
......
......@@ -34,15 +34,15 @@ foreach ($rows as $row) {
if ($row['commentID']) {
$xaction_phid = PhabricatorPHID::generateNewPHID(
PhabricatorApplicationTransactionPHIDTypeTransaction::TYPECONST,
DifferentialPHIDTypeRevision::TYPECONST);
PhabricatorApplicationTransactionTransactionPHIDType::TYPECONST,
DifferentialRevisionPHIDType::TYPECONST);
} else {
$xaction_phid = null;
}
$comment_phid = PhabricatorPHID::generateNewPHID(
PhabricatorPHIDConstants::PHID_TYPE_XCMT,
DifferentialPHIDTypeRevision::TYPECONST);
DifferentialRevisionPHIDType::TYPECONST);
queryfx(
$conn_w,
......
......@@ -47,7 +47,7 @@ foreach ($rows as $row) {
}
$xaction_phid = PhabricatorPHID::generateNewPHID(
PhabricatorApplicationTransactionPHIDTypeTransaction::TYPECONST,
PhabricatorApplicationTransactionTransactionPHIDType::TYPECONST,
PhabricatorProjectPHIDTypeProject::TYPECONST);
queryfx(
......
......@@ -20,7 +20,7 @@ foreach ($chunk_iter as $chunk) {
continue;
}
$type_diff = DifferentialPHIDTypeDiff::TYPECONST;
$type_diff = DifferentialDiffPHIDType::TYPECONST;
$new_phid = PhabricatorPHID::generateNewPHID($type_diff);
$sql[] = qsprintf(
......
......@@ -8,7 +8,7 @@ foreach (new LiskMigrationIterator($table) as $rev) {
$id = $rev->getID();
echo "Revision {$id}: ";
$deps = $rev->getAttachedPHIDs(DifferentialPHIDTypeRevision::TYPECONST);
$deps = $rev->getAttachedPHIDs(DifferentialRevisionPHIDType::TYPECONST);
if (!$deps) {
echo "-\n";
continue;
......
......@@ -8,7 +8,7 @@ foreach (new LiskMigrationIterator($table) as $task) {
$id = $task->getID();
echo "Task {$id}: ";
$deps = $task->getAttachedPHIDs(ManiphestPHIDTypeTask::TYPECONST);
$deps = $task->getAttachedPHIDs(ManiphestTaskPHIDType::TYPECONST);
if (!$deps) {
echo "-\n";
continue;
......
......@@ -8,7 +8,7 @@ foreach (new LiskMigrationIterator($table) as $task) {
$id = $task->getID();
echo "Task {$id}: ";
$revs = $task->getAttachedPHIDs(DifferentialPHIDTypeRevision::TYPECONST);
$revs = $task->getAttachedPHIDs(DifferentialRevisionPHIDType::TYPECONST);
if (!$revs) {
echo "-\n";
continue;
......
This diff is collapsed.
<?php
final class PhabricatorAuthPHIDTypeAuthFactor extends PhabricatorPHIDType {
final class PhabricatorAuthAuthFactorPHIDType extends PhabricatorPHIDType {
const TYPECONST = 'AFTR';
......
......@@ -19,7 +19,7 @@ final class PhabricatorAuthFactorConfig extends PhabricatorAuthDAO {
public function generatePHID() {
return PhabricatorPHID::generateNewPHID(
PhabricatorAuthPHIDTypeAuthFactor::TYPECONST);
PhabricatorAuthAuthFactorPHIDType::TYPECONST);
}
public function getImplementation() {
......
<?php
final class PhabricatorCalendarPHIDTypeEvent extends PhabricatorPHIDType {
final class PhabricatorCalendarEventPHIDType extends PhabricatorPHIDType {
const TYPECONST = 'CEVT';
......
......@@ -42,7 +42,7 @@ final class PhabricatorCalendarEvent
public function generatePHID() {
return PhabricatorPHID::generateNewPHID(
PhabricatorCalendarPHIDTypeEvent::TYPECONST);
PhabricatorCalendarEventPHIDType::TYPECONST);
}
public function getTerseSummary(PhabricatorUser $viewer) {
......
<?php
final class PhabricatorConfigPHIDTypeConfig extends PhabricatorPHIDType {
final class PhabricatorConfigConfigPHIDType extends PhabricatorPHIDType {
const TYPECONST = 'CONF';
......
......@@ -19,7 +19,7 @@ final class PhabricatorConfigEntry extends PhabricatorConfigEntryDAO
public function generatePHID() {
return PhabricatorPHID::generateNewPHID(
PhabricatorConfigPHIDTypeConfig::TYPECONST);
PhabricatorConfigConfigPHIDType::TYPECONST);
}
public static function loadConfigEntry($key) {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment