Page MenuHomePhabricator

D11116.id26692.diff
No OneTemporary

D11116.id26692.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: */
/* PhabricatorEdgeConfig::TYPE_PROJ_MEMBER = 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,
+ PhabricatorObjectHasUnunsubscriberEdgeType::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
@@ -1515,6 +1515,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',
@@ -1532,6 +1533,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',
@@ -1735,6 +1737,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',
@@ -1988,6 +1991,11 @@
'PhabricatorObjectHandle' => 'applications/phid/PhabricatorObjectHandle.php',
'PhabricatorObjectHandleConstants' => 'applications/phid/handle/const/PhabricatorObjectHandleConstants.php',
'PhabricatorObjectHandleStatus' => 'applications/phid/handle/const/PhabricatorObjectHandleStatus.php',
+ 'PhabricatorObjectHasContributorEdgeType' => 'applications/transactions/edges/PhabricatorObjectHasContributorEdgeType.php',
+ 'PhabricatorObjectHasFileEdgeType' => 'applications/transactions/edges/PhabricatorObjectHasFileEdgeType.php',
+ 'PhabricatorObjectHasSubscriberEdgeType' => 'applications/transactions/edges/PhabricatorObjectHasSubscriberEdgeType.php',
+ 'PhabricatorObjectHasUnunsubscriberEdgeType' => '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',
@@ -1997,6 +2005,8 @@
'PhabricatorObjectQuery' => 'applications/phid/query/PhabricatorObjectQuery.php',
'PhabricatorObjectRemarkupRule' => 'infrastructure/markup/rule/PhabricatorObjectRemarkupRule.php',
'PhabricatorObjectSelectorDialog' => 'view/control/PhabricatorObjectSelectorDialog.php',
+ 'PhabricatorObjectUnsubscribedFromObjectEdgeType' => 'applications/transactions/edges/PhabricatorObjectUnsubscribedFromObjectEdgeType.php',
+ 'PhabricatorObjectUsesCredentialsEdgeType' => 'applications/transactions/edges/PhabricatorObjectUsesCredentialsEdgeType.php',
'PhabricatorOffsetPagedQuery' => 'infrastructure/query/PhabricatorOffsetPagedQuery.php',
'PhabricatorOwnerPathQuery' => 'applications/owners/query/PhabricatorOwnerPathQuery.php',
'PhabricatorOwnersApplication' => 'applications/owners/application/PhabricatorOwnersApplication.php',
@@ -2437,6 +2447,7 @@
'PhabricatorStoragePatch' => 'infrastructure/storage/management/PhabricatorStoragePatch.php',
'PhabricatorStorageSchemaSpec' => 'infrastructure/storage/schema/PhabricatorStorageSchemaSpec.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',
@@ -2547,6 +2558,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',
@@ -4680,6 +4692,7 @@
'PhabricatorConpherenceThreadPHIDType' => 'PhabricatorPHIDType',
'PhabricatorConsoleApplication' => 'PhabricatorApplication',
'PhabricatorContentSourceView' => 'AphrontView',
+ 'PhabricatorContributedToObjectEdgeType' => 'PhabricatorEdgeType',
'PhabricatorController' => 'AphrontController',
'PhabricatorCookies' => 'Phobject',
'PhabricatorCoreConfigOptions' => 'PhabricatorApplicationConfigOptions',
@@ -4700,6 +4713,7 @@
'PhabricatorCountdownSearchEngine' => 'PhabricatorApplicationSearchEngine',
'PhabricatorCountdownView' => 'AphrontTagView',
'PhabricatorCountdownViewController' => 'PhabricatorCountdownController',
+ 'PhabricatorCredentialsUsedByObjectEdgeType' => 'PhabricatorEdgeType',
'PhabricatorCrumbView' => 'AphrontView',
'PhabricatorCrumbsView' => 'AphrontView',
'PhabricatorCursorPagedPolicyAwareQuery' => 'PhabricatorPolicyAwareQuery',
@@ -4918,6 +4932,7 @@
'PhabricatorFileEditController' => 'PhabricatorFileController',
'PhabricatorFileEditor' => 'PhabricatorApplicationTransactionEditor',
'PhabricatorFileFilePHIDType' => 'PhabricatorPHIDType',
+ 'PhabricatorFileHasObjectEdgeType' => 'PhabricatorEdgeType',
'PhabricatorFileImageMacro' => array(
'PhabricatorFileDAO',
'PhabricatorSubscribableInterface',
@@ -5166,6 +5181,11 @@
'PhabricatorOAuthServerTokenController' => 'PhabricatorAuthController',
'PhabricatorObjectHandle' => 'PhabricatorPolicyInterface',
'PhabricatorObjectHandleStatus' => 'PhabricatorObjectHandleConstants',
+ 'PhabricatorObjectHasContributorEdgeType' => 'PhabricatorEdgeType',
+ 'PhabricatorObjectHasFileEdgeType' => 'PhabricatorEdgeType',
+ 'PhabricatorObjectHasSubscriberEdgeType' => 'PhabricatorEdgeType',
+ 'PhabricatorObjectHasUnunsubscriberEdgeType' => 'PhabricatorEdgeType',
+ 'PhabricatorObjectHasWatcherEdgeType' => 'PhabricatorEdgeType',
'PhabricatorObjectListQueryTestCase' => 'PhabricatorTestCase',
'PhabricatorObjectMailReceiver' => 'PhabricatorMailReceiver',
'PhabricatorObjectMailReceiverTestCase' => 'PhabricatorTestCase',
@@ -5173,6 +5193,8 @@
'PhabricatorObjectMentionsObjectEdgeType' => 'PhabricatorEdgeType',
'PhabricatorObjectQuery' => 'PhabricatorCursorPagedPolicyAwareQuery',
'PhabricatorObjectRemarkupRule' => 'PhutilRemarkupRule',
+ 'PhabricatorObjectUnsubscribedFromObjectEdgeType' => 'PhabricatorEdgeType',
+ 'PhabricatorObjectUsesCredentialsEdgeType' => 'PhabricatorEdgeType',
'PhabricatorOffsetPagedQuery' => 'PhabricatorQuery',
'PhabricatorOwnersApplication' => 'PhabricatorApplication',
'PhabricatorOwnersConfigOptions' => 'PhabricatorApplicationConfigOptions',
@@ -5664,6 +5686,7 @@
'PhabricatorStorageManagementUpgradeWorkflow' => 'PhabricatorStorageManagementWorkflow',
'PhabricatorStorageManagementWorkflow' => 'PhabricatorManagementWorkflow',
'PhabricatorStorageSchemaSpec' => 'PhabricatorConfigSchemaSpec',
+ 'PhabricatorSubscribedToObjectEdgeType' => 'PhabricatorEdgeType',
'PhabricatorSubscribersQuery' => 'PhabricatorQuery',
'PhabricatorSubscriptionsApplication' => 'PhabricatorApplication',
'PhabricatorSubscriptionsEditController' => 'PhabricatorController',
@@ -5783,6 +5806,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/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);
+ PhabricatorObjectHasUnunsubscriberEdgeType::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/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 PhabricatorEdgeConfig::TYPE_PROJ_MEMBER:
- case PhabricatorEdgeConfig::TYPE_OBJECT_HAS_WATCHER:
+ case PhabricatorObjectHasWatcherEdgeType::EDGECONST:
$old = $xaction->getOldValue();
$new = $xaction->getNewValue();
@@ -220,7 +220,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 = PhabricatorEdgeConfig::TYPE_PROJ_MEMBER;
- $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);
+ PhabricatorObjectHasUnunsubscriberEdgeType::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 = PhabricatorObjectHasUnunsubscriberEdgeType::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 PhabricatorObjectSubscribedToObjectEdgeType::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 PhabricatorObjectHasUnunsubscriberEdgeType
+ extends PhabricatorEdgeType {
+
+ const EDGECONST = 23;
+
+ public function getInverseEdgeConstant() {
+ return PhabricatorObjectUnsubscribedFromObjectEdgeType::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/PhabricatorObjectUnsubscribedFromObjectEdgeType.php b/src/applications/transactions/edges/PhabricatorObjectUnsubscribedFromObjectEdgeType.php
new file mode 100644
--- /dev/null
+++ b/src/applications/transactions/edges/PhabricatorObjectUnsubscribedFromObjectEdgeType.php
@@ -0,0 +1,16 @@
+<?php
+
+final class PhabricatorObjectUnsubscribedFromObjectEdgeType
+ extends PhabricatorEdgeType {
+
+ const EDGECONST = 24;
+
+ public function getInverseEdgeConstant() {
+ return PhabricatorObjectHasUnsubscriberEdgeType::EDGECONST;
+ }
+
+ public function shouldWriteInverseTransactions() {
+ return true;
+ }
+
+}
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/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
@@ -1847,7 +1847,7 @@
$unsub = PhabricatorEdgeQuery::loadDestinationPHIDs(
$object->getPHID(),
- PhabricatorEdgeConfig::TYPE_OBJECT_HAS_UNSUBSCRIBER);
+ PhabricatorObjectHasUnunsubscriberEdgeType::EDGECONST);
$unsub = array_fuse($unsub);
if (isset($unsub[$actor_phid])) {
// If the user has previously unsubscribed from this object explicitly,
@@ -2121,7 +2121,7 @@
PhabricatorProjectObjectHasProjectEdgeType::EDGECONST);
if ($project_phids) {
- $watcher_type = PhabricatorEdgeConfig::TYPE_OBJECT_HAS_WATCHER;
+ $watcher_type = PhabricatorObjectHasWatcherEdgeType::EDGECONST;
$query = id(new PhabricatorEdgeQuery())
->withSourcePHIDs($project_phids)
@@ -2506,7 +2506,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/constants/PhabricatorEdgeConfig.php b/src/infrastructure/edges/constants/PhabricatorEdgeConfig.php
--- a/src/infrastructure/edges/constants/PhabricatorEdgeConfig.php
+++ b/src/infrastructure/edges/constants/PhabricatorEdgeConfig.php
@@ -8,24 +8,6 @@
const TYPE_PROJ_MEMBER = 13;
const TYPE_MEMBER_OF_PROJ = 14;
- 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!
@@ -100,18 +82,6 @@
self::TYPE_PROJ_MEMBER => self::TYPE_MEMBER_OF_PROJ,
self::TYPE_MEMBER_OF_PROJ => self::TYPE_PROJ_MEMBER,
- 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,
@@ -120,12 +90,6 @@
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);
@@ -169,26 +133,6 @@
return '%s edited member(s), added %d: %s; removed %d: %s.';
case self::TYPE_MEMBER_OF_PROJ:
return '%s edited project(s), added %d: %s; removed %d: %s.';
- 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.';
-
}
}
@@ -198,23 +142,6 @@
return '%s added %d member(s): %s.';
case self::TYPE_MEMBER_OF_PROJ:
return '%s added %d project(s): %s.';
- 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.';
-
}
}
@@ -224,23 +151,6 @@
return '%s removed %d member(s): %s.';
case self::TYPE_MEMBER_OF_PROJ:
return '%s removed %d project(s): %s.';
- 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.';
-
}
}
@@ -250,23 +160,6 @@
return '%s updated members of %s.';
case self::TYPE_MEMBER_OF_PROJ:
return '%s updated projects of %s.';
- 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/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.',
@@ -376,39 +376,22 @@
),
),
- '%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',
),
- '%s edited subscriber(s), added %d: %s; removed %d: %s.' =>
+ '%s edited subscriber(s), added %s: %s; removed %s: %s.' =>
'%s edited subscribers, added: %3$s; removed: %5$s.',
- '%s added %d subscriber(s): %s.' => array(
+ '%s added %s subscriber(s): %s.' => array(
array(
'%s added a subscriber: %3$s.',
'%s added subscribers: %3$s.',
),
),
- '%s removed %d subscriber(s): %s.' => array(
+ '%s removed %s subscriber(s): %s.' => array(
array(
'%s removed a subscriber: %3$s.',
'%s removed subscribers: %3$s.',

File Metadata

Mime Type
text/plain
Expires
Sun, Mar 23, 7:07 PM (1 w, 5 d ago)
Storage Engine
amazon-s3
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
phabricator/secure/ln/lx/4aq263vmbf3jedwo
Default Alt Text
D11116.id26692.diff (54 KB)

Event Timeline