Page MenuHomePhabricator

D11116.diff
No OneTemporary

D11116.diff

diff --git a/resources/sql/autopatches/20140210.projcfield.4.memmig.sql b/resources/sql/autopatches/20140210.projcfield.4.memmig.sql
--- a/resources/sql/autopatches/20140210.projcfield.4.memmig.sql
+++ b/resources/sql/autopatches/20140210.projcfield.4.memmig.sql
@@ -1,7 +1,7 @@
/* These are here so `grep` will find them if we ever change things: */
/* PhabricatorProjectProjectHasMemberEdgeType::EDGECONST = 13 */
-/* PhabricatorEdgeConfig::TYPE_OBJECT_HAS_SUBSCRIBER = 21 */
+/* PhabricatorObjectHasSubscriberEdgeType::EDGECONST = 21 */
INSERT IGNORE INTO {$NAMESPACE}_project.edge (src, type, dst, dateCreated)
SELECT src, 21, dst, dateCreated FROM {$NAMESPACE}_project.edge
diff --git a/resources/sql/autopatches/20140211.dx.3.migsubscriptions.sql b/resources/sql/autopatches/20140211.dx.3.migsubscriptions.sql
--- a/resources/sql/autopatches/20140211.dx.3.migsubscriptions.sql
+++ b/resources/sql/autopatches/20140211.dx.3.migsubscriptions.sql
@@ -1,6 +1,6 @@
/* For `grep`: */
-/* PhabricatorEdgeConfig::TYPE_OBJECT_HAS_SUBSCRIBER = 21 */
+/* PhabricatorObjectHasSubscriberEdgeType::EDGECONST = 21 */
INSERT IGNORE INTO {$NAMESPACE}_differential.edge (src, type, dst, seq)
SELECT rev.phid, 21, rel.objectPHID, rel.sequence
diff --git a/resources/sql/autopatches/20140731.audit.1.subscribers.php b/resources/sql/autopatches/20140731.audit.1.subscribers.php
--- a/resources/sql/autopatches/20140731.audit.1.subscribers.php
+++ b/resources/sql/autopatches/20140731.audit.1.subscribers.php
@@ -19,7 +19,7 @@
'INSERT IGNORE INTO %T (src, type, dst) VALUES (%s, %d, %s)',
PhabricatorEdgeConfig::TABLE_NAME_EDGE,
$request->getCommitPHID(),
- PhabricatorEdgeConfig::TYPE_OBJECT_HAS_SUBSCRIBER,
+ PhabricatorObjectHasSubscriberEdgeType::EDGECONST,
$request->getAuditorPHID());
diff --git a/resources/sql/autopatches/20140904.macroattach.php b/resources/sql/autopatches/20140904.macroattach.php
--- a/resources/sql/autopatches/20140904.macroattach.php
+++ b/resources/sql/autopatches/20140904.macroattach.php
@@ -16,7 +16,7 @@
foreach ($phids as $phid) {
$editor->addEdge(
$macro->getPHID(),
- PhabricatorEdgeConfig::TYPE_OBJECT_HAS_FILE,
+ PhabricatorObjectHasFileEdgeType::EDGECONST ,
$phid);
}
$editor->save();
diff --git a/resources/sql/patches/20130201.revisionunsubscribed.php b/resources/sql/patches/20130201.revisionunsubscribed.php
--- a/resources/sql/patches/20130201.revisionunsubscribed.php
+++ b/resources/sql/patches/20130201.revisionunsubscribed.php
@@ -22,7 +22,7 @@
foreach ($unsubscribed as $user_phid => $_) {
$editor->addEdge(
$rev['phid'],
- PhabricatorEdgeConfig::TYPE_OBJECT_HAS_UNSUBSCRIBER,
+ PhabricatorObjectHasUnsubscriberEdgeType::EDGECONST ,
$user_phid);
}
$editor->save();
diff --git a/resources/sql/patches/20130703.legalpaddocdenorm.php b/resources/sql/patches/20130703.legalpaddocdenorm.php
--- a/resources/sql/patches/20130703.legalpaddocdenorm.php
+++ b/resources/sql/patches/20130703.legalpaddocdenorm.php
@@ -24,7 +24,7 @@
if (!$document->getContributorCount() ||
!$document->getRecentContributorPHIDs()) {
$updated = true;
- $type = PhabricatorEdgeConfig::TYPE_OBJECT_HAS_CONTRIBUTOR;
+ $type = PhabricatorObjectHasContributorEdgeType::EDGECONST;
$contributors = PhabricatorEdgeQuery::loadDestinationPHIDs(
$document->getPHID(),
$type);
diff --git a/resources/sql/patches/20131121.repocredentials.2.mig.php b/resources/sql/patches/20131121.repocredentials.2.mig.php
--- a/resources/sql/patches/20131121.repocredentials.2.mig.php
+++ b/resources/sql/patches/20131121.repocredentials.2.mig.php
@@ -123,7 +123,7 @@
$credential->getPHID(),
$repository->getID());
- $edge_type = PhabricatorEdgeConfig::TYPE_OBJECT_USES_CREDENTIAL;
+ $edge_type = PhabricatorObjectUsesCredentialsEdgeType::EDGECONST;
id(new PhabricatorEdgeEditor())
->addEdge($repository->getPHID(), $edge_type, $credential->getPHID())
diff --git a/src/__phutil_library_map__.php b/src/__phutil_library_map__.php
--- a/src/__phutil_library_map__.php
+++ b/src/__phutil_library_map__.php
@@ -1291,6 +1291,8 @@
'PhabricatorApplicationsListController' => 'applications/meta/controller/PhabricatorApplicationsListController.php',
'PhabricatorAsanaAuthProvider' => 'applications/auth/provider/PhabricatorAsanaAuthProvider.php',
'PhabricatorAsanaConfigOptions' => 'applications/doorkeeper/option/PhabricatorAsanaConfigOptions.php',
+ 'PhabricatorAsanaSubtaskHasObjectEdgeType' => 'applications/doorkeeper/edge/PhabricatorAsanaSubtaskHasObjectEdgeType.php',
+ 'PhabricatorAsanaTaskHasObjectEdgeType' => 'applications/doorkeeper/edge/PhabricatorAsanaTaskHasObjectEdgeType.php',
'PhabricatorAuditActionConstants' => 'applications/audit/constants/PhabricatorAuditActionConstants.php',
'PhabricatorAuditAddCommentController' => 'applications/audit/controller/PhabricatorAuditAddCommentController.php',
'PhabricatorAuditApplication' => 'applications/audit/application/PhabricatorAuditApplication.php',
@@ -1525,6 +1527,7 @@
'PhabricatorConsoleApplication' => 'applications/console/application/PhabricatorConsoleApplication.php',
'PhabricatorContentSource' => 'applications/metamta/contentsource/PhabricatorContentSource.php',
'PhabricatorContentSourceView' => 'applications/metamta/contentsource/PhabricatorContentSourceView.php',
+ 'PhabricatorContributedToObjectEdgeType' => 'applications/transactions/edges/PhabricatorContributedToObjectEdgeType.php',
'PhabricatorController' => 'applications/base/controller/PhabricatorController.php',
'PhabricatorCookies' => 'applications/auth/constants/PhabricatorCookies.php',
'PhabricatorCoreConfigOptions' => 'applications/config/option/PhabricatorCoreConfigOptions.php',
@@ -1542,6 +1545,7 @@
'PhabricatorCountdownSearchEngine' => 'applications/countdown/query/PhabricatorCountdownSearchEngine.php',
'PhabricatorCountdownView' => 'applications/countdown/view/PhabricatorCountdownView.php',
'PhabricatorCountdownViewController' => 'applications/countdown/controller/PhabricatorCountdownViewController.php',
+ 'PhabricatorCredentialsUsedByObjectEdgeType' => 'applications/passphrase/edge/PhabricatorCredentialsUsedByObjectEdgeType.php',
'PhabricatorCrumbView' => 'view/layout/PhabricatorCrumbView.php',
'PhabricatorCrumbsView' => 'view/layout/PhabricatorCrumbsView.php',
'PhabricatorCursorPagedPolicyAwareQuery' => 'infrastructure/query/policy/PhabricatorCursorPagedPolicyAwareQuery.php',
@@ -1754,6 +1758,7 @@
'PhabricatorFileEditController' => 'applications/files/controller/PhabricatorFileEditController.php',
'PhabricatorFileEditor' => 'applications/files/editor/PhabricatorFileEditor.php',
'PhabricatorFileFilePHIDType' => 'applications/files/phid/PhabricatorFileFilePHIDType.php',
+ 'PhabricatorFileHasObjectEdgeType' => 'applications/files/edge/PhabricatorFileHasObjectEdgeType.php',
'PhabricatorFileImageMacro' => 'applications/macro/storage/PhabricatorFileImageMacro.php',
'PhabricatorFileInfoController' => 'applications/files/controller/PhabricatorFileInfoController.php',
'PhabricatorFileLinkListView' => 'view/layout/PhabricatorFileLinkListView.php',
@@ -1847,10 +1852,10 @@
'PhabricatorIteratedMD5PasswordHasher' => 'infrastructure/util/password/PhabricatorIteratedMD5PasswordHasher.php',
'PhabricatorJIRAAuthProvider' => 'applications/auth/provider/PhabricatorJIRAAuthProvider.php',
'PhabricatorJavelinLinter' => 'infrastructure/lint/linter/PhabricatorJavelinLinter.php',
+ 'PhabricatorJiraIssueHasObjectEdgeType' => 'applications/doorkeeper/edge/PhabricatorJiraIssueHasObjectEdgeType.php',
'PhabricatorJumpNavHandler' => 'applications/search/engine/PhabricatorJumpNavHandler.php',
'PhabricatorKeyValueDatabaseCache' => 'applications/cache/PhabricatorKeyValueDatabaseCache.php',
'PhabricatorLDAPAuthProvider' => 'applications/auth/provider/PhabricatorLDAPAuthProvider.php',
- 'PhabricatorLegacyEdgeType' => 'infrastructure/edges/type/PhabricatorLegacyEdgeType.php',
'PhabricatorLegalpadApplication' => 'applications/legalpad/application/PhabricatorLegalpadApplication.php',
'PhabricatorLegalpadConfigOptions' => 'applications/legalpad/config/PhabricatorLegalpadConfigOptions.php',
'PhabricatorLegalpadDocumentPHIDType' => 'applications/legalpad/phid/PhabricatorLegalpadDocumentPHIDType.php',
@@ -2014,6 +2019,14 @@
'PhabricatorObjectHandle' => 'applications/phid/PhabricatorObjectHandle.php',
'PhabricatorObjectHandleConstants' => 'applications/phid/handle/const/PhabricatorObjectHandleConstants.php',
'PhabricatorObjectHandleStatus' => 'applications/phid/handle/const/PhabricatorObjectHandleStatus.php',
+ 'PhabricatorObjectHasAsanaSubtaskEdgeType' => 'applications/doorkeeper/edge/PhabricatorObjectHasAsanaSubtaskEdgeType.php',
+ 'PhabricatorObjectHasAsanaTaskEdgeType' => 'applications/doorkeeper/edge/PhabricatorObjectHasAsanaTaskEdgeType.php',
+ 'PhabricatorObjectHasContributorEdgeType' => 'applications/transactions/edges/PhabricatorObjectHasContributorEdgeType.php',
+ 'PhabricatorObjectHasFileEdgeType' => 'applications/transactions/edges/PhabricatorObjectHasFileEdgeType.php',
+ 'PhabricatorObjectHasJiraIssueEdgeType' => 'applications/doorkeeper/edge/PhabricatorObjectHasJiraIssueEdgeType.php',
+ 'PhabricatorObjectHasSubscriberEdgeType' => 'applications/transactions/edges/PhabricatorObjectHasSubscriberEdgeType.php',
+ 'PhabricatorObjectHasUnsubscriberEdgeType' => 'applications/transactions/edges/PhabricatorObjectHasUnsubscriberEdgeType.php',
+ 'PhabricatorObjectHasWatcherEdgeType' => 'applications/transactions/edges/PhabricatorObjectHasWatcherEdgeType.php',
'PhabricatorObjectListQuery' => 'applications/phid/query/PhabricatorObjectListQuery.php',
'PhabricatorObjectListQueryTestCase' => 'applications/phid/query/__tests__/PhabricatorObjectListQueryTestCase.php',
'PhabricatorObjectMailReceiver' => 'applications/metamta/receiver/PhabricatorObjectMailReceiver.php',
@@ -2023,6 +2036,7 @@
'PhabricatorObjectQuery' => 'applications/phid/query/PhabricatorObjectQuery.php',
'PhabricatorObjectRemarkupRule' => 'infrastructure/markup/rule/PhabricatorObjectRemarkupRule.php',
'PhabricatorObjectSelectorDialog' => 'view/control/PhabricatorObjectSelectorDialog.php',
+ 'PhabricatorObjectUsesCredentialsEdgeType' => 'applications/transactions/edges/PhabricatorObjectUsesCredentialsEdgeType.php',
'PhabricatorOffsetPagedQuery' => 'infrastructure/query/PhabricatorOffsetPagedQuery.php',
'PhabricatorOwnerPathQuery' => 'applications/owners/query/PhabricatorOwnerPathQuery.php',
'PhabricatorOwnersApplication' => 'applications/owners/application/PhabricatorOwnersApplication.php',
@@ -2432,6 +2446,7 @@
'PhabricatorStorageSchemaSpec' => 'infrastructure/storage/schema/PhabricatorStorageSchemaSpec.php',
'PhabricatorStorageSetupCheck' => 'applications/config/check/PhabricatorStorageSetupCheck.php',
'PhabricatorSubscribableInterface' => 'applications/subscriptions/interface/PhabricatorSubscribableInterface.php',
+ 'PhabricatorSubscribedToObjectEdgeType' => 'applications/transactions/edges/PhabricatorSubscribedToObjectEdgeType.php',
'PhabricatorSubscribersQuery' => 'applications/subscriptions/query/PhabricatorSubscribersQuery.php',
'PhabricatorSubscriptionsApplication' => 'applications/subscriptions/application/PhabricatorSubscriptionsApplication.php',
'PhabricatorSubscriptionsEditController' => 'applications/subscriptions/controller/PhabricatorSubscriptionsEditController.php',
@@ -2461,6 +2476,7 @@
'PhabricatorTestCase' => 'infrastructure/testing/PhabricatorTestCase.php',
'PhabricatorTestController' => 'applications/base/controller/__tests__/PhabricatorTestController.php',
'PhabricatorTestDataGenerator' => 'applications/lipsum/generator/PhabricatorTestDataGenerator.php',
+ 'PhabricatorTestNoCycleEdgeType' => 'applications/transactions/edges/PhabricatorTestNoCycleEdgeType.php',
'PhabricatorTestStorageEngine' => 'applications/files/engine/PhabricatorTestStorageEngine.php',
'PhabricatorTestWorker' => 'infrastructure/daemon/workers/__tests__/PhabricatorTestWorker.php',
'PhabricatorTime' => 'infrastructure/time/PhabricatorTime.php',
@@ -2516,6 +2532,7 @@
'PhabricatorUIStatusExample' => 'applications/uiexample/examples/PhabricatorUIStatusExample.php',
'PhabricatorUITooltipExample' => 'applications/uiexample/examples/PhabricatorUITooltipExample.php',
'PhabricatorUnitsTestCase' => 'view/__tests__/PhabricatorUnitsTestCase.php',
+ 'PhabricatorUnsubscribedFromObjectEdgeType' => 'applications/transactions/edges/PhabricatorUnsubscribedFromObjectEdgeType.php',
'PhabricatorUser' => 'applications/people/storage/PhabricatorUser.php',
'PhabricatorUserBlurbField' => 'applications/people/customfield/PhabricatorUserBlurbField.php',
'PhabricatorUserConfigOptions' => 'applications/people/config/PhabricatorUserConfigOptions.php',
@@ -2544,6 +2561,7 @@
'PhabricatorUserTitleField' => 'applications/people/customfield/PhabricatorUserTitleField.php',
'PhabricatorUserTransaction' => 'applications/people/storage/PhabricatorUserTransaction.php',
'PhabricatorVCSResponse' => 'applications/repository/response/PhabricatorVCSResponse.php',
+ 'PhabricatorWatcherHasObjectEdgeType' => 'applications/transactions/edges/PhabricatorWatcherHasObjectEdgeType.php',
'PhabricatorWordPressAuthProvider' => 'applications/auth/provider/PhabricatorWordPressAuthProvider.php',
'PhabricatorWorker' => 'infrastructure/daemon/workers/PhabricatorWorker.php',
'PhabricatorWorkerActiveTask' => 'infrastructure/daemon/workers/storage/PhabricatorWorkerActiveTask.php',
@@ -4434,6 +4452,8 @@
'PhabricatorApplicationsListController' => 'PhabricatorApplicationsController',
'PhabricatorAsanaAuthProvider' => 'PhabricatorOAuth2AuthProvider',
'PhabricatorAsanaConfigOptions' => 'PhabricatorApplicationConfigOptions',
+ 'PhabricatorAsanaSubtaskHasObjectEdgeType' => 'PhabricatorEdgeType',
+ 'PhabricatorAsanaTaskHasObjectEdgeType' => 'PhabricatorEdgeType',
'PhabricatorAuditAddCommentController' => 'PhabricatorAuditController',
'PhabricatorAuditApplication' => 'PhabricatorApplication',
'PhabricatorAuditCommentEditor' => 'PhabricatorEditor',
@@ -4688,6 +4708,7 @@
'PhabricatorConpherenceThreadPHIDType' => 'PhabricatorPHIDType',
'PhabricatorConsoleApplication' => 'PhabricatorApplication',
'PhabricatorContentSourceView' => 'AphrontView',
+ 'PhabricatorContributedToObjectEdgeType' => 'PhabricatorEdgeType',
'PhabricatorController' => 'AphrontController',
'PhabricatorCookies' => 'Phobject',
'PhabricatorCoreConfigOptions' => 'PhabricatorApplicationConfigOptions',
@@ -4708,6 +4729,7 @@
'PhabricatorCountdownSearchEngine' => 'PhabricatorApplicationSearchEngine',
'PhabricatorCountdownView' => 'AphrontTagView',
'PhabricatorCountdownViewController' => 'PhabricatorCountdownController',
+ 'PhabricatorCredentialsUsedByObjectEdgeType' => 'PhabricatorEdgeType',
'PhabricatorCrumbView' => 'AphrontView',
'PhabricatorCrumbsView' => 'AphrontView',
'PhabricatorCursorPagedPolicyAwareQuery' => 'PhabricatorPolicyAwareQuery',
@@ -4936,6 +4958,7 @@
'PhabricatorFileEditController' => 'PhabricatorFileController',
'PhabricatorFileEditor' => 'PhabricatorApplicationTransactionEditor',
'PhabricatorFileFilePHIDType' => 'PhabricatorPHIDType',
+ 'PhabricatorFileHasObjectEdgeType' => 'PhabricatorEdgeType',
'PhabricatorFileImageMacro' => array(
'PhabricatorFileDAO',
'PhabricatorSubscribableInterface',
@@ -5032,9 +5055,9 @@
'PhabricatorIteratedMD5PasswordHasher' => 'PhabricatorPasswordHasher',
'PhabricatorJIRAAuthProvider' => 'PhabricatorOAuth1AuthProvider',
'PhabricatorJavelinLinter' => 'ArcanistLinter',
+ 'PhabricatorJiraIssueHasObjectEdgeType' => 'PhabricatorEdgeType',
'PhabricatorKeyValueDatabaseCache' => 'PhutilKeyValueCache',
'PhabricatorLDAPAuthProvider' => 'PhabricatorAuthProvider',
- 'PhabricatorLegacyEdgeType' => 'PhabricatorEdgeType',
'PhabricatorLegalpadApplication' => 'PhabricatorApplication',
'PhabricatorLegalpadConfigOptions' => 'PhabricatorApplicationConfigOptions',
'PhabricatorLegalpadDocumentPHIDType' => 'PhabricatorPHIDType',
@@ -5191,6 +5214,14 @@
'PhabricatorOAuthServerTokenController' => 'PhabricatorAuthController',
'PhabricatorObjectHandle' => 'PhabricatorPolicyInterface',
'PhabricatorObjectHandleStatus' => 'PhabricatorObjectHandleConstants',
+ 'PhabricatorObjectHasAsanaSubtaskEdgeType' => 'PhabricatorEdgeType',
+ 'PhabricatorObjectHasAsanaTaskEdgeType' => 'PhabricatorEdgeType',
+ 'PhabricatorObjectHasContributorEdgeType' => 'PhabricatorEdgeType',
+ 'PhabricatorObjectHasFileEdgeType' => 'PhabricatorEdgeType',
+ 'PhabricatorObjectHasJiraIssueEdgeType' => 'PhabricatorEdgeType',
+ 'PhabricatorObjectHasSubscriberEdgeType' => 'PhabricatorEdgeType',
+ 'PhabricatorObjectHasUnsubscriberEdgeType' => 'PhabricatorEdgeType',
+ 'PhabricatorObjectHasWatcherEdgeType' => 'PhabricatorEdgeType',
'PhabricatorObjectListQueryTestCase' => 'PhabricatorTestCase',
'PhabricatorObjectMailReceiver' => 'PhabricatorMailReceiver',
'PhabricatorObjectMailReceiverTestCase' => 'PhabricatorTestCase',
@@ -5198,6 +5229,7 @@
'PhabricatorObjectMentionsObjectEdgeType' => 'PhabricatorEdgeType',
'PhabricatorObjectQuery' => 'PhabricatorCursorPagedPolicyAwareQuery',
'PhabricatorObjectRemarkupRule' => 'PhutilRemarkupRule',
+ 'PhabricatorObjectUsesCredentialsEdgeType' => 'PhabricatorEdgeType',
'PhabricatorOffsetPagedQuery' => 'PhabricatorQuery',
'PhabricatorOwnersApplication' => 'PhabricatorApplication',
'PhabricatorOwnersConfigOptions' => 'PhabricatorApplicationConfigOptions',
@@ -5659,6 +5691,7 @@
'PhabricatorStorageManagementWorkflow' => 'PhabricatorManagementWorkflow',
'PhabricatorStorageSchemaSpec' => 'PhabricatorConfigSchemaSpec',
'PhabricatorStorageSetupCheck' => 'PhabricatorSetupCheck',
+ 'PhabricatorSubscribedToObjectEdgeType' => 'PhabricatorEdgeType',
'PhabricatorSubscribersQuery' => 'PhabricatorQuery',
'PhabricatorSubscriptionsApplication' => 'PhabricatorApplication',
'PhabricatorSubscriptionsEditController' => 'PhabricatorController',
@@ -5685,6 +5718,7 @@
'PhabricatorTestApplication' => 'PhabricatorApplication',
'PhabricatorTestCase' => 'ArcanistPhutilTestCase',
'PhabricatorTestController' => 'PhabricatorController',
+ 'PhabricatorTestNoCycleEdgeType' => 'PhabricatorEdgeType',
'PhabricatorTestStorageEngine' => 'PhabricatorFileStorageEngine',
'PhabricatorTestWorker' => 'PhabricatorWorker',
'PhabricatorTimeTestCase' => 'PhabricatorTestCase',
@@ -5739,6 +5773,7 @@
'PhabricatorUIStatusExample' => 'PhabricatorUIExample',
'PhabricatorUITooltipExample' => 'PhabricatorUIExample',
'PhabricatorUnitsTestCase' => 'PhabricatorTestCase',
+ 'PhabricatorUnsubscribedFromObjectEdgeType' => 'PhabricatorEdgeType',
'PhabricatorUser' => array(
'PhabricatorUserDAO',
'PhutilPerson',
@@ -5780,6 +5815,7 @@
'PhabricatorUserTitleField' => 'PhabricatorUserCustomField',
'PhabricatorUserTransaction' => 'PhabricatorApplicationTransaction',
'PhabricatorVCSResponse' => 'AphrontResponse',
+ 'PhabricatorWatcherHasObjectEdgeType' => 'PhabricatorEdgeType',
'PhabricatorWordPressAuthProvider' => 'PhabricatorOAuth2AuthProvider',
'PhabricatorWorkerActiveTask' => 'PhabricatorWorkerTask',
'PhabricatorWorkerArchiveTask' => 'PhabricatorWorkerTask',
diff --git a/src/applications/audit/storage/PhabricatorAuditTransaction.php b/src/applications/audit/storage/PhabricatorAuditTransaction.php
--- a/src/applications/audit/storage/PhabricatorAuditTransaction.php
+++ b/src/applications/audit/storage/PhabricatorAuditTransaction.php
@@ -455,7 +455,7 @@
case PhabricatorProjectObjectHasProjectEdgeType::EDGECONST:
$tags[] = self::MAILTAG_PROJECTS;
break;
- case PhabricatorEdgeConfig::TYPE_OBJECT_HAS_SUBSCRIBER:
+ case PhabricatorObjectHasSubscriberEdgeType::EDGECONST:
$tags[] = self::MAILTAG_ADD_CCS;
break;
default:
diff --git a/src/applications/conpherence/editor/ConpherenceEditor.php b/src/applications/conpherence/editor/ConpherenceEditor.php
--- a/src/applications/conpherence/editor/ConpherenceEditor.php
+++ b/src/applications/conpherence/editor/ConpherenceEditor.php
@@ -255,7 +255,7 @@
switch ($xaction->getTransactionType()) {
case ConpherenceTransactionType::TYPE_FILES:
$editor = new PhabricatorEdgeEditor();
- $edge_type = PhabricatorEdgeConfig::TYPE_OBJECT_HAS_FILE;
+ $edge_type = PhabricatorObjectHasFileEdgeType::EDGECONST;
$old = array_fill_keys($xaction->getOldValue(), true);
$new = array_fill_keys($xaction->getNewValue(), true);
$add_edges = array_keys(array_diff_key($new, $old));
diff --git a/src/applications/conpherence/mail/ConpherenceReplyHandler.php b/src/applications/conpherence/mail/ConpherenceReplyHandler.php
--- a/src/applications/conpherence/mail/ConpherenceReplyHandler.php
+++ b/src/applications/conpherence/mail/ConpherenceReplyHandler.php
@@ -43,7 +43,7 @@
->attachParticipants(array())
->attachFilePHIDs(array());
} else {
- $edge_type = PhabricatorEdgeConfig::TYPE_OBJECT_HAS_FILE;
+ $edge_type = PhabricatorObjectHasFileEdgeType::EDGECONST;
$file_phids = PhabricatorEdgeQuery::loadDestinationPHIDs(
$conpherence->getPHID(),
$edge_type);
diff --git a/src/applications/conpherence/query/ConpherenceThreadQuery.php b/src/applications/conpherence/query/ConpherenceThreadQuery.php
--- a/src/applications/conpherence/query/ConpherenceThreadQuery.php
+++ b/src/applications/conpherence/query/ConpherenceThreadQuery.php
@@ -200,7 +200,7 @@
}
private function loadFilePHIDs(array $conpherences) {
- $edge_type = PhabricatorEdgeConfig::TYPE_OBJECT_HAS_FILE;
+ $edge_type = PhabricatorObjectHasFileEdgeType::EDGECONST;
$file_edges = id(new PhabricatorEdgeQuery())
->withSourcePHIDs(array_keys($conpherences))
->withEdgeTypes(array($edge_type))
diff --git a/src/applications/differential/customfield/DifferentialAsanaRepresentationField.php b/src/applications/differential/customfield/DifferentialAsanaRepresentationField.php
--- a/src/applications/differential/customfield/DifferentialAsanaRepresentationField.php
+++ b/src/applications/differential/customfield/DifferentialAsanaRepresentationField.php
@@ -30,7 +30,7 @@
public function renderPropertyViewValue(array $handles) {
$viewer = $this->getViewer();
$src_phid = $this->getObject()->getPHID();
- $edge_type = PhabricatorEdgeConfig::TYPE_PHOB_HAS_ASANATASK;
+ $edge_type = PhabricatorObjectHasAsanaTaskEdgeType::EDGECONST;
$query = id(new PhabricatorEdgeQuery())
->withSourcePHIDs(array($src_phid))
diff --git a/src/applications/differential/customfield/DifferentialJIRAIssuesField.php b/src/applications/differential/customfield/DifferentialJIRAIssuesField.php
--- a/src/applications/differential/customfield/DifferentialJIRAIssuesField.php
+++ b/src/applications/differential/customfield/DifferentialJIRAIssuesField.php
@@ -249,7 +249,7 @@
$revision = $this->getObject();
$revision_phid = $revision->getPHID();
- $edge_type = PhabricatorEdgeConfig::TYPE_PHOB_HAS_JIRAISSUE;
+ $edge_type = PhabricatorJiraIssueHasObjectEdgeType::EDGECONST;
$xobjs = $this->loadDoorkeeperExternalObjects($xaction->getNewValue());
$edge_dsts = mpull($xobjs, 'getPHID');
diff --git a/src/applications/differential/editor/DifferentialTransactionEditor.php b/src/applications/differential/editor/DifferentialTransactionEditor.php
--- a/src/applications/differential/editor/DifferentialTransactionEditor.php
+++ b/src/applications/differential/editor/DifferentialTransactionEditor.php
@@ -1506,7 +1506,7 @@
$unsubscribed_phids = PhabricatorEdgeQuery::loadDestinationPHIDs(
$object->getPHID(),
- PhabricatorEdgeConfig::TYPE_OBJECT_HAS_UNSUBSCRIBER);
+ PhabricatorObjectHasUnsubscriberEdgeType::EDGECONST);
$subscribed_phids = PhabricatorSubscribersQuery::loadSubscribersForPHID(
$object->getPHID());
diff --git a/src/applications/differential/query/DifferentialRevisionQuery.php b/src/applications/differential/query/DifferentialRevisionQuery.php
--- a/src/applications/differential/query/DifferentialRevisionQuery.php
+++ b/src/applications/differential/query/DifferentialRevisionQuery.php
@@ -628,7 +628,7 @@
'AND e_ccs.type = %s '.
'AND e_ccs.dst in (%Ls)',
PhabricatorEdgeConfig::TABLE_NAME_EDGE,
- PhabricatorEdgeConfig::TYPE_OBJECT_HAS_SUBSCRIBER,
+ PhabricatorObjectHasSubscriberEdgeType::EDGECONST,
$this->ccs);
}
@@ -901,7 +901,7 @@
assert_instances_of($revisions, 'DifferentialRevision');
$type_reviewer = DifferentialRevisionHasReviewerEdgeType::EDGECONST;
- $type_subscriber = PhabricatorEdgeConfig::TYPE_OBJECT_HAS_SUBSCRIBER;
+ $type_subscriber = PhabricatorObjectHasSubscriberEdgeType::EDGECONST;
$edges = id(new PhabricatorEdgeQuery())
->withSourcePHIDs(mpull($revisions, 'getPHID'))
diff --git a/src/applications/differential/storage/DifferentialRevision.php b/src/applications/differential/storage/DifferentialRevision.php
--- a/src/applications/differential/storage/DifferentialRevision.php
+++ b/src/applications/differential/storage/DifferentialRevision.php
@@ -214,7 +214,7 @@
$subscriber_phids = PhabricatorEdgeQuery::loadDestinationPHIDs(
$this->getPHID(),
- PhabricatorEdgeConfig::TYPE_OBJECT_HAS_SUBSCRIBER);
+ PhabricatorObjectHasSubscriberEdgeType::EDGECONST);
$subscriber_phids = array_reverse($subscriber_phids);
foreach ($subscriber_phids as $phid) {
$data[] = array(
diff --git a/src/applications/doorkeeper/edge/PhabricatorAsanaSubtaskHasObjectEdgeType.php b/src/applications/doorkeeper/edge/PhabricatorAsanaSubtaskHasObjectEdgeType.php
new file mode 100644
--- /dev/null
+++ b/src/applications/doorkeeper/edge/PhabricatorAsanaSubtaskHasObjectEdgeType.php
@@ -0,0 +1,16 @@
+<?php
+
+final class PhabricatorAsanaSubtaskHasObjectEdgeType
+ extends PhabricatorEdgeType {
+
+ const EDGECONST = 80002;
+
+ public function getInverseEdgeConstant() {
+ return PhabricatorObjectHasAsanaSubtaskEdgeType::EDGECONST;
+ }
+
+ public function shouldWriteInverseTransactions() {
+ return true;
+ }
+
+}
diff --git a/src/applications/doorkeeper/edge/PhabricatorAsanaTaskHasObjectEdgeType.php b/src/applications/doorkeeper/edge/PhabricatorAsanaTaskHasObjectEdgeType.php
new file mode 100644
--- /dev/null
+++ b/src/applications/doorkeeper/edge/PhabricatorAsanaTaskHasObjectEdgeType.php
@@ -0,0 +1,15 @@
+<?php
+
+final class PhabricatorAsanaTaskHasObjectEdgeType extends PhabricatorEdgeType {
+
+ const EDGECONST = 80000;
+
+ public function getInverseEdgeConstant() {
+ return PhabricatorObjectHasAsanaTaskEdgeType::EDGECONST;
+ }
+
+ public function shouldWriteInverseTransactions() {
+ return true;
+ }
+
+}
diff --git a/src/applications/doorkeeper/edge/PhabricatorJiraIssueHasObjectEdgeType.php b/src/applications/doorkeeper/edge/PhabricatorJiraIssueHasObjectEdgeType.php
new file mode 100644
--- /dev/null
+++ b/src/applications/doorkeeper/edge/PhabricatorJiraIssueHasObjectEdgeType.php
@@ -0,0 +1,15 @@
+<?php
+
+final class PhabricatorJiraIssueHasObjectEdgeType extends PhabricatorEdgeType {
+
+ const EDGECONST = 80004;
+
+ public function getInverseEdgeConstant() {
+ return PhabricatorObjectHasJiraIssueEdgeType::EDGECONST;
+ }
+
+ public function shouldWriteInverseTransactions() {
+ return true;
+ }
+
+}
diff --git a/src/applications/doorkeeper/edge/PhabricatorObjectHasAsanaSubtaskEdgeType.php b/src/applications/doorkeeper/edge/PhabricatorObjectHasAsanaSubtaskEdgeType.php
new file mode 100644
--- /dev/null
+++ b/src/applications/doorkeeper/edge/PhabricatorObjectHasAsanaSubtaskEdgeType.php
@@ -0,0 +1,16 @@
+<?php
+
+final class PhabricatorObjectHasAsanaSubtaskEdgeType
+ extends PhabricatorEdgeType {
+
+ const EDGECONST = 80003;
+
+ public function getInverseEdgeConstant() {
+ return PhabricatorAsanaSubtaskHasObjectEdgeType::EDGECONST;
+ }
+
+ public function shouldWriteInverseTransactions() {
+ return true;
+ }
+
+}
diff --git a/src/applications/doorkeeper/edge/PhabricatorObjectHasAsanaTaskEdgeType.php b/src/applications/doorkeeper/edge/PhabricatorObjectHasAsanaTaskEdgeType.php
new file mode 100644
--- /dev/null
+++ b/src/applications/doorkeeper/edge/PhabricatorObjectHasAsanaTaskEdgeType.php
@@ -0,0 +1,15 @@
+<?php
+
+final class PhabricatorObjectHasAsanaTaskEdgeType extends PhabricatorEdgeType {
+
+ const EDGECONST = 80001;
+
+ public function getInverseEdgeConstant() {
+ return PhabricatorAsanaTaskHasObjectEdgeType::EDGECONST;
+ }
+
+ public function shouldWriteInverseTransactions() {
+ return true;
+ }
+
+}
diff --git a/src/applications/doorkeeper/edge/PhabricatorObjectHasJiraIssueEdgeType.php b/src/applications/doorkeeper/edge/PhabricatorObjectHasJiraIssueEdgeType.php
new file mode 100644
--- /dev/null
+++ b/src/applications/doorkeeper/edge/PhabricatorObjectHasJiraIssueEdgeType.php
@@ -0,0 +1,15 @@
+<?php
+
+final class PhabricatorObjectHasJiraIssueEdgeType extends PhabricatorEdgeType {
+
+ const EDGECONST = 80005;
+
+ public function getInverseEdgeConstant() {
+ return PhabricatorJiraIssueHasObjectEdgeType::EDGECONST;
+ }
+
+ public function shouldWriteInverseTransactions() {
+ return true;
+ }
+
+}
diff --git a/src/applications/doorkeeper/worker/DoorkeeperAsanaFeedWorker.php b/src/applications/doorkeeper/worker/DoorkeeperAsanaFeedWorker.php
--- a/src/applications/doorkeeper/worker/DoorkeeperAsanaFeedWorker.php
+++ b/src/applications/doorkeeper/worker/DoorkeeperAsanaFeedWorker.php
@@ -90,8 +90,8 @@
'pull an OAuth token out of.');
}
- $etype_main = PhabricatorEdgeConfig::TYPE_PHOB_HAS_ASANATASK;
- $etype_sub = PhabricatorEdgeConfig::TYPE_PHOB_HAS_ASANASUBTASK;
+ $etype_main = PhabricatorObjectHasAsanaTaskEdgeType::EDGECONST;
+ $etype_sub = PhabricatorObjectHasAsanaSubtaskEdgeType::EDGECONST;
$equery = id(new PhabricatorEdgeQuery())
->withSourcePHIDs(array($src_phid))
diff --git a/src/applications/doorkeeper/worker/DoorkeeperJIRAFeedWorker.php b/src/applications/doorkeeper/worker/DoorkeeperJIRAFeedWorker.php
--- a/src/applications/doorkeeper/worker/DoorkeeperJIRAFeedWorker.php
+++ b/src/applications/doorkeeper/worker/DoorkeeperJIRAFeedWorker.php
@@ -32,7 +32,7 @@
$jira_issue_phids = PhabricatorEdgeQuery::loadDestinationPHIDs(
$object->getPHID(),
- PhabricatorEdgeConfig::TYPE_PHOB_HAS_JIRAISSUE);
+ PhabricatorJiraIssueHasObjectEdgeType::EDGECONST);
if (!$jira_issue_phids) {
$this->log("Story is about an object with no linked JIRA issues.\n");
return;
diff --git a/src/applications/files/edge/PhabricatorFileHasObjectEdgeType.php b/src/applications/files/edge/PhabricatorFileHasObjectEdgeType.php
new file mode 100644
--- /dev/null
+++ b/src/applications/files/edge/PhabricatorFileHasObjectEdgeType.php
@@ -0,0 +1,15 @@
+<?php
+
+final class PhabricatorFileHasObjectEdgeType extends PhabricatorEdgeType {
+
+ const EDGECONST = 26;
+
+ public function getInverseEdgeConstant() {
+ return PhabricatorObjectHasFileEdgeType::EDGECONST;
+ }
+
+ public function shouldWriteInverseTransactions() {
+ return true;
+ }
+
+}
diff --git a/src/applications/files/query/PhabricatorFileQuery.php b/src/applications/files/query/PhabricatorFileQuery.php
--- a/src/applications/files/query/PhabricatorFileQuery.php
+++ b/src/applications/files/query/PhabricatorFileQuery.php
@@ -116,7 +116,7 @@
// We need to load attached objects to perform policy checks for files.
// First, load the edges.
- $edge_type = PhabricatorEdgeConfig::TYPE_FILE_HAS_OBJECT;
+ $edge_type = PhabricatorFileHasObjectEdgeType::EDGECONST;
$file_phids = mpull($files, 'getPHID');
$edges = id(new PhabricatorEdgeQuery())
->withSourcePHIDs($file_phids)
diff --git a/src/applications/files/storage/PhabricatorFile.php b/src/applications/files/storage/PhabricatorFile.php
--- a/src/applications/files/storage/PhabricatorFile.php
+++ b/src/applications/files/storage/PhabricatorFile.php
@@ -991,7 +991,7 @@
* @return this
*/
public function attachToObject($phid) {
- $edge_type = PhabricatorEdgeConfig::TYPE_OBJECT_HAS_FILE;
+ $edge_type = PhabricatorObjectHasFileEdgeType::EDGECONST;
id(new PhabricatorEdgeEditor())
->addEdge($phid, $edge_type, $this->getPHID())
@@ -1008,7 +1008,7 @@
* @return this
*/
public function detachFromObject($phid) {
- $edge_type = PhabricatorEdgeConfig::TYPE_OBJECT_HAS_FILE;
+ $edge_type = PhabricatorObjectHasFileEdgeType::EDGECONST;
id(new PhabricatorEdgeEditor())
->removeEdge($phid, $edge_type, $this->getPHID())
diff --git a/src/applications/legalpad/editor/LegalpadDocumentEditor.php b/src/applications/legalpad/editor/LegalpadDocumentEditor.php
--- a/src/applications/legalpad/editor/LegalpadDocumentEditor.php
+++ b/src/applications/legalpad/editor/LegalpadDocumentEditor.php
@@ -110,12 +110,12 @@
$object->setDocumentBodyPHID($body->getPHID());
$actor = $this->getActor();
- $type = PhabricatorEdgeConfig::TYPE_CONTRIBUTED_TO_OBJECT;
+ $type = PhabricatorContributedToObjectEdgeType::EDGECONST;
id(new PhabricatorEdgeEditor())
->addEdge($actor->getPHID(), $type, $object->getPHID())
->save();
- $type = PhabricatorEdgeConfig::TYPE_OBJECT_HAS_CONTRIBUTOR;
+ $type = PhabricatorObjectHasContributorEdgeType::EDGECONST;
$contributors = PhabricatorEdgeQuery::loadDestinationPHIDs(
$object->getPHID(),
$type);
diff --git a/src/applications/legalpad/query/LegalpadDocumentQuery.php b/src/applications/legalpad/query/LegalpadDocumentQuery.php
--- a/src/applications/legalpad/query/LegalpadDocumentQuery.php
+++ b/src/applications/legalpad/query/LegalpadDocumentQuery.php
@@ -136,7 +136,7 @@
$conn_r,
'JOIN edge contributor ON contributor.src = d.phid
AND contributor.type = %d',
- PhabricatorEdgeConfig::TYPE_OBJECT_HAS_CONTRIBUTOR);
+ PhabricatorObjectHasContributorEdgeType::EDGECONST);
}
if ($this->signerPHIDs !== null) {
@@ -226,7 +226,7 @@
private function loadContributors(array $documents) {
$document_map = mpull($documents, null, 'getPHID');
- $edge_type = PhabricatorEdgeConfig::TYPE_OBJECT_HAS_CONTRIBUTOR;
+ $edge_type = PhabricatorObjectHasContributorEdgeType::EDGECONST;
$contributor_data = id(new PhabricatorEdgeQuery())
->withSourcePHIDs(array_keys($document_map))
->withEdgeTypes(array($edge_type))
diff --git a/src/applications/maniphest/query/ManiphestTaskQuery.php b/src/applications/maniphest/query/ManiphestTaskQuery.php
--- a/src/applications/maniphest/query/ManiphestTaskQuery.php
+++ b/src/applications/maniphest/query/ManiphestTaskQuery.php
@@ -726,7 +726,7 @@
'AND e_ccs.type = %s '.
'AND e_ccs.dst in (%Ls)',
PhabricatorEdgeConfig::TABLE_NAME_EDGE,
- PhabricatorEdgeConfig::TYPE_OBJECT_HAS_SUBSCRIBER,
+ PhabricatorObjectHasSubscriberEdgeType::EDGECONST,
$this->subscriberPHIDs);
}
diff --git a/src/applications/passphrase/controller/PassphraseCredentialViewController.php b/src/applications/passphrase/controller/PassphraseCredentialViewController.php
--- a/src/applications/passphrase/controller/PassphraseCredentialViewController.php
+++ b/src/applications/passphrase/controller/PassphraseCredentialViewController.php
@@ -188,7 +188,7 @@
$used_by_phids = PhabricatorEdgeQuery::loadDestinationPHIDs(
$credential->getPHID(),
- PhabricatorEdgeConfig::TYPE_CREDENTIAL_USED_BY_OBJECT);
+ PhabricatorCredentialsUsedByObjectEdgeType::EDGECONST);
if ($used_by_phids) {
$this->loadHandles($used_by_phids);
diff --git a/src/applications/passphrase/edge/PhabricatorCredentialsUsedByObjectEdgeType.php b/src/applications/passphrase/edge/PhabricatorCredentialsUsedByObjectEdgeType.php
new file mode 100644
--- /dev/null
+++ b/src/applications/passphrase/edge/PhabricatorCredentialsUsedByObjectEdgeType.php
@@ -0,0 +1,16 @@
+<?php
+
+final class PhabricatorCredentialsUsedByObjectEdgeType
+ extends PhabricatorEdgeType {
+
+ const EDGECONST = 40;
+
+ public function getInverseEdgeConstant() {
+ return PhabricatorObjectUsesCredentialsEdgeType::EDGECONST;
+ }
+
+ public function shouldWriteInverseTransactions() {
+ return true;
+ }
+
+}
diff --git a/src/applications/project/controller/PhabricatorProjectWatchController.php b/src/applications/project/controller/PhabricatorProjectWatchController.php
--- a/src/applications/project/controller/PhabricatorProjectWatchController.php
+++ b/src/applications/project/controller/PhabricatorProjectWatchController.php
@@ -45,7 +45,7 @@
break;
}
- $type_member = PhabricatorEdgeConfig::TYPE_OBJECT_HAS_WATCHER;
+ $type_member = PhabricatorObjectHasWatcherEdgeType::EDGECONST;
$member_spec = array(
$edge_action => array($viewer->getPHID() => $viewer->getPHID()),
);
diff --git a/src/applications/project/editor/PhabricatorProjectTransactionEditor.php b/src/applications/project/editor/PhabricatorProjectTransactionEditor.php
--- a/src/applications/project/editor/PhabricatorProjectTransactionEditor.php
+++ b/src/applications/project/editor/PhabricatorProjectTransactionEditor.php
@@ -180,7 +180,7 @@
$edge_type = $xaction->getMetadataValue('edge:type');
switch ($edge_type) {
case PhabricatorProjectProjectHasMemberEdgeType::EDGECONST:
- case PhabricatorEdgeConfig::TYPE_OBJECT_HAS_WATCHER:
+ case PhabricatorObjectHasWatcherEdgeType::EDGECONST:
$old = $xaction->getOldValue();
$new = $xaction->getNewValue();
@@ -221,7 +221,7 @@
foreach ($rem as $rem_phid) {
$edge_editor->removeEdge(
$object->getPHID(),
- PhabricatorEdgeConfig::TYPE_OBJECT_HAS_WATCHER,
+ PhabricatorObjectHasWatcherEdgeType::EDGECONST,
$rem_phid);
}
$edge_editor->save();
diff --git a/src/applications/project/query/PhabricatorProjectQuery.php b/src/applications/project/query/PhabricatorProjectQuery.php
--- a/src/applications/project/query/PhabricatorProjectQuery.php
+++ b/src/applications/project/query/PhabricatorProjectQuery.php
@@ -139,7 +139,7 @@
$project_phids = mpull($projects, 'getPHID');
$member_type = PhabricatorProjectProjectHasMemberEdgeType::EDGECONST;
- $watcher_type = PhabricatorEdgeConfig::TYPE_OBJECT_HAS_WATCHER;
+ $watcher_type = PhabricatorObjectHasWatcherEdgeType::EDGECONST;
$need_edge_types = array();
if ($this->needMembers) {
diff --git a/src/applications/repository/editor/PhabricatorRepositoryEditor.php b/src/applications/repository/editor/PhabricatorRepositoryEditor.php
--- a/src/applications/repository/editor/PhabricatorRepositoryEditor.php
+++ b/src/applications/repository/editor/PhabricatorRepositoryEditor.php
@@ -242,7 +242,7 @@
$editor = new PhabricatorEdgeEditor();
- $edge_type = PhabricatorEdgeConfig::TYPE_OBJECT_USES_CREDENTIAL;
+ $edge_type = PhabricatorObjectUsesCredentialsEdgeType::EDGECONST;
$src_phid = $object->getPHID();
if ($old_phid) {
diff --git a/src/applications/subscriptions/editor/PhabricatorSubscriptionsEditor.php b/src/applications/subscriptions/editor/PhabricatorSubscriptionsEditor.php
--- a/src/applications/subscriptions/editor/PhabricatorSubscriptionsEditor.php
+++ b/src/applications/subscriptions/editor/PhabricatorSubscriptionsEditor.php
@@ -65,7 +65,7 @@
if ($this->implicitSubscribePHIDs) {
$unsub = PhabricatorEdgeQuery::loadDestinationPHIDs(
$src,
- PhabricatorEdgeConfig::TYPE_OBJECT_HAS_UNSUBSCRIBER);
+ PhabricatorObjectHasUnsubscriberEdgeType::EDGECONST);
$unsub = array_fill_keys($unsub, true);
$this->implicitSubscribePHIDs = array_diff_key(
$this->implicitSubscribePHIDs,
@@ -80,8 +80,8 @@
$add = array_diff_key($add, $del);
if ($add || $del) {
- $u_type = PhabricatorEdgeConfig::TYPE_OBJECT_HAS_UNSUBSCRIBER;
- $s_type = PhabricatorEdgeConfig::TYPE_OBJECT_HAS_SUBSCRIBER;
+ $u_type = PhabricatorObjectHasUnsubscriberEdgeType::EDGECONST;
+ $s_type = PhabricatorObjectHasSubscriberEdgeType::EDGECONST;
$editor = new PhabricatorEdgeEditor();
diff --git a/src/applications/subscriptions/events/PhabricatorSubscriptionsUIEventListener.php b/src/applications/subscriptions/events/PhabricatorSubscriptionsUIEventListener.php
--- a/src/applications/subscriptions/events/PhabricatorSubscriptionsUIEventListener.php
+++ b/src/applications/subscriptions/events/PhabricatorSubscriptionsUIEventListener.php
@@ -51,7 +51,7 @@
if ($user->isLoggedIn()) {
$src_phid = $object->getPHID();
$dst_phid = $user->getPHID();
- $edge_type = PhabricatorEdgeConfig::TYPE_OBJECT_HAS_SUBSCRIBER;
+ $edge_type = PhabricatorObjectHasSubscriberEdgeType::EDGECONST;
$edges = id(new PhabricatorEdgeQuery())
->withSourcePHIDs(array($src_phid))
diff --git a/src/applications/subscriptions/query/PhabricatorSubscribersQuery.php b/src/applications/subscriptions/query/PhabricatorSubscribersQuery.php
--- a/src/applications/subscriptions/query/PhabricatorSubscribersQuery.php
+++ b/src/applications/subscriptions/query/PhabricatorSubscribersQuery.php
@@ -29,7 +29,7 @@
public function execute() {
$query = new PhabricatorEdgeQuery();
- $edge_type = PhabricatorEdgeConfig::TYPE_OBJECT_HAS_SUBSCRIBER;
+ $edge_type = PhabricatorObjectHasSubscriberEdgeType::EDGECONST;
$query->withSourcePHIDs($this->objectPHIDs);
$query->withEdgeTypes(array($edge_type));
diff --git a/src/applications/transactions/edges/PhabricatorContributedToObjectEdgeType.php b/src/applications/transactions/edges/PhabricatorContributedToObjectEdgeType.php
new file mode 100644
--- /dev/null
+++ b/src/applications/transactions/edges/PhabricatorContributedToObjectEdgeType.php
@@ -0,0 +1,15 @@
+<?php
+
+final class PhabricatorContributedToObjectEdgeType extends PhabricatorEdgeType {
+
+ const EDGECONST = 34;
+
+ public function getInverseEdgeConstant() {
+ return PhabricatorObjectHasContributorEdgeType::EDGECONST;
+ }
+
+ public function shouldWriteInverseTransactions() {
+ return true;
+ }
+
+}
diff --git a/src/applications/transactions/edges/PhabricatorObjectHasContributorEdgeType.php b/src/applications/transactions/edges/PhabricatorObjectHasContributorEdgeType.php
new file mode 100644
--- /dev/null
+++ b/src/applications/transactions/edges/PhabricatorObjectHasContributorEdgeType.php
@@ -0,0 +1,104 @@
+<?php
+
+final class PhabricatorObjectHasContributorEdgeType
+ extends PhabricatorEdgeType {
+
+ const EDGECONST = 33;
+
+ public function getInverseEdgeConstant() {
+ return PhabricatorContributedToObjectEdgeType::EDGECONST;
+ }
+
+ public function shouldWriteInverseTransactions() {
+ return true;
+ }
+
+ public function getTransactionAddString(
+ $actor,
+ $add_count,
+ $add_edges) {
+
+ return pht(
+ '%s added %s contributor(s): %s.',
+ $actor,
+ $add_count,
+ $add_edges);
+ }
+
+ public function getTransactionRemoveString(
+ $actor,
+ $rem_count,
+ $rem_edges) {
+
+ return pht(
+ '%s removed %s contributor(s): %s.',
+ $actor,
+ $rem_count,
+ $rem_edges);
+ }
+
+ public function getTransactionEditString(
+ $actor,
+ $total_count,
+ $add_count,
+ $add_edges,
+ $rem_count,
+ $rem_edges) {
+
+ return pht(
+ '%s edited contributor(s), added %s: %s; removed %s: %s.',
+ $actor,
+ $add_count,
+ $add_edges,
+ $rem_count,
+ $rem_edges);
+ }
+
+ public function getFeedAddString(
+ $actor,
+ $object,
+ $add_count,
+ $add_edges) {
+
+ return pht(
+ '%s added %s contributor(s) for %s: %s.',
+ $actor,
+ $add_count,
+ $object,
+ $add_edges);
+ }
+
+ public function getFeedRemoveString(
+ $actor,
+ $object,
+ $rem_count,
+ $rem_edges) {
+
+ return pht(
+ '%s removed %s contributor(s) for %s: %s.',
+ $actor,
+ $rem_count,
+ $object,
+ $rem_edges);
+ }
+
+ public function getFeedEditString(
+ $actor,
+ $object,
+ $total_count,
+ $add_count,
+ $add_edges,
+ $rem_count,
+ $rem_edges) {
+
+ return pht(
+ '%s edited contributor(s) for %s, added %s: %s; removed %s: %s.',
+ $actor,
+ $object,
+ $add_count,
+ $add_edges,
+ $rem_count,
+ $rem_edges);
+ }
+
+}
diff --git a/src/applications/transactions/edges/PhabricatorObjectHasFileEdgeType.php b/src/applications/transactions/edges/PhabricatorObjectHasFileEdgeType.php
new file mode 100644
--- /dev/null
+++ b/src/applications/transactions/edges/PhabricatorObjectHasFileEdgeType.php
@@ -0,0 +1,103 @@
+<?php
+
+final class PhabricatorObjectHasFileEdgeType extends PhabricatorEdgeType {
+
+ const EDGECONST = 25;
+
+ public function getInverseEdgeConstant() {
+ return PhabricatorFileHasObjectEdgeType::EDGECONST;
+ }
+
+ public function shouldWriteInverseTransactions() {
+ return true;
+ }
+
+ public function getTransactionAddString(
+ $actor,
+ $add_count,
+ $add_edges) {
+
+ return pht(
+ '%s added %s file(s): %s.',
+ $actor,
+ $add_count,
+ $add_edges);
+ }
+
+ public function getTransactionRemoveString(
+ $actor,
+ $rem_count,
+ $rem_edges) {
+
+ return pht(
+ '%s removed %s file(s): %s.',
+ $actor,
+ $rem_count,
+ $rem_edges);
+ }
+
+ public function getTransactionEditString(
+ $actor,
+ $total_count,
+ $add_count,
+ $add_edges,
+ $rem_count,
+ $rem_edges) {
+
+ return pht(
+ '%s edited file(s), added %s: %s; removed %s: %s.',
+ $actor,
+ $add_count,
+ $add_edges,
+ $rem_count,
+ $rem_edges);
+ }
+
+ public function getFeedAddString(
+ $actor,
+ $object,
+ $add_count,
+ $add_edges) {
+
+ return pht(
+ '%s added %s file(s) for %s: %s.',
+ $actor,
+ $add_count,
+ $object,
+ $add_edges);
+ }
+
+ public function getFeedRemoveString(
+ $actor,
+ $object,
+ $rem_count,
+ $rem_edges) {
+
+ return pht(
+ '%s removed %s file(s) for %s: %s.',
+ $actor,
+ $rem_count,
+ $object,
+ $rem_edges);
+ }
+
+ public function getFeedEditString(
+ $actor,
+ $object,
+ $total_count,
+ $add_count,
+ $add_edges,
+ $rem_count,
+ $rem_edges) {
+
+ return pht(
+ '%s edited file(s) for %s, added %s: %s; removed %s: %s.',
+ $actor,
+ $object,
+ $add_count,
+ $add_edges,
+ $rem_count,
+ $rem_edges);
+ }
+
+}
diff --git a/src/applications/transactions/edges/PhabricatorObjectHasSubscriberEdgeType.php b/src/applications/transactions/edges/PhabricatorObjectHasSubscriberEdgeType.php
new file mode 100644
--- /dev/null
+++ b/src/applications/transactions/edges/PhabricatorObjectHasSubscriberEdgeType.php
@@ -0,0 +1,103 @@
+<?php
+
+final class PhabricatorObjectHasSubscriberEdgeType extends PhabricatorEdgeType {
+
+ const EDGECONST = 21;
+
+ public function getInverseEdgeConstant() {
+ return PhabricatorSubscribedToObjectEdgeType::EDGECONST;
+ }
+
+ public function shouldWriteInverseTransactions() {
+ return true;
+ }
+
+ public function getTransactionAddString(
+ $actor,
+ $add_count,
+ $add_edges) {
+
+ return pht(
+ '%s added %s subscriber(s): %s.',
+ $actor,
+ $add_count,
+ $add_edges);
+ }
+
+ public function getTransactionRemoveString(
+ $actor,
+ $rem_count,
+ $rem_edges) {
+
+ return pht(
+ '%s removed %s subscriber(s): %s.',
+ $actor,
+ $rem_count,
+ $rem_edges);
+ }
+
+ public function getTransactionEditString(
+ $actor,
+ $total_count,
+ $add_count,
+ $add_edges,
+ $rem_count,
+ $rem_edges) {
+
+ return pht(
+ '%s edited subscriber(s), added %s: %s; removed %s: %s.',
+ $actor,
+ $add_count,
+ $add_edges,
+ $rem_count,
+ $rem_edges);
+ }
+
+ public function getFeedAddString(
+ $actor,
+ $object,
+ $add_count,
+ $add_edges) {
+
+ return pht(
+ '%s added %s subscriber(s) for %s: %s.',
+ $actor,
+ $add_count,
+ $object,
+ $add_edges);
+ }
+
+ public function getFeedRemoveString(
+ $actor,
+ $object,
+ $rem_count,
+ $rem_edges) {
+
+ return pht(
+ '%s removed %s subscriber(s) for %s: %s.',
+ $actor,
+ $rem_count,
+ $object,
+ $rem_edges);
+ }
+
+ public function getFeedEditString(
+ $actor,
+ $object,
+ $total_count,
+ $add_count,
+ $add_edges,
+ $rem_count,
+ $rem_edges) {
+
+ return pht(
+ '%s edited subscriber(s) for %s, added %s: %s; removed %s: %s.',
+ $actor,
+ $object,
+ $add_count,
+ $add_edges,
+ $rem_count,
+ $rem_edges);
+ }
+
+}
diff --git a/src/applications/transactions/edges/PhabricatorObjectHasUnsubscriberEdgeType.php b/src/applications/transactions/edges/PhabricatorObjectHasUnsubscriberEdgeType.php
new file mode 100644
--- /dev/null
+++ b/src/applications/transactions/edges/PhabricatorObjectHasUnsubscriberEdgeType.php
@@ -0,0 +1,104 @@
+<?php
+
+final class PhabricatorObjectHasUnsubscriberEdgeType
+ extends PhabricatorEdgeType {
+
+ const EDGECONST = 23;
+
+ public function getInverseEdgeConstant() {
+ return PhabricatorUnsubscribedFromObjectEdgeType::EDGECONST;
+ }
+
+ public function shouldWriteInverseTransactions() {
+ return true;
+ }
+
+ public function getTransactionAddString(
+ $actor,
+ $add_count,
+ $add_edges) {
+
+ return pht(
+ '%s added %s unsubscriber(s): %s.',
+ $actor,
+ $add_count,
+ $add_edges);
+ }
+
+ public function getTransactionRemoveString(
+ $actor,
+ $rem_count,
+ $rem_edges) {
+
+ return pht(
+ '%s removed %s unsubscriber(s): %s.',
+ $actor,
+ $rem_count,
+ $rem_edges);
+ }
+
+ public function getTransactionEditString(
+ $actor,
+ $total_count,
+ $add_count,
+ $add_edges,
+ $rem_count,
+ $rem_edges) {
+
+ return pht(
+ '%s edited unsubscriber(s), added %s: %s; removed %s: %s.',
+ $actor,
+ $add_count,
+ $add_edges,
+ $rem_count,
+ $rem_edges);
+ }
+
+ public function getFeedAddString(
+ $actor,
+ $object,
+ $add_count,
+ $add_edges) {
+
+ return pht(
+ '%s added %s unsubscriber(s) for %s: %s.',
+ $actor,
+ $add_count,
+ $object,
+ $add_edges);
+ }
+
+ public function getFeedRemoveString(
+ $actor,
+ $object,
+ $rem_count,
+ $rem_edges) {
+
+ return pht(
+ '%s removed %s unsubscriber(s) for %s: %s.',
+ $actor,
+ $rem_count,
+ $object,
+ $rem_edges);
+ }
+
+ public function getFeedEditString(
+ $actor,
+ $object,
+ $total_count,
+ $add_count,
+ $add_edges,
+ $rem_count,
+ $rem_edges) {
+
+ return pht(
+ '%s edited unsubscriber(s) for %s, added %s: %s; removed %s: %s.',
+ $actor,
+ $object,
+ $add_count,
+ $add_edges,
+ $rem_count,
+ $rem_edges);
+ }
+
+}
diff --git a/src/applications/transactions/edges/PhabricatorObjectHasWatcherEdgeType.php b/src/applications/transactions/edges/PhabricatorObjectHasWatcherEdgeType.php
new file mode 100644
--- /dev/null
+++ b/src/applications/transactions/edges/PhabricatorObjectHasWatcherEdgeType.php
@@ -0,0 +1,103 @@
+<?php
+
+final class PhabricatorObjectHasWatcherEdgeType extends PhabricatorEdgeType {
+
+ const EDGECONST = 47;
+
+ public function getInverseEdgeConstant() {
+ return PhabricatorWatcherHasObjectEdgeType::EDGECONST;
+ }
+
+ public function shouldWriteInverseTransactions() {
+ return true;
+ }
+
+ public function getTransactionAddString(
+ $actor,
+ $add_count,
+ $add_edges) {
+
+ return pht(
+ '%s added %s watcher(s): %s.',
+ $actor,
+ $add_count,
+ $add_edges);
+ }
+
+ public function getTransactionRemoveString(
+ $actor,
+ $rem_count,
+ $rem_edges) {
+
+ return pht(
+ '%s removed %s watcher(s): %s.',
+ $actor,
+ $rem_count,
+ $rem_edges);
+ }
+
+ public function getTransactionEditString(
+ $actor,
+ $total_count,
+ $add_count,
+ $add_edges,
+ $rem_count,
+ $rem_edges) {
+
+ return pht(
+ '%s edited watcher(s), added %s: %s; removed %s: %s.',
+ $actor,
+ $add_count,
+ $add_edges,
+ $rem_count,
+ $rem_edges);
+ }
+
+ public function getFeedAddString(
+ $actor,
+ $object,
+ $add_count,
+ $add_edges) {
+
+ return pht(
+ '%s added %s watcher(s) for %s: %s.',
+ $actor,
+ $add_count,
+ $object,
+ $add_edges);
+ }
+
+ public function getFeedRemoveString(
+ $actor,
+ $object,
+ $rem_count,
+ $rem_edges) {
+
+ return pht(
+ '%s removed %s watcher(s) for %s: %s.',
+ $actor,
+ $rem_count,
+ $object,
+ $rem_edges);
+ }
+
+ public function getFeedEditString(
+ $actor,
+ $object,
+ $total_count,
+ $add_count,
+ $add_edges,
+ $rem_count,
+ $rem_edges) {
+
+ return pht(
+ '%s edited watcher(s) for %s, added %s: %s; removed %s: %s.',
+ $actor,
+ $object,
+ $add_count,
+ $add_edges,
+ $rem_count,
+ $rem_edges);
+ }
+
+}
diff --git a/src/applications/transactions/edges/PhabricatorObjectUsesCredentialsEdgeType.php b/src/applications/transactions/edges/PhabricatorObjectUsesCredentialsEdgeType.php
new file mode 100644
--- /dev/null
+++ b/src/applications/transactions/edges/PhabricatorObjectUsesCredentialsEdgeType.php
@@ -0,0 +1,16 @@
+<?php
+
+final class PhabricatorObjectUsesCredentialsEdgeType
+ extends PhabricatorEdgeType {
+
+ const EDGECONST = 39;
+
+ public function getInverseEdgeConstant() {
+ return PhabricatorCredentialsUsedByObjectEdgeType::EDGECONST;
+ }
+
+ public function shouldWriteInverseTransactions() {
+ return true;
+ }
+
+}
diff --git a/src/applications/transactions/edges/PhabricatorSubscribedToObjectEdgeType.php b/src/applications/transactions/edges/PhabricatorSubscribedToObjectEdgeType.php
new file mode 100644
--- /dev/null
+++ b/src/applications/transactions/edges/PhabricatorSubscribedToObjectEdgeType.php
@@ -0,0 +1,16 @@
+<?php
+
+final class PhabricatorSubscribedToObjectEdgeType
+ extends PhabricatorEdgeType {
+
+ const EDGECONST = 22;
+
+ public function getInverseEdgeConstant() {
+ return PhabricatorObjectHasSubscriberEdgeType::EDGECONST;
+ }
+
+ public function shouldWriteInverseTransactions() {
+ return true;
+ }
+
+}
diff --git a/src/applications/transactions/edges/PhabricatorTestNoCycleEdgeType.php b/src/applications/transactions/edges/PhabricatorTestNoCycleEdgeType.php
new file mode 100644
--- /dev/null
+++ b/src/applications/transactions/edges/PhabricatorTestNoCycleEdgeType.php
@@ -0,0 +1,11 @@
+<?php
+
+final class PhabricatorTestNoCycleEdgeType extends PhabricatorEdgeType {
+
+ const EDGECONST = 9000;
+
+ public function shouldPreventCycles() {
+ return true;
+ }
+
+}
diff --git a/src/applications/transactions/edges/PhabricatorUnsubscribedFromObjectEdgeType.php b/src/applications/transactions/edges/PhabricatorUnsubscribedFromObjectEdgeType.php
new file mode 100644
--- /dev/null
+++ b/src/applications/transactions/edges/PhabricatorUnsubscribedFromObjectEdgeType.php
@@ -0,0 +1,16 @@
+<?php
+
+final class PhabricatorUnsubscribedFromObjectEdgeType
+ extends PhabricatorEdgeType {
+
+ const EDGECONST = 24;
+
+ public function getInverseEdgeConstant() {
+ return PhabricatorObjectHasUnsubscriberEdgeType::EDGECONST;
+ }
+
+ public function shouldWriteInverseTransactions() {
+ return true;
+ }
+
+}
diff --git a/src/applications/transactions/edges/PhabricatorWatcherHasObjectEdgeType.php b/src/applications/transactions/edges/PhabricatorWatcherHasObjectEdgeType.php
new file mode 100644
--- /dev/null
+++ b/src/applications/transactions/edges/PhabricatorWatcherHasObjectEdgeType.php
@@ -0,0 +1,15 @@
+<?php
+
+final class PhabricatorWatcherHasObjectEdgeType extends PhabricatorEdgeType {
+
+ const EDGECONST = 48;
+
+ public function getInverseEdgeConstant() {
+ return PhabricatorObjectHasWatcherEdgeType::EDGECONST;
+ }
+
+ public function shouldWriteInverseTransactions() {
+ return true;
+ }
+
+}
diff --git a/src/applications/transactions/editor/PhabricatorApplicationTransactionCommentEditor.php b/src/applications/transactions/editor/PhabricatorApplicationTransactionCommentEditor.php
--- a/src/applications/transactions/editor/PhabricatorApplicationTransactionCommentEditor.php
+++ b/src/applications/transactions/editor/PhabricatorApplicationTransactionCommentEditor.php
@@ -102,7 +102,7 @@
foreach ($file_phids as $file_phid) {
$editor->addEdge(
$xaction->getObjectPHID(),
- PhabricatorEdgeConfig::TYPE_OBJECT_HAS_FILE,
+ PhabricatorObjectHasFileEdgeType::EDGECONST ,
$file_phid);
}
$editor->save();
diff --git a/src/applications/transactions/editor/PhabricatorApplicationTransactionEditor.php b/src/applications/transactions/editor/PhabricatorApplicationTransactionEditor.php
--- a/src/applications/transactions/editor/PhabricatorApplicationTransactionEditor.php
+++ b/src/applications/transactions/editor/PhabricatorApplicationTransactionEditor.php
@@ -1866,7 +1866,7 @@
$unsub = PhabricatorEdgeQuery::loadDestinationPHIDs(
$object->getPHID(),
- PhabricatorEdgeConfig::TYPE_OBJECT_HAS_UNSUBSCRIBER);
+ PhabricatorObjectHasUnsubscriberEdgeType::EDGECONST);
$unsub = array_fuse($unsub);
if (isset($unsub[$actor_phid])) {
// If the user has previously unsubscribed from this object explicitly,
@@ -2140,7 +2140,7 @@
PhabricatorProjectObjectHasProjectEdgeType::EDGECONST);
if ($project_phids) {
- $watcher_type = PhabricatorEdgeConfig::TYPE_OBJECT_HAS_WATCHER;
+ $watcher_type = PhabricatorObjectHasWatcherEdgeType::EDGECONST;
$query = id(new PhabricatorEdgeQuery())
->withSourcePHIDs($project_phids)
@@ -2525,7 +2525,7 @@
$editor = new PhabricatorEdgeEditor();
$src = $object->getPHID();
- $type = PhabricatorEdgeConfig::TYPE_OBJECT_HAS_FILE;
+ $type = PhabricatorObjectHasFileEdgeType::EDGECONST;
foreach ($file_phids as $dst) {
$editor->addEdge($src, $type, $dst);
}
diff --git a/src/infrastructure/edges/__tests__/PhabricatorEdgeTestCase.php b/src/infrastructure/edges/__tests__/PhabricatorEdgeTestCase.php
--- a/src/infrastructure/edges/__tests__/PhabricatorEdgeTestCase.php
+++ b/src/infrastructure/edges/__tests__/PhabricatorEdgeTestCase.php
@@ -21,8 +21,8 @@
$phid2 = $obj2->getPHID();
$editor = id(new PhabricatorEdgeEditor())
- ->addEdge($phid1, PhabricatorEdgeConfig::TYPE_TEST_NO_CYCLE, $phid2)
- ->addEdge($phid2, PhabricatorEdgeConfig::TYPE_TEST_NO_CYCLE, $phid1);
+ ->addEdge($phid1, PhabricatorTestNoCycleEdgeType::EDGECONST , $phid2)
+ ->addEdge($phid2, PhabricatorTestNoCycleEdgeType::EDGECONST , $phid1);
$caught = null;
try {
@@ -38,11 +38,11 @@
// fail (it introduces a cycle).
$editor = id(new PhabricatorEdgeEditor())
- ->addEdge($phid1, PhabricatorEdgeConfig::TYPE_TEST_NO_CYCLE, $phid2)
+ ->addEdge($phid1, PhabricatorTestNoCycleEdgeType::EDGECONST , $phid2)
->save();
$editor = id(new PhabricatorEdgeEditor())
- ->addEdge($phid2, PhabricatorEdgeConfig::TYPE_TEST_NO_CYCLE, $phid1);
+ ->addEdge($phid2, PhabricatorTestNoCycleEdgeType::EDGECONST , $phid1);
$caught = null;
try {
diff --git a/src/infrastructure/edges/constants/PhabricatorEdgeConfig.php b/src/infrastructure/edges/constants/PhabricatorEdgeConfig.php
--- a/src/infrastructure/edges/constants/PhabricatorEdgeConfig.php
+++ b/src/infrastructure/edges/constants/PhabricatorEdgeConfig.php
@@ -5,133 +5,6 @@
const TABLE_NAME_EDGE = 'edge';
const TABLE_NAME_EDGEDATA = 'edgedata';
- const TYPE_OBJECT_HAS_SUBSCRIBER = 21;
- const TYPE_SUBSCRIBED_TO_OBJECT = 22;
-
- const TYPE_OBJECT_HAS_UNSUBSCRIBER = 23;
- const TYPE_UNSUBSCRIBED_FROM_OBJECT = 24;
-
- const TYPE_OBJECT_HAS_FILE = 25;
- const TYPE_FILE_HAS_OBJECT = 26;
-
- const TYPE_OBJECT_HAS_CONTRIBUTOR = 33;
- const TYPE_CONTRIBUTED_TO_OBJECT = 34;
-
- const TYPE_OBJECT_USES_CREDENTIAL = 39;
- const TYPE_CREDENTIAL_USED_BY_OBJECT = 40;
-
- const TYPE_OBJECT_HAS_WATCHER = 47;
- const TYPE_WATCHER_HAS_OBJECT = 48;
-
-/* !!!! STOP !!!! STOP !!!! STOP !!!! STOP !!!! STOP !!!! STOP !!!! STOP !!!! */
-
- // HEY! DO NOT ADD NEW CONSTANTS HERE!
- // Instead, subclass PhabricatorEdgeType.
-
-/* !!!! STOP !!!! STOP !!!! STOP !!!! STOP !!!! STOP !!!! STOP !!!! STOP !!!! */
-
- const TYPE_TEST_NO_CYCLE = 9000;
-
- const TYPE_PHOB_HAS_ASANATASK = 80001;
- const TYPE_ASANATASK_HAS_PHOB = 80000;
-
- const TYPE_PHOB_HAS_ASANASUBTASK = 80003;
- const TYPE_ASANASUBTASK_HAS_PHOB = 80002;
-
- const TYPE_PHOB_HAS_JIRAISSUE = 80004;
- const TYPE_JIRAISSUE_HAS_PHOB = 80005;
-
-
- /**
- * Build @{class:PhabricatorLegacyEdgeType} objects for edges which have not
- * yet been modernized. This allows code to act as though we've completed
- * the edge type migration before we actually do all the work, by building
- * these fake type objects.
- *
- * @param list<const> List of edge types that objects should not be built for.
- * This is used to avoid constructing duplicate objects for edge constants
- * which have migrated and already have a real object.
- * @return list<PhabricatorLegacyEdgeType> Real-looking edge type objects for
- * unmigrated edge types.
- */
- public static function getLegacyTypes(array $exclude) {
- $consts = array_merge(
- range(1, 50),
- array(9000),
- range(80000, 80005));
-
- $exclude[] = 15; // Was TYPE_COMMIT_HAS_PROJECT
- $exclude[] = 16; // Was TYPE_PROJECT_HAS_COMMIT
-
- $exclude[] = 27; // Was TYPE_ACCOUNT_HAS_MEMBER
- $exclude[] = 28; // Was TYPE_MEMBER_HAS_ACCOUNT
-
- $exclude[] = 43; // Was TYPE_OBJECT_HAS_COLUMN
- $exclude[] = 44; // Was TYPE_COLUMN_HAS_OBJECT
-
- $consts = array_diff($consts, $exclude);
-
- $map = array();
- foreach ($consts as $const) {
- $prevent_cycles = self::shouldPreventCycles($const);
- $inverse_constant = self::getInverse($const);
-
- $map[$const] = id(new PhabricatorLegacyEdgeType())
- ->setEdgeConstant($const)
- ->setShouldPreventCycles($prevent_cycles)
- ->setInverseEdgeConstant($inverse_constant)
- ->setStrings(
- array(
- self::getAddStringForEdgeType($const),
- self::getRemoveStringForEdgeType($const),
- self::getEditStringForEdgeType($const),
- self::getFeedStringForEdgeType($const),
- ));
- }
-
- return $map;
- }
-
- private static function getInverse($edge_type) {
- static $map = array(
- self::TYPE_OBJECT_HAS_SUBSCRIBER => self::TYPE_SUBSCRIBED_TO_OBJECT,
- self::TYPE_SUBSCRIBED_TO_OBJECT => self::TYPE_OBJECT_HAS_SUBSCRIBER,
-
- self::TYPE_OBJECT_HAS_UNSUBSCRIBER => self::TYPE_UNSUBSCRIBED_FROM_OBJECT,
- self::TYPE_UNSUBSCRIBED_FROM_OBJECT => self::TYPE_OBJECT_HAS_UNSUBSCRIBER,
-
- self::TYPE_OBJECT_HAS_FILE => self::TYPE_FILE_HAS_OBJECT,
- self::TYPE_FILE_HAS_OBJECT => self::TYPE_OBJECT_HAS_FILE,
-
- self::TYPE_OBJECT_HAS_CONTRIBUTOR => self::TYPE_CONTRIBUTED_TO_OBJECT,
- self::TYPE_CONTRIBUTED_TO_OBJECT => self::TYPE_OBJECT_HAS_CONTRIBUTOR,
-
- self::TYPE_PHOB_HAS_ASANATASK => self::TYPE_ASANATASK_HAS_PHOB,
- self::TYPE_ASANATASK_HAS_PHOB => self::TYPE_PHOB_HAS_ASANATASK,
-
- self::TYPE_PHOB_HAS_ASANASUBTASK => self::TYPE_ASANASUBTASK_HAS_PHOB,
- self::TYPE_ASANASUBTASK_HAS_PHOB => self::TYPE_PHOB_HAS_ASANASUBTASK,
-
- self::TYPE_PHOB_HAS_JIRAISSUE => self::TYPE_JIRAISSUE_HAS_PHOB,
- self::TYPE_JIRAISSUE_HAS_PHOB => self::TYPE_PHOB_HAS_JIRAISSUE,
-
- self::TYPE_OBJECT_USES_CREDENTIAL => self::TYPE_CREDENTIAL_USED_BY_OBJECT,
- self::TYPE_CREDENTIAL_USED_BY_OBJECT => self::TYPE_OBJECT_USES_CREDENTIAL,
-
- self::TYPE_OBJECT_HAS_WATCHER => self::TYPE_WATCHER_HAS_OBJECT,
- self::TYPE_WATCHER_HAS_OBJECT => self::TYPE_OBJECT_HAS_WATCHER,
- );
-
- return idx($map, $edge_type);
- }
-
- private static function shouldPreventCycles($edge_type) {
- static $map = array(
- self::TYPE_TEST_NO_CYCLE => true,
- );
- return isset($map[$edge_type]);
- }
-
public static function establishConnection($phid_type, $conn_type) {
$map = PhabricatorPHIDType::getAllTypes();
if (isset($map[$phid_type])) {
@@ -157,95 +30,4 @@
return newv($class, array())->establishConnection($conn_type);
}
- public static function getEditStringForEdgeType($type) {
- switch ($type) {
- case self::TYPE_OBJECT_HAS_SUBSCRIBER:
- return '%s edited subscriber(s), added %d: %s; removed %d: %s.';
- case self::TYPE_SUBSCRIBED_TO_OBJECT:
- case self::TYPE_UNSUBSCRIBED_FROM_OBJECT:
- case self::TYPE_FILE_HAS_OBJECT:
- case self::TYPE_CONTRIBUTED_TO_OBJECT:
- return '%s edited object(s), added %d: %s; removed %d: %s.';
- case self::TYPE_OBJECT_HAS_UNSUBSCRIBER:
- return '%s edited unsubcriber(s), added %d: %s; removed %d: %s.';
- case self::TYPE_OBJECT_HAS_FILE:
- return '%s edited file(s), added %d: %s; removed %d: %s.';
- case self::TYPE_OBJECT_HAS_CONTRIBUTOR:
- return '%s edited contributor(s), added %d: %s; removed %d: %s.';
- case self::TYPE_SUBSCRIBED_TO_OBJECT:
- case self::TYPE_UNSUBSCRIBED_FROM_OBJECT:
- case self::TYPE_FILE_HAS_OBJECT:
- case self::TYPE_CONTRIBUTED_TO_OBJECT:
- default:
- return '%s edited object(s), added %d: %s; removed %d: %s.';
-
- }
- }
-
- public static function getAddStringForEdgeType($type) {
- switch ($type) {
- case self::TYPE_OBJECT_HAS_SUBSCRIBER:
- return '%s added %d subscriber(s): %s.';
- case self::TYPE_OBJECT_HAS_UNSUBSCRIBER:
- return '%s added %d unsubcriber(s): %s.';
- case self::TYPE_OBJECT_HAS_FILE:
- return '%s added %d file(s): %s.';
- case self::TYPE_OBJECT_HAS_CONTRIBUTOR:
- return '%s added %d contributor(s): %s.';
- case self::TYPE_OBJECT_HAS_WATCHER:
- return '%s added %d watcher(s): %s.';
- case self::TYPE_SUBSCRIBED_TO_OBJECT:
- case self::TYPE_UNSUBSCRIBED_FROM_OBJECT:
- case self::TYPE_FILE_HAS_OBJECT:
- case self::TYPE_CONTRIBUTED_TO_OBJECT:
- default:
- return '%s added %d object(s): %s.';
-
- }
- }
-
- public static function getRemoveStringForEdgeType($type) {
- switch ($type) {
- case self::TYPE_OBJECT_HAS_SUBSCRIBER:
- return '%s removed %d subscriber(s): %s.';
- case self::TYPE_OBJECT_HAS_UNSUBSCRIBER:
- return '%s removed %d unsubcriber(s): %s.';
- case self::TYPE_OBJECT_HAS_FILE:
- return '%s removed %d file(s): %s.';
- case self::TYPE_OBJECT_HAS_CONTRIBUTOR:
- return '%s removed %d contributor(s): %s.';
- case self::TYPE_OBJECT_HAS_WATCHER:
- return '%s removed %d watcher(s): %s.';
- case self::TYPE_SUBSCRIBED_TO_OBJECT:
- case self::TYPE_UNSUBSCRIBED_FROM_OBJECT:
- case self::TYPE_FILE_HAS_OBJECT:
- case self::TYPE_CONTRIBUTED_TO_OBJECT:
- default:
- return '%s removed %d object(s): %s.';
-
- }
- }
-
- public static function getFeedStringForEdgeType($type) {
- switch ($type) {
- case self::TYPE_OBJECT_HAS_SUBSCRIBER:
- return '%s updated subscribers of %s.';
- case self::TYPE_OBJECT_HAS_UNSUBSCRIBER:
- return '%s updated unsubcribers of %s.';
- case self::TYPE_OBJECT_HAS_FILE:
- return '%s updated files of %s.';
- case self::TYPE_OBJECT_HAS_CONTRIBUTOR:
- return '%s updated contributors of %s.';
- case self::TYPE_OBJECT_HAS_WATCHER:
- return '%s updated watchers for %s.';
- case self::TYPE_SUBSCRIBED_TO_OBJECT:
- case self::TYPE_UNSUBSCRIBED_FROM_OBJECT:
- case self::TYPE_FILE_HAS_OBJECT:
- case self::TYPE_CONTRIBUTED_TO_OBJECT:
- default:
- return '%s updated objects of %s.';
-
- }
- }
-
}
diff --git a/src/infrastructure/edges/type/PhabricatorEdgeType.php b/src/infrastructure/edges/type/PhabricatorEdgeType.php
--- a/src/infrastructure/edges/type/PhabricatorEdgeType.php
+++ b/src/infrastructure/edges/type/PhabricatorEdgeType.php
@@ -11,8 +11,7 @@
*/
abstract class PhabricatorEdgeType extends Phobject {
- // TODO: Make this final after we remove PhabricatorLegacyEdgeType.
- /* final */ public function getEdgeConstant() {
+ final public function getEdgeConstant() {
$class = new ReflectionClass($this);
$const = $class->getConstant('EDGECONST');
@@ -159,13 +158,6 @@
$map = array();
-
- // TODO: Remove this once everything is migrated.
- $exclude = mpull($types, 'getEdgeConstant');
- $map = PhabricatorEdgeConfig::getLegacyTypes($exclude);
- unset($types['PhabricatorLegacyEdgeType']);
-
-
foreach ($types as $class => $type) {
$const = $type->getEdgeConstant();
diff --git a/src/infrastructure/edges/type/PhabricatorLegacyEdgeType.php b/src/infrastructure/edges/type/PhabricatorLegacyEdgeType.php
deleted file mode 100644
--- a/src/infrastructure/edges/type/PhabricatorLegacyEdgeType.php
+++ /dev/null
@@ -1,119 +0,0 @@
-<?php
-
-/**
- * Supports legacy edges. Do not use or extend this class!
- *
- * TODO: Move all edge constants out of @{class:PhabricatorEdgeConfig}, then
- * throw this away.
- */
-final class PhabricatorLegacyEdgeType extends PhabricatorEdgeType {
-
- private $edgeConstant;
- private $inverseEdgeConstant;
- private $shouldPreventCycles;
- private $strings;
-
- public function getEdgeConstant() {
- return $this->edgeConstant;
- }
-
- public function getInverseEdgeConstant() {
- return $this->inverseEdgeConstant;
- }
-
- public function shouldPreventCycles() {
- return $this->shouldPreventCycles;
- }
-
- public function setEdgeConstant($edge_constant) {
- $this->edgeConstant = $edge_constant;
- return $this;
- }
-
- public function setInverseEdgeConstant($inverse_edge_constant) {
- $this->inverseEdgeConstant = $inverse_edge_constant;
- return $this;
- }
-
- public function setShouldPreventCycles($should_prevent_cycles) {
- $this->shouldPreventCycles = $should_prevent_cycles;
- return $this;
- }
-
- public function setStrings(array $strings) {
- $this->strings = $strings;
- return $this;
- }
-
- private function getString($idx, array $argv) {
- array_unshift($argv, idx($this->strings, $idx, ''));
-
- // TODO: Burn this class in a fire. Just hiding this from lint for now.
- $pht_func = 'pht';
- return call_user_func_array($pht_func, $argv);
- }
-
- public function getTransactionAddString(
- $actor,
- $add_count,
- $add_edges) {
-
- $args = func_get_args();
- return $this->getString(0, $args);
- }
-
- public function getTransactionRemoveString(
- $actor,
- $rem_count,
- $rem_edges) {
-
- $args = func_get_args();
- return $this->getString(1, $args);
- }
-
- public function getTransactionEditString(
- $actor,
- $total_count,
- $add_count,
- $add_edges,
- $rem_count,
- $rem_edges) {
-
- $args = func_get_args();
- return $this->getString(2, $args);
- }
-
- public function getFeedAddString(
- $actor,
- $object,
- $add_count,
- $add_edges) {
-
- $args = func_get_args();
- return $this->getString(3, $args);
- }
-
- public function getFeedRemoveString(
- $actor,
- $object,
- $rem_count,
- $rem_edges) {
-
- $args = func_get_args();
- return $this->getString(3, $args);
- }
-
- public function getFeedEditString(
- $actor,
- $object,
- $total_count,
- $add_count,
- $add_edges,
- $rem_count,
- $rem_edges) {
-
- $args = func_get_args();
- return $this->getString(3, $args);
- }
-
-}
diff --git a/src/infrastructure/internationalization/translation/PhabricatorBaseEnglishTranslation.php b/src/infrastructure/internationalization/translation/PhabricatorBaseEnglishTranslation.php
--- a/src/infrastructure/internationalization/translation/PhabricatorBaseEnglishTranslation.php
+++ b/src/infrastructure/internationalization/translation/PhabricatorBaseEnglishTranslation.php
@@ -325,34 +325,34 @@
),
),
- '%s edited file(s), added %d: %s; removed %d: %s.' =>
+ '%s edited file(s), added %s: %s; removed %s: %s.' =>
'%s edited files, added: %3$s; removed: %5$s.',
- '%s added %d file(s): %s.' => array(
+ '%s added %s file(s): %s.' => array(
array(
'%s added a file: %3$s.',
'%s added files: %3$s.',
),
),
- '%s removed %d file(s): %s.' => array(
+ '%s removed %s file(s): %s.' => array(
array(
'%s removed a file: %3$s.',
'%s removed files: %3$s.',
),
),
- '%s edited contributor(s), added %d: %s; removed %d: %s.' =>
+ '%s edited contributor(s), added %s: %s; removed %s: %s.' =>
'%s edited contributors, added: %3$s; removed: %5$s.',
- '%s added %d contributor(s): %s.' => array(
+ '%s added %s contributor(s): %s.' => array(
array(
'%s added a contributor: %3$s.',
'%s added contributors: %3$s.',
),
),
- '%s removed %d contributor(s): %s.' => array(
+ '%s removed %s contributor(s): %s.' => array(
array(
'%s removed a contributor: %3$s.',
'%s removed contributors: %3$s.',
@@ -379,23 +379,6 @@
),
),
- '%s edited object(s), added %d: %s; removed %d: %s.' =>
- '%s edited objects, added: %3$s; removed: %5$s.',
-
- '%s added %d object(s): %s.' => array(
- array(
- '%s added a object: %3$s.',
- '%s added objects: %3$s.',
- ),
- ),
-
- '%s removed %d object(s): %s.' => array(
- array(
- '%s removed a object: %3$s.',
- '%s removed objects: %3$s.',
- ),
- ),
-
'%d other(s)' => array(
'1 other',
'%d others',
@@ -683,14 +666,14 @@
'%s commits',
),
- '%s removed %d JIRA issue(s): %s.' => array(
+ '%s removed %s JIRA issue(s): %s.' => array(
array(
'%s removed a JIRA issue: %3$s.',
'%s removed JIRA issues: %3$s.',
),
),
- '%s added %d JIRA issue(s): %s.' => array(
+ '%s added %s JIRA issue(s): %s.' => array(
array(
'%s added a JIRA issue: %3$s.',
'%s added JIRA issues: %3$s.',
@@ -704,7 +687,7 @@
),
),
- '%s updated JIRA issue(s): added %d %s; removed %d %s.' =>
+ '%s updated JIRA issue(s): added %s %s; removed %d %s.' =>
'%s updated JIRA issues: added %3$s; removed %5$s.',
'%s edited %s task(s), added %s: %s; removed %s: %s.' =>

File Metadata

Mime Type
text/plain
Expires
Wed, Mar 19, 11:44 PM (2 w, 3 d ago)
Storage Engine
amazon-s3
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
phabricator/secure/au/qa/ghlmyetwo5devi5k
Default Alt Text
D11116.diff (74 KB)

Event Timeline