@recaptime-dev's working patches + fork for Phorge, a community fork of Phabricator. (Upstream dev and stable branches are at upstream/main and upstream/stable respectively.) hq.recaptime.dev/wiki/Phorge
phorge phabricator
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Modernize remaining edge types

Summary: Modernize remaining edges to subclass `PhabricatorEdgeType`. Largely based on D11045.

Test Plan: Browsed around and performed various actions include subscribing, unsubscribing and watching.

Reviewers: #blessed_reviewers, epriestley

Reviewed By: #blessed_reviewers, epriestley

Subscribers: epriestley

Differential Revision: https://secure.phabricator.com/D11116

+824 -421
+1 -1
resources/sql/autopatches/20140210.projcfield.4.memmig.sql
··· 1 1 /* These are here so `grep` will find them if we ever change things: */ 2 2 3 3 /* PhabricatorProjectProjectHasMemberEdgeType::EDGECONST = 13 */ 4 - /* PhabricatorEdgeConfig::TYPE_OBJECT_HAS_SUBSCRIBER = 21 */ 4 + /* PhabricatorObjectHasSubscriberEdgeType::EDGECONST = 21 */ 5 5 6 6 INSERT IGNORE INTO {$NAMESPACE}_project.edge (src, type, dst, dateCreated) 7 7 SELECT src, 21, dst, dateCreated FROM {$NAMESPACE}_project.edge
+1 -1
resources/sql/autopatches/20140211.dx.3.migsubscriptions.sql
··· 1 1 /* For `grep`: */ 2 2 3 - /* PhabricatorEdgeConfig::TYPE_OBJECT_HAS_SUBSCRIBER = 21 */ 3 + /* PhabricatorObjectHasSubscriberEdgeType::EDGECONST = 21 */ 4 4 5 5 INSERT IGNORE INTO {$NAMESPACE}_differential.edge (src, type, dst, seq) 6 6 SELECT rev.phid, 21, rel.objectPHID, rel.sequence
+1 -1
resources/sql/autopatches/20140731.audit.1.subscribers.php
··· 19 19 'INSERT IGNORE INTO %T (src, type, dst) VALUES (%s, %d, %s)', 20 20 PhabricatorEdgeConfig::TABLE_NAME_EDGE, 21 21 $request->getCommitPHID(), 22 - PhabricatorEdgeConfig::TYPE_OBJECT_HAS_SUBSCRIBER, 22 + PhabricatorObjectHasSubscriberEdgeType::EDGECONST, 23 23 $request->getAuditorPHID()); 24 24 25 25
+1 -1
resources/sql/autopatches/20140904.macroattach.php
··· 16 16 foreach ($phids as $phid) { 17 17 $editor->addEdge( 18 18 $macro->getPHID(), 19 - PhabricatorEdgeConfig::TYPE_OBJECT_HAS_FILE, 19 + PhabricatorObjectHasFileEdgeType::EDGECONST , 20 20 $phid); 21 21 } 22 22 $editor->save();
+1 -1
resources/sql/patches/20130201.revisionunsubscribed.php
··· 22 22 foreach ($unsubscribed as $user_phid => $_) { 23 23 $editor->addEdge( 24 24 $rev['phid'], 25 - PhabricatorEdgeConfig::TYPE_OBJECT_HAS_UNSUBSCRIBER, 25 + PhabricatorObjectHasUnsubscriberEdgeType::EDGECONST , 26 26 $user_phid); 27 27 } 28 28 $editor->save();
+1 -1
resources/sql/patches/20130703.legalpaddocdenorm.php
··· 24 24 if (!$document->getContributorCount() || 25 25 !$document->getRecentContributorPHIDs()) { 26 26 $updated = true; 27 - $type = PhabricatorEdgeConfig::TYPE_OBJECT_HAS_CONTRIBUTOR; 27 + $type = PhabricatorObjectHasContributorEdgeType::EDGECONST; 28 28 $contributors = PhabricatorEdgeQuery::loadDestinationPHIDs( 29 29 $document->getPHID(), 30 30 $type);
+1 -1
resources/sql/patches/20131121.repocredentials.2.mig.php
··· 123 123 $credential->getPHID(), 124 124 $repository->getID()); 125 125 126 - $edge_type = PhabricatorEdgeConfig::TYPE_OBJECT_USES_CREDENTIAL; 126 + $edge_type = PhabricatorObjectUsesCredentialsEdgeType::EDGECONST; 127 127 128 128 id(new PhabricatorEdgeEditor()) 129 129 ->addEdge($repository->getPHID(), $edge_type, $credential->getPHID())
+38 -2
src/__phutil_library_map__.php
··· 1291 1291 'PhabricatorApplicationsListController' => 'applications/meta/controller/PhabricatorApplicationsListController.php', 1292 1292 'PhabricatorAsanaAuthProvider' => 'applications/auth/provider/PhabricatorAsanaAuthProvider.php', 1293 1293 'PhabricatorAsanaConfigOptions' => 'applications/doorkeeper/option/PhabricatorAsanaConfigOptions.php', 1294 + 'PhabricatorAsanaSubtaskHasObjectEdgeType' => 'applications/doorkeeper/edge/PhabricatorAsanaSubtaskHasObjectEdgeType.php', 1295 + 'PhabricatorAsanaTaskHasObjectEdgeType' => 'applications/doorkeeper/edge/PhabricatorAsanaTaskHasObjectEdgeType.php', 1294 1296 'PhabricatorAuditActionConstants' => 'applications/audit/constants/PhabricatorAuditActionConstants.php', 1295 1297 'PhabricatorAuditAddCommentController' => 'applications/audit/controller/PhabricatorAuditAddCommentController.php', 1296 1298 'PhabricatorAuditApplication' => 'applications/audit/application/PhabricatorAuditApplication.php', ··· 1525 1527 'PhabricatorConsoleApplication' => 'applications/console/application/PhabricatorConsoleApplication.php', 1526 1528 'PhabricatorContentSource' => 'applications/metamta/contentsource/PhabricatorContentSource.php', 1527 1529 'PhabricatorContentSourceView' => 'applications/metamta/contentsource/PhabricatorContentSourceView.php', 1530 + 'PhabricatorContributedToObjectEdgeType' => 'applications/transactions/edges/PhabricatorContributedToObjectEdgeType.php', 1528 1531 'PhabricatorController' => 'applications/base/controller/PhabricatorController.php', 1529 1532 'PhabricatorCookies' => 'applications/auth/constants/PhabricatorCookies.php', 1530 1533 'PhabricatorCoreConfigOptions' => 'applications/config/option/PhabricatorCoreConfigOptions.php', ··· 1542 1545 'PhabricatorCountdownSearchEngine' => 'applications/countdown/query/PhabricatorCountdownSearchEngine.php', 1543 1546 'PhabricatorCountdownView' => 'applications/countdown/view/PhabricatorCountdownView.php', 1544 1547 'PhabricatorCountdownViewController' => 'applications/countdown/controller/PhabricatorCountdownViewController.php', 1548 + 'PhabricatorCredentialsUsedByObjectEdgeType' => 'applications/passphrase/edge/PhabricatorCredentialsUsedByObjectEdgeType.php', 1545 1549 'PhabricatorCrumbView' => 'view/layout/PhabricatorCrumbView.php', 1546 1550 'PhabricatorCrumbsView' => 'view/layout/PhabricatorCrumbsView.php', 1547 1551 'PhabricatorCursorPagedPolicyAwareQuery' => 'infrastructure/query/policy/PhabricatorCursorPagedPolicyAwareQuery.php', ··· 1754 1758 'PhabricatorFileEditController' => 'applications/files/controller/PhabricatorFileEditController.php', 1755 1759 'PhabricatorFileEditor' => 'applications/files/editor/PhabricatorFileEditor.php', 1756 1760 'PhabricatorFileFilePHIDType' => 'applications/files/phid/PhabricatorFileFilePHIDType.php', 1761 + 'PhabricatorFileHasObjectEdgeType' => 'applications/files/edge/PhabricatorFileHasObjectEdgeType.php', 1757 1762 'PhabricatorFileImageMacro' => 'applications/macro/storage/PhabricatorFileImageMacro.php', 1758 1763 'PhabricatorFileInfoController' => 'applications/files/controller/PhabricatorFileInfoController.php', 1759 1764 'PhabricatorFileLinkListView' => 'view/layout/PhabricatorFileLinkListView.php', ··· 1847 1852 'PhabricatorIteratedMD5PasswordHasher' => 'infrastructure/util/password/PhabricatorIteratedMD5PasswordHasher.php', 1848 1853 'PhabricatorJIRAAuthProvider' => 'applications/auth/provider/PhabricatorJIRAAuthProvider.php', 1849 1854 'PhabricatorJavelinLinter' => 'infrastructure/lint/linter/PhabricatorJavelinLinter.php', 1855 + 'PhabricatorJiraIssueHasObjectEdgeType' => 'applications/doorkeeper/edge/PhabricatorJiraIssueHasObjectEdgeType.php', 1850 1856 'PhabricatorJumpNavHandler' => 'applications/search/engine/PhabricatorJumpNavHandler.php', 1851 1857 'PhabricatorKeyValueDatabaseCache' => 'applications/cache/PhabricatorKeyValueDatabaseCache.php', 1852 1858 'PhabricatorLDAPAuthProvider' => 'applications/auth/provider/PhabricatorLDAPAuthProvider.php', 1853 - 'PhabricatorLegacyEdgeType' => 'infrastructure/edges/type/PhabricatorLegacyEdgeType.php', 1854 1859 'PhabricatorLegalpadApplication' => 'applications/legalpad/application/PhabricatorLegalpadApplication.php', 1855 1860 'PhabricatorLegalpadConfigOptions' => 'applications/legalpad/config/PhabricatorLegalpadConfigOptions.php', 1856 1861 'PhabricatorLegalpadDocumentPHIDType' => 'applications/legalpad/phid/PhabricatorLegalpadDocumentPHIDType.php', ··· 2014 2019 'PhabricatorObjectHandle' => 'applications/phid/PhabricatorObjectHandle.php', 2015 2020 'PhabricatorObjectHandleConstants' => 'applications/phid/handle/const/PhabricatorObjectHandleConstants.php', 2016 2021 'PhabricatorObjectHandleStatus' => 'applications/phid/handle/const/PhabricatorObjectHandleStatus.php', 2022 + 'PhabricatorObjectHasAsanaSubtaskEdgeType' => 'applications/doorkeeper/edge/PhabricatorObjectHasAsanaSubtaskEdgeType.php', 2023 + 'PhabricatorObjectHasAsanaTaskEdgeType' => 'applications/doorkeeper/edge/PhabricatorObjectHasAsanaTaskEdgeType.php', 2024 + 'PhabricatorObjectHasContributorEdgeType' => 'applications/transactions/edges/PhabricatorObjectHasContributorEdgeType.php', 2025 + 'PhabricatorObjectHasFileEdgeType' => 'applications/transactions/edges/PhabricatorObjectHasFileEdgeType.php', 2026 + 'PhabricatorObjectHasJiraIssueEdgeType' => 'applications/doorkeeper/edge/PhabricatorObjectHasJiraIssueEdgeType.php', 2027 + 'PhabricatorObjectHasSubscriberEdgeType' => 'applications/transactions/edges/PhabricatorObjectHasSubscriberEdgeType.php', 2028 + 'PhabricatorObjectHasUnsubscriberEdgeType' => 'applications/transactions/edges/PhabricatorObjectHasUnsubscriberEdgeType.php', 2029 + 'PhabricatorObjectHasWatcherEdgeType' => 'applications/transactions/edges/PhabricatorObjectHasWatcherEdgeType.php', 2017 2030 'PhabricatorObjectListQuery' => 'applications/phid/query/PhabricatorObjectListQuery.php', 2018 2031 'PhabricatorObjectListQueryTestCase' => 'applications/phid/query/__tests__/PhabricatorObjectListQueryTestCase.php', 2019 2032 'PhabricatorObjectMailReceiver' => 'applications/metamta/receiver/PhabricatorObjectMailReceiver.php', ··· 2023 2036 'PhabricatorObjectQuery' => 'applications/phid/query/PhabricatorObjectQuery.php', 2024 2037 'PhabricatorObjectRemarkupRule' => 'infrastructure/markup/rule/PhabricatorObjectRemarkupRule.php', 2025 2038 'PhabricatorObjectSelectorDialog' => 'view/control/PhabricatorObjectSelectorDialog.php', 2039 + 'PhabricatorObjectUsesCredentialsEdgeType' => 'applications/transactions/edges/PhabricatorObjectUsesCredentialsEdgeType.php', 2026 2040 'PhabricatorOffsetPagedQuery' => 'infrastructure/query/PhabricatorOffsetPagedQuery.php', 2027 2041 'PhabricatorOwnerPathQuery' => 'applications/owners/query/PhabricatorOwnerPathQuery.php', 2028 2042 'PhabricatorOwnersApplication' => 'applications/owners/application/PhabricatorOwnersApplication.php', ··· 2432 2446 'PhabricatorStorageSchemaSpec' => 'infrastructure/storage/schema/PhabricatorStorageSchemaSpec.php', 2433 2447 'PhabricatorStorageSetupCheck' => 'applications/config/check/PhabricatorStorageSetupCheck.php', 2434 2448 'PhabricatorSubscribableInterface' => 'applications/subscriptions/interface/PhabricatorSubscribableInterface.php', 2449 + 'PhabricatorSubscribedToObjectEdgeType' => 'applications/transactions/edges/PhabricatorSubscribedToObjectEdgeType.php', 2435 2450 'PhabricatorSubscribersQuery' => 'applications/subscriptions/query/PhabricatorSubscribersQuery.php', 2436 2451 'PhabricatorSubscriptionsApplication' => 'applications/subscriptions/application/PhabricatorSubscriptionsApplication.php', 2437 2452 'PhabricatorSubscriptionsEditController' => 'applications/subscriptions/controller/PhabricatorSubscriptionsEditController.php', ··· 2461 2476 'PhabricatorTestCase' => 'infrastructure/testing/PhabricatorTestCase.php', 2462 2477 'PhabricatorTestController' => 'applications/base/controller/__tests__/PhabricatorTestController.php', 2463 2478 'PhabricatorTestDataGenerator' => 'applications/lipsum/generator/PhabricatorTestDataGenerator.php', 2479 + 'PhabricatorTestNoCycleEdgeType' => 'applications/transactions/edges/PhabricatorTestNoCycleEdgeType.php', 2464 2480 'PhabricatorTestStorageEngine' => 'applications/files/engine/PhabricatorTestStorageEngine.php', 2465 2481 'PhabricatorTestWorker' => 'infrastructure/daemon/workers/__tests__/PhabricatorTestWorker.php', 2466 2482 'PhabricatorTime' => 'infrastructure/time/PhabricatorTime.php', ··· 2516 2532 'PhabricatorUIStatusExample' => 'applications/uiexample/examples/PhabricatorUIStatusExample.php', 2517 2533 'PhabricatorUITooltipExample' => 'applications/uiexample/examples/PhabricatorUITooltipExample.php', 2518 2534 'PhabricatorUnitsTestCase' => 'view/__tests__/PhabricatorUnitsTestCase.php', 2535 + 'PhabricatorUnsubscribedFromObjectEdgeType' => 'applications/transactions/edges/PhabricatorUnsubscribedFromObjectEdgeType.php', 2519 2536 'PhabricatorUser' => 'applications/people/storage/PhabricatorUser.php', 2520 2537 'PhabricatorUserBlurbField' => 'applications/people/customfield/PhabricatorUserBlurbField.php', 2521 2538 'PhabricatorUserConfigOptions' => 'applications/people/config/PhabricatorUserConfigOptions.php', ··· 2544 2561 'PhabricatorUserTitleField' => 'applications/people/customfield/PhabricatorUserTitleField.php', 2545 2562 'PhabricatorUserTransaction' => 'applications/people/storage/PhabricatorUserTransaction.php', 2546 2563 'PhabricatorVCSResponse' => 'applications/repository/response/PhabricatorVCSResponse.php', 2564 + 'PhabricatorWatcherHasObjectEdgeType' => 'applications/transactions/edges/PhabricatorWatcherHasObjectEdgeType.php', 2547 2565 'PhabricatorWordPressAuthProvider' => 'applications/auth/provider/PhabricatorWordPressAuthProvider.php', 2548 2566 'PhabricatorWorker' => 'infrastructure/daemon/workers/PhabricatorWorker.php', 2549 2567 'PhabricatorWorkerActiveTask' => 'infrastructure/daemon/workers/storage/PhabricatorWorkerActiveTask.php', ··· 4434 4452 'PhabricatorApplicationsListController' => 'PhabricatorApplicationsController', 4435 4453 'PhabricatorAsanaAuthProvider' => 'PhabricatorOAuth2AuthProvider', 4436 4454 'PhabricatorAsanaConfigOptions' => 'PhabricatorApplicationConfigOptions', 4455 + 'PhabricatorAsanaSubtaskHasObjectEdgeType' => 'PhabricatorEdgeType', 4456 + 'PhabricatorAsanaTaskHasObjectEdgeType' => 'PhabricatorEdgeType', 4437 4457 'PhabricatorAuditAddCommentController' => 'PhabricatorAuditController', 4438 4458 'PhabricatorAuditApplication' => 'PhabricatorApplication', 4439 4459 'PhabricatorAuditCommentEditor' => 'PhabricatorEditor', ··· 4688 4708 'PhabricatorConpherenceThreadPHIDType' => 'PhabricatorPHIDType', 4689 4709 'PhabricatorConsoleApplication' => 'PhabricatorApplication', 4690 4710 'PhabricatorContentSourceView' => 'AphrontView', 4711 + 'PhabricatorContributedToObjectEdgeType' => 'PhabricatorEdgeType', 4691 4712 'PhabricatorController' => 'AphrontController', 4692 4713 'PhabricatorCookies' => 'Phobject', 4693 4714 'PhabricatorCoreConfigOptions' => 'PhabricatorApplicationConfigOptions', ··· 4708 4729 'PhabricatorCountdownSearchEngine' => 'PhabricatorApplicationSearchEngine', 4709 4730 'PhabricatorCountdownView' => 'AphrontTagView', 4710 4731 'PhabricatorCountdownViewController' => 'PhabricatorCountdownController', 4732 + 'PhabricatorCredentialsUsedByObjectEdgeType' => 'PhabricatorEdgeType', 4711 4733 'PhabricatorCrumbView' => 'AphrontView', 4712 4734 'PhabricatorCrumbsView' => 'AphrontView', 4713 4735 'PhabricatorCursorPagedPolicyAwareQuery' => 'PhabricatorPolicyAwareQuery', ··· 4936 4958 'PhabricatorFileEditController' => 'PhabricatorFileController', 4937 4959 'PhabricatorFileEditor' => 'PhabricatorApplicationTransactionEditor', 4938 4960 'PhabricatorFileFilePHIDType' => 'PhabricatorPHIDType', 4961 + 'PhabricatorFileHasObjectEdgeType' => 'PhabricatorEdgeType', 4939 4962 'PhabricatorFileImageMacro' => array( 4940 4963 'PhabricatorFileDAO', 4941 4964 'PhabricatorSubscribableInterface', ··· 5032 5055 'PhabricatorIteratedMD5PasswordHasher' => 'PhabricatorPasswordHasher', 5033 5056 'PhabricatorJIRAAuthProvider' => 'PhabricatorOAuth1AuthProvider', 5034 5057 'PhabricatorJavelinLinter' => 'ArcanistLinter', 5058 + 'PhabricatorJiraIssueHasObjectEdgeType' => 'PhabricatorEdgeType', 5035 5059 'PhabricatorKeyValueDatabaseCache' => 'PhutilKeyValueCache', 5036 5060 'PhabricatorLDAPAuthProvider' => 'PhabricatorAuthProvider', 5037 - 'PhabricatorLegacyEdgeType' => 'PhabricatorEdgeType', 5038 5061 'PhabricatorLegalpadApplication' => 'PhabricatorApplication', 5039 5062 'PhabricatorLegalpadConfigOptions' => 'PhabricatorApplicationConfigOptions', 5040 5063 'PhabricatorLegalpadDocumentPHIDType' => 'PhabricatorPHIDType', ··· 5191 5214 'PhabricatorOAuthServerTokenController' => 'PhabricatorAuthController', 5192 5215 'PhabricatorObjectHandle' => 'PhabricatorPolicyInterface', 5193 5216 'PhabricatorObjectHandleStatus' => 'PhabricatorObjectHandleConstants', 5217 + 'PhabricatorObjectHasAsanaSubtaskEdgeType' => 'PhabricatorEdgeType', 5218 + 'PhabricatorObjectHasAsanaTaskEdgeType' => 'PhabricatorEdgeType', 5219 + 'PhabricatorObjectHasContributorEdgeType' => 'PhabricatorEdgeType', 5220 + 'PhabricatorObjectHasFileEdgeType' => 'PhabricatorEdgeType', 5221 + 'PhabricatorObjectHasJiraIssueEdgeType' => 'PhabricatorEdgeType', 5222 + 'PhabricatorObjectHasSubscriberEdgeType' => 'PhabricatorEdgeType', 5223 + 'PhabricatorObjectHasUnsubscriberEdgeType' => 'PhabricatorEdgeType', 5224 + 'PhabricatorObjectHasWatcherEdgeType' => 'PhabricatorEdgeType', 5194 5225 'PhabricatorObjectListQueryTestCase' => 'PhabricatorTestCase', 5195 5226 'PhabricatorObjectMailReceiver' => 'PhabricatorMailReceiver', 5196 5227 'PhabricatorObjectMailReceiverTestCase' => 'PhabricatorTestCase', ··· 5198 5229 'PhabricatorObjectMentionsObjectEdgeType' => 'PhabricatorEdgeType', 5199 5230 'PhabricatorObjectQuery' => 'PhabricatorCursorPagedPolicyAwareQuery', 5200 5231 'PhabricatorObjectRemarkupRule' => 'PhutilRemarkupRule', 5232 + 'PhabricatorObjectUsesCredentialsEdgeType' => 'PhabricatorEdgeType', 5201 5233 'PhabricatorOffsetPagedQuery' => 'PhabricatorQuery', 5202 5234 'PhabricatorOwnersApplication' => 'PhabricatorApplication', 5203 5235 'PhabricatorOwnersConfigOptions' => 'PhabricatorApplicationConfigOptions', ··· 5659 5691 'PhabricatorStorageManagementWorkflow' => 'PhabricatorManagementWorkflow', 5660 5692 'PhabricatorStorageSchemaSpec' => 'PhabricatorConfigSchemaSpec', 5661 5693 'PhabricatorStorageSetupCheck' => 'PhabricatorSetupCheck', 5694 + 'PhabricatorSubscribedToObjectEdgeType' => 'PhabricatorEdgeType', 5662 5695 'PhabricatorSubscribersQuery' => 'PhabricatorQuery', 5663 5696 'PhabricatorSubscriptionsApplication' => 'PhabricatorApplication', 5664 5697 'PhabricatorSubscriptionsEditController' => 'PhabricatorController', ··· 5685 5718 'PhabricatorTestApplication' => 'PhabricatorApplication', 5686 5719 'PhabricatorTestCase' => 'ArcanistPhutilTestCase', 5687 5720 'PhabricatorTestController' => 'PhabricatorController', 5721 + 'PhabricatorTestNoCycleEdgeType' => 'PhabricatorEdgeType', 5688 5722 'PhabricatorTestStorageEngine' => 'PhabricatorFileStorageEngine', 5689 5723 'PhabricatorTestWorker' => 'PhabricatorWorker', 5690 5724 'PhabricatorTimeTestCase' => 'PhabricatorTestCase', ··· 5739 5773 'PhabricatorUIStatusExample' => 'PhabricatorUIExample', 5740 5774 'PhabricatorUITooltipExample' => 'PhabricatorUIExample', 5741 5775 'PhabricatorUnitsTestCase' => 'PhabricatorTestCase', 5776 + 'PhabricatorUnsubscribedFromObjectEdgeType' => 'PhabricatorEdgeType', 5742 5777 'PhabricatorUser' => array( 5743 5778 'PhabricatorUserDAO', 5744 5779 'PhutilPerson', ··· 5780 5815 'PhabricatorUserTitleField' => 'PhabricatorUserCustomField', 5781 5816 'PhabricatorUserTransaction' => 'PhabricatorApplicationTransaction', 5782 5817 'PhabricatorVCSResponse' => 'AphrontResponse', 5818 + 'PhabricatorWatcherHasObjectEdgeType' => 'PhabricatorEdgeType', 5783 5819 'PhabricatorWordPressAuthProvider' => 'PhabricatorOAuth2AuthProvider', 5784 5820 'PhabricatorWorkerActiveTask' => 'PhabricatorWorkerTask', 5785 5821 'PhabricatorWorkerArchiveTask' => 'PhabricatorWorkerTask',
+1 -1
src/applications/audit/storage/PhabricatorAuditTransaction.php
··· 455 455 case PhabricatorProjectObjectHasProjectEdgeType::EDGECONST: 456 456 $tags[] = self::MAILTAG_PROJECTS; 457 457 break; 458 - case PhabricatorEdgeConfig::TYPE_OBJECT_HAS_SUBSCRIBER: 458 + case PhabricatorObjectHasSubscriberEdgeType::EDGECONST: 459 459 $tags[] = self::MAILTAG_ADD_CCS; 460 460 break; 461 461 default:
+1 -1
src/applications/conpherence/editor/ConpherenceEditor.php
··· 255 255 switch ($xaction->getTransactionType()) { 256 256 case ConpherenceTransactionType::TYPE_FILES: 257 257 $editor = new PhabricatorEdgeEditor(); 258 - $edge_type = PhabricatorEdgeConfig::TYPE_OBJECT_HAS_FILE; 258 + $edge_type = PhabricatorObjectHasFileEdgeType::EDGECONST; 259 259 $old = array_fill_keys($xaction->getOldValue(), true); 260 260 $new = array_fill_keys($xaction->getNewValue(), true); 261 261 $add_edges = array_keys(array_diff_key($new, $old));
+1 -1
src/applications/conpherence/mail/ConpherenceReplyHandler.php
··· 43 43 ->attachParticipants(array()) 44 44 ->attachFilePHIDs(array()); 45 45 } else { 46 - $edge_type = PhabricatorEdgeConfig::TYPE_OBJECT_HAS_FILE; 46 + $edge_type = PhabricatorObjectHasFileEdgeType::EDGECONST; 47 47 $file_phids = PhabricatorEdgeQuery::loadDestinationPHIDs( 48 48 $conpherence->getPHID(), 49 49 $edge_type);
+1 -1
src/applications/conpherence/query/ConpherenceThreadQuery.php
··· 200 200 } 201 201 202 202 private function loadFilePHIDs(array $conpherences) { 203 - $edge_type = PhabricatorEdgeConfig::TYPE_OBJECT_HAS_FILE; 203 + $edge_type = PhabricatorObjectHasFileEdgeType::EDGECONST; 204 204 $file_edges = id(new PhabricatorEdgeQuery()) 205 205 ->withSourcePHIDs(array_keys($conpherences)) 206 206 ->withEdgeTypes(array($edge_type))
+1 -1
src/applications/differential/customfield/DifferentialAsanaRepresentationField.php
··· 30 30 public function renderPropertyViewValue(array $handles) { 31 31 $viewer = $this->getViewer(); 32 32 $src_phid = $this->getObject()->getPHID(); 33 - $edge_type = PhabricatorEdgeConfig::TYPE_PHOB_HAS_ASANATASK; 33 + $edge_type = PhabricatorObjectHasAsanaTaskEdgeType::EDGECONST; 34 34 35 35 $query = id(new PhabricatorEdgeQuery()) 36 36 ->withSourcePHIDs(array($src_phid))
+1 -1
src/applications/differential/customfield/DifferentialJIRAIssuesField.php
··· 249 249 $revision = $this->getObject(); 250 250 $revision_phid = $revision->getPHID(); 251 251 252 - $edge_type = PhabricatorEdgeConfig::TYPE_PHOB_HAS_JIRAISSUE; 252 + $edge_type = PhabricatorJiraIssueHasObjectEdgeType::EDGECONST; 253 253 $xobjs = $this->loadDoorkeeperExternalObjects($xaction->getNewValue()); 254 254 $edge_dsts = mpull($xobjs, 'getPHID'); 255 255
+1 -1
src/applications/differential/editor/DifferentialTransactionEditor.php
··· 1506 1506 1507 1507 $unsubscribed_phids = PhabricatorEdgeQuery::loadDestinationPHIDs( 1508 1508 $object->getPHID(), 1509 - PhabricatorEdgeConfig::TYPE_OBJECT_HAS_UNSUBSCRIBER); 1509 + PhabricatorObjectHasUnsubscriberEdgeType::EDGECONST); 1510 1510 1511 1511 $subscribed_phids = PhabricatorSubscribersQuery::loadSubscribersForPHID( 1512 1512 $object->getPHID());
+2 -2
src/applications/differential/query/DifferentialRevisionQuery.php
··· 628 628 'AND e_ccs.type = %s '. 629 629 'AND e_ccs.dst in (%Ls)', 630 630 PhabricatorEdgeConfig::TABLE_NAME_EDGE, 631 - PhabricatorEdgeConfig::TYPE_OBJECT_HAS_SUBSCRIBER, 631 + PhabricatorObjectHasSubscriberEdgeType::EDGECONST, 632 632 $this->ccs); 633 633 } 634 634 ··· 901 901 assert_instances_of($revisions, 'DifferentialRevision'); 902 902 903 903 $type_reviewer = DifferentialRevisionHasReviewerEdgeType::EDGECONST; 904 - $type_subscriber = PhabricatorEdgeConfig::TYPE_OBJECT_HAS_SUBSCRIBER; 904 + $type_subscriber = PhabricatorObjectHasSubscriberEdgeType::EDGECONST; 905 905 906 906 $edges = id(new PhabricatorEdgeQuery()) 907 907 ->withSourcePHIDs(mpull($revisions, 'getPHID'))
+1 -1
src/applications/differential/storage/DifferentialRevision.php
··· 214 214 215 215 $subscriber_phids = PhabricatorEdgeQuery::loadDestinationPHIDs( 216 216 $this->getPHID(), 217 - PhabricatorEdgeConfig::TYPE_OBJECT_HAS_SUBSCRIBER); 217 + PhabricatorObjectHasSubscriberEdgeType::EDGECONST); 218 218 $subscriber_phids = array_reverse($subscriber_phids); 219 219 foreach ($subscriber_phids as $phid) { 220 220 $data[] = array(
+16
src/applications/doorkeeper/edge/PhabricatorAsanaSubtaskHasObjectEdgeType.php
··· 1 + <?php 2 + 3 + final class PhabricatorAsanaSubtaskHasObjectEdgeType 4 + extends PhabricatorEdgeType { 5 + 6 + const EDGECONST = 80002; 7 + 8 + public function getInverseEdgeConstant() { 9 + return PhabricatorObjectHasAsanaSubtaskEdgeType::EDGECONST; 10 + } 11 + 12 + public function shouldWriteInverseTransactions() { 13 + return true; 14 + } 15 + 16 + }
+15
src/applications/doorkeeper/edge/PhabricatorAsanaTaskHasObjectEdgeType.php
··· 1 + <?php 2 + 3 + final class PhabricatorAsanaTaskHasObjectEdgeType extends PhabricatorEdgeType { 4 + 5 + const EDGECONST = 80000; 6 + 7 + public function getInverseEdgeConstant() { 8 + return PhabricatorObjectHasAsanaTaskEdgeType::EDGECONST; 9 + } 10 + 11 + public function shouldWriteInverseTransactions() { 12 + return true; 13 + } 14 + 15 + }
+15
src/applications/doorkeeper/edge/PhabricatorJiraIssueHasObjectEdgeType.php
··· 1 + <?php 2 + 3 + final class PhabricatorJiraIssueHasObjectEdgeType extends PhabricatorEdgeType { 4 + 5 + const EDGECONST = 80004; 6 + 7 + public function getInverseEdgeConstant() { 8 + return PhabricatorObjectHasJiraIssueEdgeType::EDGECONST; 9 + } 10 + 11 + public function shouldWriteInverseTransactions() { 12 + return true; 13 + } 14 + 15 + }
+16
src/applications/doorkeeper/edge/PhabricatorObjectHasAsanaSubtaskEdgeType.php
··· 1 + <?php 2 + 3 + final class PhabricatorObjectHasAsanaSubtaskEdgeType 4 + extends PhabricatorEdgeType { 5 + 6 + const EDGECONST = 80003; 7 + 8 + public function getInverseEdgeConstant() { 9 + return PhabricatorAsanaSubtaskHasObjectEdgeType::EDGECONST; 10 + } 11 + 12 + public function shouldWriteInverseTransactions() { 13 + return true; 14 + } 15 + 16 + }
+15
src/applications/doorkeeper/edge/PhabricatorObjectHasAsanaTaskEdgeType.php
··· 1 + <?php 2 + 3 + final class PhabricatorObjectHasAsanaTaskEdgeType extends PhabricatorEdgeType { 4 + 5 + const EDGECONST = 80001; 6 + 7 + public function getInverseEdgeConstant() { 8 + return PhabricatorAsanaTaskHasObjectEdgeType::EDGECONST; 9 + } 10 + 11 + public function shouldWriteInverseTransactions() { 12 + return true; 13 + } 14 + 15 + }
+15
src/applications/doorkeeper/edge/PhabricatorObjectHasJiraIssueEdgeType.php
··· 1 + <?php 2 + 3 + final class PhabricatorObjectHasJiraIssueEdgeType extends PhabricatorEdgeType { 4 + 5 + const EDGECONST = 80005; 6 + 7 + public function getInverseEdgeConstant() { 8 + return PhabricatorJiraIssueHasObjectEdgeType::EDGECONST; 9 + } 10 + 11 + public function shouldWriteInverseTransactions() { 12 + return true; 13 + } 14 + 15 + }
+2 -2
src/applications/doorkeeper/worker/DoorkeeperAsanaFeedWorker.php
··· 90 90 'pull an OAuth token out of.'); 91 91 } 92 92 93 - $etype_main = PhabricatorEdgeConfig::TYPE_PHOB_HAS_ASANATASK; 94 - $etype_sub = PhabricatorEdgeConfig::TYPE_PHOB_HAS_ASANASUBTASK; 93 + $etype_main = PhabricatorObjectHasAsanaTaskEdgeType::EDGECONST; 94 + $etype_sub = PhabricatorObjectHasAsanaSubtaskEdgeType::EDGECONST; 95 95 96 96 $equery = id(new PhabricatorEdgeQuery()) 97 97 ->withSourcePHIDs(array($src_phid))
+1 -1
src/applications/doorkeeper/worker/DoorkeeperJIRAFeedWorker.php
··· 32 32 33 33 $jira_issue_phids = PhabricatorEdgeQuery::loadDestinationPHIDs( 34 34 $object->getPHID(), 35 - PhabricatorEdgeConfig::TYPE_PHOB_HAS_JIRAISSUE); 35 + PhabricatorJiraIssueHasObjectEdgeType::EDGECONST); 36 36 if (!$jira_issue_phids) { 37 37 $this->log("Story is about an object with no linked JIRA issues.\n"); 38 38 return;
+15
src/applications/files/edge/PhabricatorFileHasObjectEdgeType.php
··· 1 + <?php 2 + 3 + final class PhabricatorFileHasObjectEdgeType extends PhabricatorEdgeType { 4 + 5 + const EDGECONST = 26; 6 + 7 + public function getInverseEdgeConstant() { 8 + return PhabricatorObjectHasFileEdgeType::EDGECONST; 9 + } 10 + 11 + public function shouldWriteInverseTransactions() { 12 + return true; 13 + } 14 + 15 + }
+1 -1
src/applications/files/query/PhabricatorFileQuery.php
··· 116 116 // We need to load attached objects to perform policy checks for files. 117 117 // First, load the edges. 118 118 119 - $edge_type = PhabricatorEdgeConfig::TYPE_FILE_HAS_OBJECT; 119 + $edge_type = PhabricatorFileHasObjectEdgeType::EDGECONST; 120 120 $file_phids = mpull($files, 'getPHID'); 121 121 $edges = id(new PhabricatorEdgeQuery()) 122 122 ->withSourcePHIDs($file_phids)
+2 -2
src/applications/files/storage/PhabricatorFile.php
··· 991 991 * @return this 992 992 */ 993 993 public function attachToObject($phid) { 994 - $edge_type = PhabricatorEdgeConfig::TYPE_OBJECT_HAS_FILE; 994 + $edge_type = PhabricatorObjectHasFileEdgeType::EDGECONST; 995 995 996 996 id(new PhabricatorEdgeEditor()) 997 997 ->addEdge($phid, $edge_type, $this->getPHID()) ··· 1008 1008 * @return this 1009 1009 */ 1010 1010 public function detachFromObject($phid) { 1011 - $edge_type = PhabricatorEdgeConfig::TYPE_OBJECT_HAS_FILE; 1011 + $edge_type = PhabricatorObjectHasFileEdgeType::EDGECONST; 1012 1012 1013 1013 id(new PhabricatorEdgeEditor()) 1014 1014 ->removeEdge($phid, $edge_type, $this->getPHID())
+2 -2
src/applications/legalpad/editor/LegalpadDocumentEditor.php
··· 110 110 $object->setDocumentBodyPHID($body->getPHID()); 111 111 112 112 $actor = $this->getActor(); 113 - $type = PhabricatorEdgeConfig::TYPE_CONTRIBUTED_TO_OBJECT; 113 + $type = PhabricatorContributedToObjectEdgeType::EDGECONST; 114 114 id(new PhabricatorEdgeEditor()) 115 115 ->addEdge($actor->getPHID(), $type, $object->getPHID()) 116 116 ->save(); 117 117 118 - $type = PhabricatorEdgeConfig::TYPE_OBJECT_HAS_CONTRIBUTOR; 118 + $type = PhabricatorObjectHasContributorEdgeType::EDGECONST; 119 119 $contributors = PhabricatorEdgeQuery::loadDestinationPHIDs( 120 120 $object->getPHID(), 121 121 $type);
+2 -2
src/applications/legalpad/query/LegalpadDocumentQuery.php
··· 136 136 $conn_r, 137 137 'JOIN edge contributor ON contributor.src = d.phid 138 138 AND contributor.type = %d', 139 - PhabricatorEdgeConfig::TYPE_OBJECT_HAS_CONTRIBUTOR); 139 + PhabricatorObjectHasContributorEdgeType::EDGECONST); 140 140 } 141 141 142 142 if ($this->signerPHIDs !== null) { ··· 226 226 227 227 private function loadContributors(array $documents) { 228 228 $document_map = mpull($documents, null, 'getPHID'); 229 - $edge_type = PhabricatorEdgeConfig::TYPE_OBJECT_HAS_CONTRIBUTOR; 229 + $edge_type = PhabricatorObjectHasContributorEdgeType::EDGECONST; 230 230 $contributor_data = id(new PhabricatorEdgeQuery()) 231 231 ->withSourcePHIDs(array_keys($document_map)) 232 232 ->withEdgeTypes(array($edge_type))
+1 -1
src/applications/maniphest/query/ManiphestTaskQuery.php
··· 726 726 'AND e_ccs.type = %s '. 727 727 'AND e_ccs.dst in (%Ls)', 728 728 PhabricatorEdgeConfig::TABLE_NAME_EDGE, 729 - PhabricatorEdgeConfig::TYPE_OBJECT_HAS_SUBSCRIBER, 729 + PhabricatorObjectHasSubscriberEdgeType::EDGECONST, 730 730 $this->subscriberPHIDs); 731 731 } 732 732
+1 -1
src/applications/passphrase/controller/PassphraseCredentialViewController.php
··· 188 188 189 189 $used_by_phids = PhabricatorEdgeQuery::loadDestinationPHIDs( 190 190 $credential->getPHID(), 191 - PhabricatorEdgeConfig::TYPE_CREDENTIAL_USED_BY_OBJECT); 191 + PhabricatorCredentialsUsedByObjectEdgeType::EDGECONST); 192 192 193 193 if ($used_by_phids) { 194 194 $this->loadHandles($used_by_phids);
+16
src/applications/passphrase/edge/PhabricatorCredentialsUsedByObjectEdgeType.php
··· 1 + <?php 2 + 3 + final class PhabricatorCredentialsUsedByObjectEdgeType 4 + extends PhabricatorEdgeType { 5 + 6 + const EDGECONST = 40; 7 + 8 + public function getInverseEdgeConstant() { 9 + return PhabricatorObjectUsesCredentialsEdgeType::EDGECONST; 10 + } 11 + 12 + public function shouldWriteInverseTransactions() { 13 + return true; 14 + } 15 + 16 + }
+1 -1
src/applications/project/controller/PhabricatorProjectWatchController.php
··· 45 45 break; 46 46 } 47 47 48 - $type_member = PhabricatorEdgeConfig::TYPE_OBJECT_HAS_WATCHER; 48 + $type_member = PhabricatorObjectHasWatcherEdgeType::EDGECONST; 49 49 $member_spec = array( 50 50 $edge_action => array($viewer->getPHID() => $viewer->getPHID()), 51 51 );
+2 -2
src/applications/project/editor/PhabricatorProjectTransactionEditor.php
··· 180 180 $edge_type = $xaction->getMetadataValue('edge:type'); 181 181 switch ($edge_type) { 182 182 case PhabricatorProjectProjectHasMemberEdgeType::EDGECONST: 183 - case PhabricatorEdgeConfig::TYPE_OBJECT_HAS_WATCHER: 183 + case PhabricatorObjectHasWatcherEdgeType::EDGECONST: 184 184 $old = $xaction->getOldValue(); 185 185 $new = $xaction->getNewValue(); 186 186 ··· 221 221 foreach ($rem as $rem_phid) { 222 222 $edge_editor->removeEdge( 223 223 $object->getPHID(), 224 - PhabricatorEdgeConfig::TYPE_OBJECT_HAS_WATCHER, 224 + PhabricatorObjectHasWatcherEdgeType::EDGECONST, 225 225 $rem_phid); 226 226 } 227 227 $edge_editor->save();
+1 -1
src/applications/project/query/PhabricatorProjectQuery.php
··· 139 139 $project_phids = mpull($projects, 'getPHID'); 140 140 141 141 $member_type = PhabricatorProjectProjectHasMemberEdgeType::EDGECONST; 142 - $watcher_type = PhabricatorEdgeConfig::TYPE_OBJECT_HAS_WATCHER; 142 + $watcher_type = PhabricatorObjectHasWatcherEdgeType::EDGECONST; 143 143 144 144 $need_edge_types = array(); 145 145 if ($this->needMembers) {
+1 -1
src/applications/repository/editor/PhabricatorRepositoryEditor.php
··· 242 242 243 243 $editor = new PhabricatorEdgeEditor(); 244 244 245 - $edge_type = PhabricatorEdgeConfig::TYPE_OBJECT_USES_CREDENTIAL; 245 + $edge_type = PhabricatorObjectUsesCredentialsEdgeType::EDGECONST; 246 246 $src_phid = $object->getPHID(); 247 247 248 248 if ($old_phid) {
+3 -3
src/applications/subscriptions/editor/PhabricatorSubscriptionsEditor.php
··· 65 65 if ($this->implicitSubscribePHIDs) { 66 66 $unsub = PhabricatorEdgeQuery::loadDestinationPHIDs( 67 67 $src, 68 - PhabricatorEdgeConfig::TYPE_OBJECT_HAS_UNSUBSCRIBER); 68 + PhabricatorObjectHasUnsubscriberEdgeType::EDGECONST); 69 69 $unsub = array_fill_keys($unsub, true); 70 70 $this->implicitSubscribePHIDs = array_diff_key( 71 71 $this->implicitSubscribePHIDs, ··· 80 80 $add = array_diff_key($add, $del); 81 81 82 82 if ($add || $del) { 83 - $u_type = PhabricatorEdgeConfig::TYPE_OBJECT_HAS_UNSUBSCRIBER; 84 - $s_type = PhabricatorEdgeConfig::TYPE_OBJECT_HAS_SUBSCRIBER; 83 + $u_type = PhabricatorObjectHasUnsubscriberEdgeType::EDGECONST; 84 + $s_type = PhabricatorObjectHasSubscriberEdgeType::EDGECONST; 85 85 86 86 $editor = new PhabricatorEdgeEditor(); 87 87
+1 -1
src/applications/subscriptions/events/PhabricatorSubscriptionsUIEventListener.php
··· 51 51 if ($user->isLoggedIn()) { 52 52 $src_phid = $object->getPHID(); 53 53 $dst_phid = $user->getPHID(); 54 - $edge_type = PhabricatorEdgeConfig::TYPE_OBJECT_HAS_SUBSCRIBER; 54 + $edge_type = PhabricatorObjectHasSubscriberEdgeType::EDGECONST; 55 55 56 56 $edges = id(new PhabricatorEdgeQuery()) 57 57 ->withSourcePHIDs(array($src_phid))
+1 -1
src/applications/subscriptions/query/PhabricatorSubscribersQuery.php
··· 29 29 public function execute() { 30 30 $query = new PhabricatorEdgeQuery(); 31 31 32 - $edge_type = PhabricatorEdgeConfig::TYPE_OBJECT_HAS_SUBSCRIBER; 32 + $edge_type = PhabricatorObjectHasSubscriberEdgeType::EDGECONST; 33 33 34 34 $query->withSourcePHIDs($this->objectPHIDs); 35 35 $query->withEdgeTypes(array($edge_type));
+15
src/applications/transactions/edges/PhabricatorContributedToObjectEdgeType.php
··· 1 + <?php 2 + 3 + final class PhabricatorContributedToObjectEdgeType extends PhabricatorEdgeType { 4 + 5 + const EDGECONST = 34; 6 + 7 + public function getInverseEdgeConstant() { 8 + return PhabricatorObjectHasContributorEdgeType::EDGECONST; 9 + } 10 + 11 + public function shouldWriteInverseTransactions() { 12 + return true; 13 + } 14 + 15 + }
+104
src/applications/transactions/edges/PhabricatorObjectHasContributorEdgeType.php
··· 1 + <?php 2 + 3 + final class PhabricatorObjectHasContributorEdgeType 4 + extends PhabricatorEdgeType { 5 + 6 + const EDGECONST = 33; 7 + 8 + public function getInverseEdgeConstant() { 9 + return PhabricatorContributedToObjectEdgeType::EDGECONST; 10 + } 11 + 12 + public function shouldWriteInverseTransactions() { 13 + return true; 14 + } 15 + 16 + public function getTransactionAddString( 17 + $actor, 18 + $add_count, 19 + $add_edges) { 20 + 21 + return pht( 22 + '%s added %s contributor(s): %s.', 23 + $actor, 24 + $add_count, 25 + $add_edges); 26 + } 27 + 28 + public function getTransactionRemoveString( 29 + $actor, 30 + $rem_count, 31 + $rem_edges) { 32 + 33 + return pht( 34 + '%s removed %s contributor(s): %s.', 35 + $actor, 36 + $rem_count, 37 + $rem_edges); 38 + } 39 + 40 + public function getTransactionEditString( 41 + $actor, 42 + $total_count, 43 + $add_count, 44 + $add_edges, 45 + $rem_count, 46 + $rem_edges) { 47 + 48 + return pht( 49 + '%s edited contributor(s), added %s: %s; removed %s: %s.', 50 + $actor, 51 + $add_count, 52 + $add_edges, 53 + $rem_count, 54 + $rem_edges); 55 + } 56 + 57 + public function getFeedAddString( 58 + $actor, 59 + $object, 60 + $add_count, 61 + $add_edges) { 62 + 63 + return pht( 64 + '%s added %s contributor(s) for %s: %s.', 65 + $actor, 66 + $add_count, 67 + $object, 68 + $add_edges); 69 + } 70 + 71 + public function getFeedRemoveString( 72 + $actor, 73 + $object, 74 + $rem_count, 75 + $rem_edges) { 76 + 77 + return pht( 78 + '%s removed %s contributor(s) for %s: %s.', 79 + $actor, 80 + $rem_count, 81 + $object, 82 + $rem_edges); 83 + } 84 + 85 + public function getFeedEditString( 86 + $actor, 87 + $object, 88 + $total_count, 89 + $add_count, 90 + $add_edges, 91 + $rem_count, 92 + $rem_edges) { 93 + 94 + return pht( 95 + '%s edited contributor(s) for %s, added %s: %s; removed %s: %s.', 96 + $actor, 97 + $object, 98 + $add_count, 99 + $add_edges, 100 + $rem_count, 101 + $rem_edges); 102 + } 103 + 104 + }
+103
src/applications/transactions/edges/PhabricatorObjectHasFileEdgeType.php
··· 1 + <?php 2 + 3 + final class PhabricatorObjectHasFileEdgeType extends PhabricatorEdgeType { 4 + 5 + const EDGECONST = 25; 6 + 7 + public function getInverseEdgeConstant() { 8 + return PhabricatorFileHasObjectEdgeType::EDGECONST; 9 + } 10 + 11 + public function shouldWriteInverseTransactions() { 12 + return true; 13 + } 14 + 15 + public function getTransactionAddString( 16 + $actor, 17 + $add_count, 18 + $add_edges) { 19 + 20 + return pht( 21 + '%s added %s file(s): %s.', 22 + $actor, 23 + $add_count, 24 + $add_edges); 25 + } 26 + 27 + public function getTransactionRemoveString( 28 + $actor, 29 + $rem_count, 30 + $rem_edges) { 31 + 32 + return pht( 33 + '%s removed %s file(s): %s.', 34 + $actor, 35 + $rem_count, 36 + $rem_edges); 37 + } 38 + 39 + public function getTransactionEditString( 40 + $actor, 41 + $total_count, 42 + $add_count, 43 + $add_edges, 44 + $rem_count, 45 + $rem_edges) { 46 + 47 + return pht( 48 + '%s edited file(s), added %s: %s; removed %s: %s.', 49 + $actor, 50 + $add_count, 51 + $add_edges, 52 + $rem_count, 53 + $rem_edges); 54 + } 55 + 56 + public function getFeedAddString( 57 + $actor, 58 + $object, 59 + $add_count, 60 + $add_edges) { 61 + 62 + return pht( 63 + '%s added %s file(s) for %s: %s.', 64 + $actor, 65 + $add_count, 66 + $object, 67 + $add_edges); 68 + } 69 + 70 + public function getFeedRemoveString( 71 + $actor, 72 + $object, 73 + $rem_count, 74 + $rem_edges) { 75 + 76 + return pht( 77 + '%s removed %s file(s) for %s: %s.', 78 + $actor, 79 + $rem_count, 80 + $object, 81 + $rem_edges); 82 + } 83 + 84 + public function getFeedEditString( 85 + $actor, 86 + $object, 87 + $total_count, 88 + $add_count, 89 + $add_edges, 90 + $rem_count, 91 + $rem_edges) { 92 + 93 + return pht( 94 + '%s edited file(s) for %s, added %s: %s; removed %s: %s.', 95 + $actor, 96 + $object, 97 + $add_count, 98 + $add_edges, 99 + $rem_count, 100 + $rem_edges); 101 + } 102 + 103 + }
+103
src/applications/transactions/edges/PhabricatorObjectHasSubscriberEdgeType.php
··· 1 + <?php 2 + 3 + final class PhabricatorObjectHasSubscriberEdgeType extends PhabricatorEdgeType { 4 + 5 + const EDGECONST = 21; 6 + 7 + public function getInverseEdgeConstant() { 8 + return PhabricatorSubscribedToObjectEdgeType::EDGECONST; 9 + } 10 + 11 + public function shouldWriteInverseTransactions() { 12 + return true; 13 + } 14 + 15 + public function getTransactionAddString( 16 + $actor, 17 + $add_count, 18 + $add_edges) { 19 + 20 + return pht( 21 + '%s added %s subscriber(s): %s.', 22 + $actor, 23 + $add_count, 24 + $add_edges); 25 + } 26 + 27 + public function getTransactionRemoveString( 28 + $actor, 29 + $rem_count, 30 + $rem_edges) { 31 + 32 + return pht( 33 + '%s removed %s subscriber(s): %s.', 34 + $actor, 35 + $rem_count, 36 + $rem_edges); 37 + } 38 + 39 + public function getTransactionEditString( 40 + $actor, 41 + $total_count, 42 + $add_count, 43 + $add_edges, 44 + $rem_count, 45 + $rem_edges) { 46 + 47 + return pht( 48 + '%s edited subscriber(s), added %s: %s; removed %s: %s.', 49 + $actor, 50 + $add_count, 51 + $add_edges, 52 + $rem_count, 53 + $rem_edges); 54 + } 55 + 56 + public function getFeedAddString( 57 + $actor, 58 + $object, 59 + $add_count, 60 + $add_edges) { 61 + 62 + return pht( 63 + '%s added %s subscriber(s) for %s: %s.', 64 + $actor, 65 + $add_count, 66 + $object, 67 + $add_edges); 68 + } 69 + 70 + public function getFeedRemoveString( 71 + $actor, 72 + $object, 73 + $rem_count, 74 + $rem_edges) { 75 + 76 + return pht( 77 + '%s removed %s subscriber(s) for %s: %s.', 78 + $actor, 79 + $rem_count, 80 + $object, 81 + $rem_edges); 82 + } 83 + 84 + public function getFeedEditString( 85 + $actor, 86 + $object, 87 + $total_count, 88 + $add_count, 89 + $add_edges, 90 + $rem_count, 91 + $rem_edges) { 92 + 93 + return pht( 94 + '%s edited subscriber(s) for %s, added %s: %s; removed %s: %s.', 95 + $actor, 96 + $object, 97 + $add_count, 98 + $add_edges, 99 + $rem_count, 100 + $rem_edges); 101 + } 102 + 103 + }
+104
src/applications/transactions/edges/PhabricatorObjectHasUnsubscriberEdgeType.php
··· 1 + <?php 2 + 3 + final class PhabricatorObjectHasUnsubscriberEdgeType 4 + extends PhabricatorEdgeType { 5 + 6 + const EDGECONST = 23; 7 + 8 + public function getInverseEdgeConstant() { 9 + return PhabricatorUnsubscribedFromObjectEdgeType::EDGECONST; 10 + } 11 + 12 + public function shouldWriteInverseTransactions() { 13 + return true; 14 + } 15 + 16 + public function getTransactionAddString( 17 + $actor, 18 + $add_count, 19 + $add_edges) { 20 + 21 + return pht( 22 + '%s added %s unsubscriber(s): %s.', 23 + $actor, 24 + $add_count, 25 + $add_edges); 26 + } 27 + 28 + public function getTransactionRemoveString( 29 + $actor, 30 + $rem_count, 31 + $rem_edges) { 32 + 33 + return pht( 34 + '%s removed %s unsubscriber(s): %s.', 35 + $actor, 36 + $rem_count, 37 + $rem_edges); 38 + } 39 + 40 + public function getTransactionEditString( 41 + $actor, 42 + $total_count, 43 + $add_count, 44 + $add_edges, 45 + $rem_count, 46 + $rem_edges) { 47 + 48 + return pht( 49 + '%s edited unsubscriber(s), added %s: %s; removed %s: %s.', 50 + $actor, 51 + $add_count, 52 + $add_edges, 53 + $rem_count, 54 + $rem_edges); 55 + } 56 + 57 + public function getFeedAddString( 58 + $actor, 59 + $object, 60 + $add_count, 61 + $add_edges) { 62 + 63 + return pht( 64 + '%s added %s unsubscriber(s) for %s: %s.', 65 + $actor, 66 + $add_count, 67 + $object, 68 + $add_edges); 69 + } 70 + 71 + public function getFeedRemoveString( 72 + $actor, 73 + $object, 74 + $rem_count, 75 + $rem_edges) { 76 + 77 + return pht( 78 + '%s removed %s unsubscriber(s) for %s: %s.', 79 + $actor, 80 + $rem_count, 81 + $object, 82 + $rem_edges); 83 + } 84 + 85 + public function getFeedEditString( 86 + $actor, 87 + $object, 88 + $total_count, 89 + $add_count, 90 + $add_edges, 91 + $rem_count, 92 + $rem_edges) { 93 + 94 + return pht( 95 + '%s edited unsubscriber(s) for %s, added %s: %s; removed %s: %s.', 96 + $actor, 97 + $object, 98 + $add_count, 99 + $add_edges, 100 + $rem_count, 101 + $rem_edges); 102 + } 103 + 104 + }
+103
src/applications/transactions/edges/PhabricatorObjectHasWatcherEdgeType.php
··· 1 + <?php 2 + 3 + final class PhabricatorObjectHasWatcherEdgeType extends PhabricatorEdgeType { 4 + 5 + const EDGECONST = 47; 6 + 7 + public function getInverseEdgeConstant() { 8 + return PhabricatorWatcherHasObjectEdgeType::EDGECONST; 9 + } 10 + 11 + public function shouldWriteInverseTransactions() { 12 + return true; 13 + } 14 + 15 + public function getTransactionAddString( 16 + $actor, 17 + $add_count, 18 + $add_edges) { 19 + 20 + return pht( 21 + '%s added %s watcher(s): %s.', 22 + $actor, 23 + $add_count, 24 + $add_edges); 25 + } 26 + 27 + public function getTransactionRemoveString( 28 + $actor, 29 + $rem_count, 30 + $rem_edges) { 31 + 32 + return pht( 33 + '%s removed %s watcher(s): %s.', 34 + $actor, 35 + $rem_count, 36 + $rem_edges); 37 + } 38 + 39 + public function getTransactionEditString( 40 + $actor, 41 + $total_count, 42 + $add_count, 43 + $add_edges, 44 + $rem_count, 45 + $rem_edges) { 46 + 47 + return pht( 48 + '%s edited watcher(s), added %s: %s; removed %s: %s.', 49 + $actor, 50 + $add_count, 51 + $add_edges, 52 + $rem_count, 53 + $rem_edges); 54 + } 55 + 56 + public function getFeedAddString( 57 + $actor, 58 + $object, 59 + $add_count, 60 + $add_edges) { 61 + 62 + return pht( 63 + '%s added %s watcher(s) for %s: %s.', 64 + $actor, 65 + $add_count, 66 + $object, 67 + $add_edges); 68 + } 69 + 70 + public function getFeedRemoveString( 71 + $actor, 72 + $object, 73 + $rem_count, 74 + $rem_edges) { 75 + 76 + return pht( 77 + '%s removed %s watcher(s) for %s: %s.', 78 + $actor, 79 + $rem_count, 80 + $object, 81 + $rem_edges); 82 + } 83 + 84 + public function getFeedEditString( 85 + $actor, 86 + $object, 87 + $total_count, 88 + $add_count, 89 + $add_edges, 90 + $rem_count, 91 + $rem_edges) { 92 + 93 + return pht( 94 + '%s edited watcher(s) for %s, added %s: %s; removed %s: %s.', 95 + $actor, 96 + $object, 97 + $add_count, 98 + $add_edges, 99 + $rem_count, 100 + $rem_edges); 101 + } 102 + 103 + }
+16
src/applications/transactions/edges/PhabricatorObjectUsesCredentialsEdgeType.php
··· 1 + <?php 2 + 3 + final class PhabricatorObjectUsesCredentialsEdgeType 4 + extends PhabricatorEdgeType { 5 + 6 + const EDGECONST = 39; 7 + 8 + public function getInverseEdgeConstant() { 9 + return PhabricatorCredentialsUsedByObjectEdgeType::EDGECONST; 10 + } 11 + 12 + public function shouldWriteInverseTransactions() { 13 + return true; 14 + } 15 + 16 + }
+16
src/applications/transactions/edges/PhabricatorSubscribedToObjectEdgeType.php
··· 1 + <?php 2 + 3 + final class PhabricatorSubscribedToObjectEdgeType 4 + extends PhabricatorEdgeType { 5 + 6 + const EDGECONST = 22; 7 + 8 + public function getInverseEdgeConstant() { 9 + return PhabricatorObjectHasSubscriberEdgeType::EDGECONST; 10 + } 11 + 12 + public function shouldWriteInverseTransactions() { 13 + return true; 14 + } 15 + 16 + }
+11
src/applications/transactions/edges/PhabricatorTestNoCycleEdgeType.php
··· 1 + <?php 2 + 3 + final class PhabricatorTestNoCycleEdgeType extends PhabricatorEdgeType { 4 + 5 + const EDGECONST = 9000; 6 + 7 + public function shouldPreventCycles() { 8 + return true; 9 + } 10 + 11 + }
+16
src/applications/transactions/edges/PhabricatorUnsubscribedFromObjectEdgeType.php
··· 1 + <?php 2 + 3 + final class PhabricatorUnsubscribedFromObjectEdgeType 4 + extends PhabricatorEdgeType { 5 + 6 + const EDGECONST = 24; 7 + 8 + public function getInverseEdgeConstant() { 9 + return PhabricatorObjectHasUnsubscriberEdgeType::EDGECONST; 10 + } 11 + 12 + public function shouldWriteInverseTransactions() { 13 + return true; 14 + } 15 + 16 + }
+15
src/applications/transactions/edges/PhabricatorWatcherHasObjectEdgeType.php
··· 1 + <?php 2 + 3 + final class PhabricatorWatcherHasObjectEdgeType extends PhabricatorEdgeType { 4 + 5 + const EDGECONST = 48; 6 + 7 + public function getInverseEdgeConstant() { 8 + return PhabricatorObjectHasWatcherEdgeType::EDGECONST; 9 + } 10 + 11 + public function shouldWriteInverseTransactions() { 12 + return true; 13 + } 14 + 15 + }
+1 -1
src/applications/transactions/editor/PhabricatorApplicationTransactionCommentEditor.php
··· 102 102 foreach ($file_phids as $file_phid) { 103 103 $editor->addEdge( 104 104 $xaction->getObjectPHID(), 105 - PhabricatorEdgeConfig::TYPE_OBJECT_HAS_FILE, 105 + PhabricatorObjectHasFileEdgeType::EDGECONST , 106 106 $file_phid); 107 107 } 108 108 $editor->save();
+3 -3
src/applications/transactions/editor/PhabricatorApplicationTransactionEditor.php
··· 1866 1866 1867 1867 $unsub = PhabricatorEdgeQuery::loadDestinationPHIDs( 1868 1868 $object->getPHID(), 1869 - PhabricatorEdgeConfig::TYPE_OBJECT_HAS_UNSUBSCRIBER); 1869 + PhabricatorObjectHasUnsubscriberEdgeType::EDGECONST); 1870 1870 $unsub = array_fuse($unsub); 1871 1871 if (isset($unsub[$actor_phid])) { 1872 1872 // If the user has previously unsubscribed from this object explicitly, ··· 2140 2140 PhabricatorProjectObjectHasProjectEdgeType::EDGECONST); 2141 2141 2142 2142 if ($project_phids) { 2143 - $watcher_type = PhabricatorEdgeConfig::TYPE_OBJECT_HAS_WATCHER; 2143 + $watcher_type = PhabricatorObjectHasWatcherEdgeType::EDGECONST; 2144 2144 2145 2145 $query = id(new PhabricatorEdgeQuery()) 2146 2146 ->withSourcePHIDs($project_phids) ··· 2525 2525 $editor = new PhabricatorEdgeEditor(); 2526 2526 2527 2527 $src = $object->getPHID(); 2528 - $type = PhabricatorEdgeConfig::TYPE_OBJECT_HAS_FILE; 2528 + $type = PhabricatorObjectHasFileEdgeType::EDGECONST; 2529 2529 foreach ($file_phids as $dst) { 2530 2530 $editor->addEdge($src, $type, $dst); 2531 2531 }
+4 -4
src/infrastructure/edges/__tests__/PhabricatorEdgeTestCase.php
··· 21 21 $phid2 = $obj2->getPHID(); 22 22 23 23 $editor = id(new PhabricatorEdgeEditor()) 24 - ->addEdge($phid1, PhabricatorEdgeConfig::TYPE_TEST_NO_CYCLE, $phid2) 25 - ->addEdge($phid2, PhabricatorEdgeConfig::TYPE_TEST_NO_CYCLE, $phid1); 24 + ->addEdge($phid1, PhabricatorTestNoCycleEdgeType::EDGECONST , $phid2) 25 + ->addEdge($phid2, PhabricatorTestNoCycleEdgeType::EDGECONST , $phid1); 26 26 27 27 $caught = null; 28 28 try { ··· 38 38 // fail (it introduces a cycle). 39 39 40 40 $editor = id(new PhabricatorEdgeEditor()) 41 - ->addEdge($phid1, PhabricatorEdgeConfig::TYPE_TEST_NO_CYCLE, $phid2) 41 + ->addEdge($phid1, PhabricatorTestNoCycleEdgeType::EDGECONST , $phid2) 42 42 ->save(); 43 43 44 44 $editor = id(new PhabricatorEdgeEditor()) 45 - ->addEdge($phid2, PhabricatorEdgeConfig::TYPE_TEST_NO_CYCLE, $phid1); 45 + ->addEdge($phid2, PhabricatorTestNoCycleEdgeType::EDGECONST , $phid1); 46 46 47 47 $caught = null; 48 48 try {
-218
src/infrastructure/edges/constants/PhabricatorEdgeConfig.php
··· 5 5 const TABLE_NAME_EDGE = 'edge'; 6 6 const TABLE_NAME_EDGEDATA = 'edgedata'; 7 7 8 - const TYPE_OBJECT_HAS_SUBSCRIBER = 21; 9 - const TYPE_SUBSCRIBED_TO_OBJECT = 22; 10 - 11 - const TYPE_OBJECT_HAS_UNSUBSCRIBER = 23; 12 - const TYPE_UNSUBSCRIBED_FROM_OBJECT = 24; 13 - 14 - const TYPE_OBJECT_HAS_FILE = 25; 15 - const TYPE_FILE_HAS_OBJECT = 26; 16 - 17 - const TYPE_OBJECT_HAS_CONTRIBUTOR = 33; 18 - const TYPE_CONTRIBUTED_TO_OBJECT = 34; 19 - 20 - const TYPE_OBJECT_USES_CREDENTIAL = 39; 21 - const TYPE_CREDENTIAL_USED_BY_OBJECT = 40; 22 - 23 - const TYPE_OBJECT_HAS_WATCHER = 47; 24 - const TYPE_WATCHER_HAS_OBJECT = 48; 25 - 26 - /* !!!! STOP !!!! STOP !!!! STOP !!!! STOP !!!! STOP !!!! STOP !!!! STOP !!!! */ 27 - 28 - // HEY! DO NOT ADD NEW CONSTANTS HERE! 29 - // Instead, subclass PhabricatorEdgeType. 30 - 31 - /* !!!! STOP !!!! STOP !!!! STOP !!!! STOP !!!! STOP !!!! STOP !!!! STOP !!!! */ 32 - 33 - const TYPE_TEST_NO_CYCLE = 9000; 34 - 35 - const TYPE_PHOB_HAS_ASANATASK = 80001; 36 - const TYPE_ASANATASK_HAS_PHOB = 80000; 37 - 38 - const TYPE_PHOB_HAS_ASANASUBTASK = 80003; 39 - const TYPE_ASANASUBTASK_HAS_PHOB = 80002; 40 - 41 - const TYPE_PHOB_HAS_JIRAISSUE = 80004; 42 - const TYPE_JIRAISSUE_HAS_PHOB = 80005; 43 - 44 - 45 - /** 46 - * Build @{class:PhabricatorLegacyEdgeType} objects for edges which have not 47 - * yet been modernized. This allows code to act as though we've completed 48 - * the edge type migration before we actually do all the work, by building 49 - * these fake type objects. 50 - * 51 - * @param list<const> List of edge types that objects should not be built for. 52 - * This is used to avoid constructing duplicate objects for edge constants 53 - * which have migrated and already have a real object. 54 - * @return list<PhabricatorLegacyEdgeType> Real-looking edge type objects for 55 - * unmigrated edge types. 56 - */ 57 - public static function getLegacyTypes(array $exclude) { 58 - $consts = array_merge( 59 - range(1, 50), 60 - array(9000), 61 - range(80000, 80005)); 62 - 63 - $exclude[] = 15; // Was TYPE_COMMIT_HAS_PROJECT 64 - $exclude[] = 16; // Was TYPE_PROJECT_HAS_COMMIT 65 - 66 - $exclude[] = 27; // Was TYPE_ACCOUNT_HAS_MEMBER 67 - $exclude[] = 28; // Was TYPE_MEMBER_HAS_ACCOUNT 68 - 69 - $exclude[] = 43; // Was TYPE_OBJECT_HAS_COLUMN 70 - $exclude[] = 44; // Was TYPE_COLUMN_HAS_OBJECT 71 - 72 - $consts = array_diff($consts, $exclude); 73 - 74 - $map = array(); 75 - foreach ($consts as $const) { 76 - $prevent_cycles = self::shouldPreventCycles($const); 77 - $inverse_constant = self::getInverse($const); 78 - 79 - $map[$const] = id(new PhabricatorLegacyEdgeType()) 80 - ->setEdgeConstant($const) 81 - ->setShouldPreventCycles($prevent_cycles) 82 - ->setInverseEdgeConstant($inverse_constant) 83 - ->setStrings( 84 - array( 85 - self::getAddStringForEdgeType($const), 86 - self::getRemoveStringForEdgeType($const), 87 - self::getEditStringForEdgeType($const), 88 - self::getFeedStringForEdgeType($const), 89 - )); 90 - } 91 - 92 - return $map; 93 - } 94 - 95 - private static function getInverse($edge_type) { 96 - static $map = array( 97 - self::TYPE_OBJECT_HAS_SUBSCRIBER => self::TYPE_SUBSCRIBED_TO_OBJECT, 98 - self::TYPE_SUBSCRIBED_TO_OBJECT => self::TYPE_OBJECT_HAS_SUBSCRIBER, 99 - 100 - self::TYPE_OBJECT_HAS_UNSUBSCRIBER => self::TYPE_UNSUBSCRIBED_FROM_OBJECT, 101 - self::TYPE_UNSUBSCRIBED_FROM_OBJECT => self::TYPE_OBJECT_HAS_UNSUBSCRIBER, 102 - 103 - self::TYPE_OBJECT_HAS_FILE => self::TYPE_FILE_HAS_OBJECT, 104 - self::TYPE_FILE_HAS_OBJECT => self::TYPE_OBJECT_HAS_FILE, 105 - 106 - self::TYPE_OBJECT_HAS_CONTRIBUTOR => self::TYPE_CONTRIBUTED_TO_OBJECT, 107 - self::TYPE_CONTRIBUTED_TO_OBJECT => self::TYPE_OBJECT_HAS_CONTRIBUTOR, 108 - 109 - self::TYPE_PHOB_HAS_ASANATASK => self::TYPE_ASANATASK_HAS_PHOB, 110 - self::TYPE_ASANATASK_HAS_PHOB => self::TYPE_PHOB_HAS_ASANATASK, 111 - 112 - self::TYPE_PHOB_HAS_ASANASUBTASK => self::TYPE_ASANASUBTASK_HAS_PHOB, 113 - self::TYPE_ASANASUBTASK_HAS_PHOB => self::TYPE_PHOB_HAS_ASANASUBTASK, 114 - 115 - self::TYPE_PHOB_HAS_JIRAISSUE => self::TYPE_JIRAISSUE_HAS_PHOB, 116 - self::TYPE_JIRAISSUE_HAS_PHOB => self::TYPE_PHOB_HAS_JIRAISSUE, 117 - 118 - self::TYPE_OBJECT_USES_CREDENTIAL => self::TYPE_CREDENTIAL_USED_BY_OBJECT, 119 - self::TYPE_CREDENTIAL_USED_BY_OBJECT => self::TYPE_OBJECT_USES_CREDENTIAL, 120 - 121 - self::TYPE_OBJECT_HAS_WATCHER => self::TYPE_WATCHER_HAS_OBJECT, 122 - self::TYPE_WATCHER_HAS_OBJECT => self::TYPE_OBJECT_HAS_WATCHER, 123 - ); 124 - 125 - return idx($map, $edge_type); 126 - } 127 - 128 - private static function shouldPreventCycles($edge_type) { 129 - static $map = array( 130 - self::TYPE_TEST_NO_CYCLE => true, 131 - ); 132 - return isset($map[$edge_type]); 133 - } 134 - 135 8 public static function establishConnection($phid_type, $conn_type) { 136 9 $map = PhabricatorPHIDType::getAllTypes(); 137 10 if (isset($map[$phid_type])) { ··· 155 28 } 156 29 157 30 return newv($class, array())->establishConnection($conn_type); 158 - } 159 - 160 - public static function getEditStringForEdgeType($type) { 161 - switch ($type) { 162 - case self::TYPE_OBJECT_HAS_SUBSCRIBER: 163 - return '%s edited subscriber(s), added %d: %s; removed %d: %s.'; 164 - case self::TYPE_SUBSCRIBED_TO_OBJECT: 165 - case self::TYPE_UNSUBSCRIBED_FROM_OBJECT: 166 - case self::TYPE_FILE_HAS_OBJECT: 167 - case self::TYPE_CONTRIBUTED_TO_OBJECT: 168 - return '%s edited object(s), added %d: %s; removed %d: %s.'; 169 - case self::TYPE_OBJECT_HAS_UNSUBSCRIBER: 170 - return '%s edited unsubcriber(s), added %d: %s; removed %d: %s.'; 171 - case self::TYPE_OBJECT_HAS_FILE: 172 - return '%s edited file(s), added %d: %s; removed %d: %s.'; 173 - case self::TYPE_OBJECT_HAS_CONTRIBUTOR: 174 - return '%s edited contributor(s), added %d: %s; removed %d: %s.'; 175 - case self::TYPE_SUBSCRIBED_TO_OBJECT: 176 - case self::TYPE_UNSUBSCRIBED_FROM_OBJECT: 177 - case self::TYPE_FILE_HAS_OBJECT: 178 - case self::TYPE_CONTRIBUTED_TO_OBJECT: 179 - default: 180 - return '%s edited object(s), added %d: %s; removed %d: %s.'; 181 - 182 - } 183 - } 184 - 185 - public static function getAddStringForEdgeType($type) { 186 - switch ($type) { 187 - case self::TYPE_OBJECT_HAS_SUBSCRIBER: 188 - return '%s added %d subscriber(s): %s.'; 189 - case self::TYPE_OBJECT_HAS_UNSUBSCRIBER: 190 - return '%s added %d unsubcriber(s): %s.'; 191 - case self::TYPE_OBJECT_HAS_FILE: 192 - return '%s added %d file(s): %s.'; 193 - case self::TYPE_OBJECT_HAS_CONTRIBUTOR: 194 - return '%s added %d contributor(s): %s.'; 195 - case self::TYPE_OBJECT_HAS_WATCHER: 196 - return '%s added %d watcher(s): %s.'; 197 - case self::TYPE_SUBSCRIBED_TO_OBJECT: 198 - case self::TYPE_UNSUBSCRIBED_FROM_OBJECT: 199 - case self::TYPE_FILE_HAS_OBJECT: 200 - case self::TYPE_CONTRIBUTED_TO_OBJECT: 201 - default: 202 - return '%s added %d object(s): %s.'; 203 - 204 - } 205 - } 206 - 207 - public static function getRemoveStringForEdgeType($type) { 208 - switch ($type) { 209 - case self::TYPE_OBJECT_HAS_SUBSCRIBER: 210 - return '%s removed %d subscriber(s): %s.'; 211 - case self::TYPE_OBJECT_HAS_UNSUBSCRIBER: 212 - return '%s removed %d unsubcriber(s): %s.'; 213 - case self::TYPE_OBJECT_HAS_FILE: 214 - return '%s removed %d file(s): %s.'; 215 - case self::TYPE_OBJECT_HAS_CONTRIBUTOR: 216 - return '%s removed %d contributor(s): %s.'; 217 - case self::TYPE_OBJECT_HAS_WATCHER: 218 - return '%s removed %d watcher(s): %s.'; 219 - case self::TYPE_SUBSCRIBED_TO_OBJECT: 220 - case self::TYPE_UNSUBSCRIBED_FROM_OBJECT: 221 - case self::TYPE_FILE_HAS_OBJECT: 222 - case self::TYPE_CONTRIBUTED_TO_OBJECT: 223 - default: 224 - return '%s removed %d object(s): %s.'; 225 - 226 - } 227 - } 228 - 229 - public static function getFeedStringForEdgeType($type) { 230 - switch ($type) { 231 - case self::TYPE_OBJECT_HAS_SUBSCRIBER: 232 - return '%s updated subscribers of %s.'; 233 - case self::TYPE_OBJECT_HAS_UNSUBSCRIBER: 234 - return '%s updated unsubcribers of %s.'; 235 - case self::TYPE_OBJECT_HAS_FILE: 236 - return '%s updated files of %s.'; 237 - case self::TYPE_OBJECT_HAS_CONTRIBUTOR: 238 - return '%s updated contributors of %s.'; 239 - case self::TYPE_OBJECT_HAS_WATCHER: 240 - return '%s updated watchers for %s.'; 241 - case self::TYPE_SUBSCRIBED_TO_OBJECT: 242 - case self::TYPE_UNSUBSCRIBED_FROM_OBJECT: 243 - case self::TYPE_FILE_HAS_OBJECT: 244 - case self::TYPE_CONTRIBUTED_TO_OBJECT: 245 - default: 246 - return '%s updated objects of %s.'; 247 - 248 - } 249 31 } 250 32 251 33 }
+1 -9
src/infrastructure/edges/type/PhabricatorEdgeType.php
··· 11 11 */ 12 12 abstract class PhabricatorEdgeType extends Phobject { 13 13 14 - // TODO: Make this final after we remove PhabricatorLegacyEdgeType. 15 - /* final */ public function getEdgeConstant() { 14 + final public function getEdgeConstant() { 16 15 $class = new ReflectionClass($this); 17 16 18 17 $const = $class->getConstant('EDGECONST'); ··· 158 157 ->loadObjects(); 159 158 160 159 $map = array(); 161 - 162 - 163 - // TODO: Remove this once everything is migrated. 164 - $exclude = mpull($types, 'getEdgeConstant'); 165 - $map = PhabricatorEdgeConfig::getLegacyTypes($exclude); 166 - unset($types['PhabricatorLegacyEdgeType']); 167 - 168 160 169 161 foreach ($types as $class => $type) { 170 162 $const = $type->getEdgeConstant();
-119
src/infrastructure/edges/type/PhabricatorLegacyEdgeType.php
··· 1 - <?php 2 - 3 - /** 4 - * Supports legacy edges. Do not use or extend this class! 5 - * 6 - * TODO: Move all edge constants out of @{class:PhabricatorEdgeConfig}, then 7 - * throw this away. 8 - */ 9 - final class PhabricatorLegacyEdgeType extends PhabricatorEdgeType { 10 - 11 - private $edgeConstant; 12 - private $inverseEdgeConstant; 13 - private $shouldPreventCycles; 14 - private $strings; 15 - 16 - public function getEdgeConstant() { 17 - return $this->edgeConstant; 18 - } 19 - 20 - public function getInverseEdgeConstant() { 21 - return $this->inverseEdgeConstant; 22 - } 23 - 24 - public function shouldPreventCycles() { 25 - return $this->shouldPreventCycles; 26 - } 27 - 28 - public function setEdgeConstant($edge_constant) { 29 - $this->edgeConstant = $edge_constant; 30 - return $this; 31 - } 32 - 33 - public function setInverseEdgeConstant($inverse_edge_constant) { 34 - $this->inverseEdgeConstant = $inverse_edge_constant; 35 - return $this; 36 - } 37 - 38 - public function setShouldPreventCycles($should_prevent_cycles) { 39 - $this->shouldPreventCycles = $should_prevent_cycles; 40 - return $this; 41 - } 42 - 43 - public function setStrings(array $strings) { 44 - $this->strings = $strings; 45 - return $this; 46 - } 47 - 48 - private function getString($idx, array $argv) { 49 - array_unshift($argv, idx($this->strings, $idx, '')); 50 - 51 - // TODO: Burn this class in a fire. Just hiding this from lint for now. 52 - $pht_func = 'pht'; 53 - return call_user_func_array($pht_func, $argv); 54 - } 55 - 56 - public function getTransactionAddString( 57 - $actor, 58 - $add_count, 59 - $add_edges) { 60 - 61 - $args = func_get_args(); 62 - return $this->getString(0, $args); 63 - } 64 - 65 - public function getTransactionRemoveString( 66 - $actor, 67 - $rem_count, 68 - $rem_edges) { 69 - 70 - $args = func_get_args(); 71 - return $this->getString(1, $args); 72 - } 73 - 74 - public function getTransactionEditString( 75 - $actor, 76 - $total_count, 77 - $add_count, 78 - $add_edges, 79 - $rem_count, 80 - $rem_edges) { 81 - 82 - $args = func_get_args(); 83 - return $this->getString(2, $args); 84 - } 85 - 86 - public function getFeedAddString( 87 - $actor, 88 - $object, 89 - $add_count, 90 - $add_edges) { 91 - 92 - $args = func_get_args(); 93 - return $this->getString(3, $args); 94 - } 95 - 96 - public function getFeedRemoveString( 97 - $actor, 98 - $object, 99 - $rem_count, 100 - $rem_edges) { 101 - 102 - $args = func_get_args(); 103 - return $this->getString(3, $args); 104 - } 105 - 106 - public function getFeedEditString( 107 - $actor, 108 - $object, 109 - $total_count, 110 - $add_count, 111 - $add_edges, 112 - $rem_count, 113 - $rem_edges) { 114 - 115 - $args = func_get_args(); 116 - return $this->getString(3, $args); 117 - } 118 - 119 - }
+9 -26
src/infrastructure/internationalization/translation/PhabricatorBaseEnglishTranslation.php
··· 325 325 ), 326 326 ), 327 327 328 - '%s edited file(s), added %d: %s; removed %d: %s.' => 328 + '%s edited file(s), added %s: %s; removed %s: %s.' => 329 329 '%s edited files, added: %3$s; removed: %5$s.', 330 330 331 - '%s added %d file(s): %s.' => array( 331 + '%s added %s file(s): %s.' => array( 332 332 array( 333 333 '%s added a file: %3$s.', 334 334 '%s added files: %3$s.', 335 335 ), 336 336 ), 337 337 338 - '%s removed %d file(s): %s.' => array( 338 + '%s removed %s file(s): %s.' => array( 339 339 array( 340 340 '%s removed a file: %3$s.', 341 341 '%s removed files: %3$s.', 342 342 ), 343 343 ), 344 344 345 - '%s edited contributor(s), added %d: %s; removed %d: %s.' => 345 + '%s edited contributor(s), added %s: %s; removed %s: %s.' => 346 346 '%s edited contributors, added: %3$s; removed: %5$s.', 347 347 348 - '%s added %d contributor(s): %s.' => array( 348 + '%s added %s contributor(s): %s.' => array( 349 349 array( 350 350 '%s added a contributor: %3$s.', 351 351 '%s added contributors: %3$s.', 352 352 ), 353 353 ), 354 354 355 - '%s removed %d contributor(s): %s.' => array( 355 + '%s removed %s contributor(s): %s.' => array( 356 356 array( 357 357 '%s removed a contributor: %3$s.', 358 358 '%s removed contributors: %3$s.', ··· 376 376 array( 377 377 '%s removed a reviewer: %3$s.', 378 378 '%s removed reviewers: %3$s.', 379 - ), 380 - ), 381 - 382 - '%s edited object(s), added %d: %s; removed %d: %s.' => 383 - '%s edited objects, added: %3$s; removed: %5$s.', 384 - 385 - '%s added %d object(s): %s.' => array( 386 - array( 387 - '%s added a object: %3$s.', 388 - '%s added objects: %3$s.', 389 - ), 390 - ), 391 - 392 - '%s removed %d object(s): %s.' => array( 393 - array( 394 - '%s removed a object: %3$s.', 395 - '%s removed objects: %3$s.', 396 379 ), 397 380 ), 398 381 ··· 683 666 '%s commits', 684 667 ), 685 668 686 - '%s removed %d JIRA issue(s): %s.' => array( 669 + '%s removed %s JIRA issue(s): %s.' => array( 687 670 array( 688 671 '%s removed a JIRA issue: %3$s.', 689 672 '%s removed JIRA issues: %3$s.', 690 673 ), 691 674 ), 692 675 693 - '%s added %d JIRA issue(s): %s.' => array( 676 + '%s added %s JIRA issue(s): %s.' => array( 694 677 array( 695 678 '%s added a JIRA issue: %3$s.', 696 679 '%s added JIRA issues: %3$s.', ··· 704 687 ), 705 688 ), 706 689 707 - '%s updated JIRA issue(s): added %d %s; removed %d %s.' => 690 + '%s updated JIRA issue(s): added %s %s; removed %d %s.' => 708 691 '%s updated JIRA issues: added %3$s; removed %5$s.', 709 692 710 693 '%s edited %s task(s), added %s: %s; removed %s: %s.' =>