Page MenuHomePhabricator

D9849.id23931.diff
No OneTemporary

D9849.id23931.diff

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
@@ -2008,9 +2008,11 @@
'PhabricatorProjectMembersRemoveController' => 'applications/project/controller/PhabricatorProjectMembersRemoveController.php',
'PhabricatorProjectMoveController' => 'applications/project/controller/PhabricatorProjectMoveController.php',
'PhabricatorProjectNameCollisionException' => 'applications/project/exception/PhabricatorProjectNameCollisionException.php',
+ 'PhabricatorProjectObjectHasProjectEdgeType' => 'applications/project/edge/PhabricatorProjectObjectHasProjectEdgeType.php',
'PhabricatorProjectPHIDTypeColumn' => 'applications/project/phid/PhabricatorProjectPHIDTypeColumn.php',
'PhabricatorProjectPHIDTypeProject' => 'applications/project/phid/PhabricatorProjectPHIDTypeProject.php',
'PhabricatorProjectProfileController' => 'applications/project/controller/PhabricatorProjectProfileController.php',
+ 'PhabricatorProjectProjectHasObjectEdgeType' => 'applications/project/edge/PhabricatorProjectProjectHasObjectEdgeType.php',
'PhabricatorProjectQuery' => 'applications/project/query/PhabricatorProjectQuery.php',
'PhabricatorProjectSearchEngine' => 'applications/project/query/PhabricatorProjectSearchEngine.php',
'PhabricatorProjectSearchIndexer' => 'applications/project/search/PhabricatorProjectSearchIndexer.php',
@@ -4820,9 +4822,11 @@
'PhabricatorProjectMembersRemoveController' => 'PhabricatorProjectController',
'PhabricatorProjectMoveController' => 'PhabricatorProjectController',
'PhabricatorProjectNameCollisionException' => 'Exception',
+ 'PhabricatorProjectObjectHasProjectEdgeType' => 'PhabricatorEdgeType',
'PhabricatorProjectPHIDTypeColumn' => 'PhabricatorPHIDType',
'PhabricatorProjectPHIDTypeProject' => 'PhabricatorPHIDType',
'PhabricatorProjectProfileController' => 'PhabricatorProjectController',
+ 'PhabricatorProjectProjectHasObjectEdgeType' => 'PhabricatorEdgeType',
'PhabricatorProjectQuery' => 'PhabricatorCursorPagedPolicyAwareQuery',
'PhabricatorProjectSearchEngine' => 'PhabricatorApplicationSearchEngine',
'PhabricatorProjectSearchIndexer' => 'PhabricatorSearchDocumentIndexer',
diff --git a/src/applications/differential/customfield/DifferentialProjectsField.php b/src/applications/differential/customfield/DifferentialProjectsField.php
--- a/src/applications/differential/customfield/DifferentialProjectsField.php
+++ b/src/applications/differential/customfield/DifferentialProjectsField.php
@@ -35,7 +35,7 @@
$projects = PhabricatorEdgeQuery::loadDestinationPHIDs(
$revision->getPHID(),
- PhabricatorEdgeConfig::TYPE_OBJECT_HAS_PROJECT);
+ PhabricatorProjectObjectHasProjectEdgeType::EDGECONST);
$projects = array_reverse($projects);
return $projects;
@@ -97,7 +97,9 @@
}
public function getApplicationTransactionMetadata() {
- return array('edge:type' => PhabricatorEdgeConfig::TYPE_OBJECT_HAS_PROJECT);
+ return array(
+ 'edge:type' => PhabricatorProjectObjectHasProjectEdgeType::EDGECONST,
+ );
}
public function parseValueFromCommitMessage($value) {
diff --git a/src/applications/diffusion/controller/DiffusionRepositoryController.php b/src/applications/diffusion/controller/DiffusionRepositoryController.php
--- a/src/applications/diffusion/controller/DiffusionRepositoryController.php
+++ b/src/applications/diffusion/controller/DiffusionRepositoryController.php
@@ -231,7 +231,7 @@
$project_phids = PhabricatorEdgeQuery::loadDestinationPHIDs(
$repository->getPHID(),
- PhabricatorEdgeConfig::TYPE_OBJECT_HAS_PROJECT);
+ PhabricatorProjectObjectHasProjectEdgeType::EDGECONST);
if ($project_phids) {
$this->loadHandles($project_phids);
$view->addProperty(
diff --git a/src/applications/diffusion/controller/DiffusionRepositoryEditBasicController.php b/src/applications/diffusion/controller/DiffusionRepositoryEditBasicController.php
--- a/src/applications/diffusion/controller/DiffusionRepositoryEditBasicController.php
+++ b/src/applications/diffusion/controller/DiffusionRepositoryEditBasicController.php
@@ -73,7 +73,7 @@
->setTransactionType($type_edge)
->setMetadataValue(
'edge:type',
- PhabricatorEdgeConfig::TYPE_OBJECT_HAS_PROJECT)
+ PhabricatorProjectObjectHasProjectEdgeType::EDGECONST)
->setNewValue(
array(
'=' => array_fuse($v_projects),
diff --git a/src/applications/diffusion/controller/DiffusionRepositoryEditMainController.php b/src/applications/diffusion/controller/DiffusionRepositoryEditMainController.php
--- a/src/applications/diffusion/controller/DiffusionRepositoryEditMainController.php
+++ b/src/applications/diffusion/controller/DiffusionRepositoryEditMainController.php
@@ -265,7 +265,7 @@
$project_phids = PhabricatorEdgeQuery::loadDestinationPHIDs(
$repository->getPHID(),
- PhabricatorEdgeConfig::TYPE_OBJECT_HAS_PROJECT);
+ PhabricatorProjectObjectHasProjectEdgeType::EDGECONST);
if ($project_phids) {
$this->loadHandles($project_phids);
$project_text = $this->renderHandlesForPHIDs($project_phids);
diff --git a/src/applications/herald/adapter/HeraldPholioMockAdapter.php b/src/applications/herald/adapter/HeraldPholioMockAdapter.php
--- a/src/applications/herald/adapter/HeraldPholioMockAdapter.php
+++ b/src/applications/herald/adapter/HeraldPholioMockAdapter.php
@@ -103,7 +103,7 @@
case self::FIELD_PROJECTS:
return PhabricatorEdgeQuery::loadDestinationPHIDs(
$this->getMock()->getPHID(),
- PhabricatorEdgeConfig::TYPE_OBJECT_HAS_PROJECT);
+ PhabricatorProjectObjectHasProjectEdgeType::EDGECONST);
}
return parent::getHeraldField($field);
diff --git a/src/applications/paste/controller/PhabricatorPasteEditController.php b/src/applications/paste/controller/PhabricatorPasteEditController.php
--- a/src/applications/paste/controller/PhabricatorPasteEditController.php
+++ b/src/applications/paste/controller/PhabricatorPasteEditController.php
@@ -76,7 +76,7 @@
} else {
$v_projects = PhabricatorEdgeQuery::loadDestinationPHIDs(
$paste->getPHID(),
- PhabricatorEdgeConfig::TYPE_OBJECT_HAS_PROJECT);
+ PhabricatorProjectObjectHasProjectEdgeType::EDGECONST);
$v_projects = array_reverse($v_projects);
}
@@ -121,7 +121,7 @@
->setTransactionType(PhabricatorTransactions::TYPE_VIEW_POLICY)
->setNewValue($v_policy);
- $proj_edge_type = PhabricatorEdgeConfig::TYPE_OBJECT_HAS_PROJECT;
+ $proj_edge_type = PhabricatorProjectObjectHasProjectEdgeType::EDGECONST;
$xactions[] = id(new PhabricatorPasteTransaction())
->setTransactionType(PhabricatorTransactions::TYPE_EDGE)
->setMetadataValue('edge:type', $proj_edge_type)
diff --git a/src/applications/pholio/controller/PholioMockEditController.php b/src/applications/pholio/controller/PholioMockEditController.php
--- a/src/applications/pholio/controller/PholioMockEditController.php
+++ b/src/applications/pholio/controller/PholioMockEditController.php
@@ -49,7 +49,7 @@
} else {
$v_projects = PhabricatorEdgeQuery::loadDestinationPHIDs(
$mock->getPHID(),
- PhabricatorEdgeConfig::TYPE_OBJECT_HAS_PROJECT);
+ PhabricatorProjectObjectHasProjectEdgeType::EDGECONST);
$v_projects = array_reverse($v_projects);
}
@@ -205,7 +205,7 @@
}
if (!$errors) {
- $proj_edge_type = PhabricatorEdgeConfig::TYPE_OBJECT_HAS_PROJECT;
+ $proj_edge_type = PhabricatorProjectObjectHasProjectEdgeType::EDGECONST;
$xactions[] = id(new PholioTransaction())
->setTransactionType(PhabricatorTransactions::TYPE_EDGE)
->setMetadataValue('edge:type', $proj_edge_type)
diff --git a/src/applications/ponder/controller/PonderQuestionEditController.php b/src/applications/ponder/controller/PonderQuestionEditController.php
--- a/src/applications/ponder/controller/PonderQuestionEditController.php
+++ b/src/applications/ponder/controller/PonderQuestionEditController.php
@@ -27,7 +27,7 @@
}
$v_projects = PhabricatorEdgeQuery::loadDestinationPHIDs(
$question->getPHID(),
- PhabricatorEdgeConfig::TYPE_OBJECT_HAS_PROJECT);
+ PhabricatorProjectObjectHasProjectEdgeType::EDGECONST);
$v_projects = array_reverse($v_projects);
} else {
$question = id(new PonderQuestion())
@@ -70,7 +70,7 @@
->setTransactionType(PonderQuestionTransaction::TYPE_CONTENT)
->setNewValue($v_content);
- $proj_edge_type = PhabricatorEdgeConfig::TYPE_OBJECT_HAS_PROJECT;
+ $proj_edge_type = PhabricatorProjectObjectHasProjectEdgeType::EDGECONST;
$xactions[] = id(new PonderQuestionTransaction())
->setTransactionType(PhabricatorTransactions::TYPE_EDGE)
->setMetadataValue('edge:type', $proj_edge_type)
diff --git a/src/applications/project/edge/PhabricatorProjectObjectHasProjectEdgeType.php b/src/applications/project/edge/PhabricatorProjectObjectHasProjectEdgeType.php
new file mode 100644
--- /dev/null
+++ b/src/applications/project/edge/PhabricatorProjectObjectHasProjectEdgeType.php
@@ -0,0 +1,102 @@
+<?php
+
+final class PhabricatorProjectObjectHasProjectEdgeType
+ extends PhabricatorEdgeType {
+
+ const EDGECONST = 41;
+
+ public function getInverseEdgeConstant() {
+ return PhabricatorProjectProjectHasObjectEdgeType::EDGECONST;
+ }
+
+ public function getTransactionAddString(
+ $actor,
+ $add_count,
+ $add_edges) {
+
+ return pht(
+ '%s added %s project(s): %s.',
+ $actor,
+ $add_count,
+ $add_edges);
+ }
+
+ public function getTransactionRemoveString(
+ $actor,
+ $rem_count,
+ $rem_edges) {
+
+ return pht(
+ '%s removed %s project(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 %s project(s), added %s: %s; removed %s: %s.',
+ $actor,
+ $total_count,
+ $add_count,
+ $add_edges,
+ $rem_count,
+ $rem_edges);
+ }
+
+ public function getFeedAddString(
+ $actor,
+ $object,
+ $add_count,
+ $add_edges) {
+
+ return pht(
+ '%s added %s project(s) to %s: %s.',
+ $actor,
+ $add_count,
+ $object,
+ $add_edges);
+ }
+
+ public function getFeedRemoveString(
+ $actor,
+ $object,
+ $rem_count,
+ $rem_edges) {
+
+ return pht(
+ '%s removed %s project(s) from %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 %s project(s) for %s, added %s: %s; removed %s: %s.',
+ $actor,
+ $total_count,
+ $object,
+ $add_count,
+ $add_edges,
+ $rem_count,
+ $rem_edges);
+ }
+
+}
diff --git a/src/applications/project/edge/PhabricatorProjectProjectHasObjectEdgeType.php b/src/applications/project/edge/PhabricatorProjectProjectHasObjectEdgeType.php
new file mode 100644
--- /dev/null
+++ b/src/applications/project/edge/PhabricatorProjectProjectHasObjectEdgeType.php
@@ -0,0 +1,12 @@
+<?php
+
+final class PhabricatorProjectProjectHasObjectEdgeType
+ extends PhabricatorEdgeType {
+
+ const EDGECONST = 42;
+
+ public function getInverseEdgeConstant() {
+ return PhabricatorProjectObjectHasProjectEdgeType::EDGECONST;
+ }
+
+}
diff --git a/src/applications/project/events/PhabricatorProjectUIEventListener.php b/src/applications/project/events/PhabricatorProjectUIEventListener.php
--- a/src/applications/project/events/PhabricatorProjectUIEventListener.php
+++ b/src/applications/project/events/PhabricatorProjectUIEventListener.php
@@ -31,7 +31,7 @@
$project_phids = PhabricatorEdgeQuery::loadDestinationPHIDs(
$object->getPHID(),
- PhabricatorEdgeConfig::TYPE_OBJECT_HAS_PROJECT);
+ PhabricatorProjectObjectHasProjectEdgeType::EDGECONST);
if ($project_phids) {
$project_phids = array_reverse($project_phids);
$handles = id(new PhabricatorHandleQuery())
diff --git a/src/applications/repository/query/PhabricatorRepositoryQuery.php b/src/applications/repository/query/PhabricatorRepositoryQuery.php
--- a/src/applications/repository/query/PhabricatorRepositoryQuery.php
+++ b/src/applications/repository/query/PhabricatorRepositoryQuery.php
@@ -208,7 +208,7 @@
public function didFilterPage(array $repositories) {
if ($this->needProjectPHIDs) {
- $type_project = PhabricatorEdgeConfig::TYPE_OBJECT_HAS_PROJECT;
+ $type_project = PhabricatorProjectObjectHasProjectEdgeType::EDGECONST;
$edge_query = id(new PhabricatorEdgeQuery())
->withSourcePHIDs(mpull($repositories, 'getPHID'))
diff --git a/src/applications/slowvote/controller/PhabricatorSlowvoteEditController.php b/src/applications/slowvote/controller/PhabricatorSlowvoteEditController.php
--- a/src/applications/slowvote/controller/PhabricatorSlowvoteEditController.php
+++ b/src/applications/slowvote/controller/PhabricatorSlowvoteEditController.php
@@ -38,7 +38,7 @@
} else {
$v_projects = PhabricatorEdgeQuery::loadDestinationPHIDs(
$poll->getPHID(),
- PhabricatorEdgeConfig::TYPE_OBJECT_HAS_PROJECT);
+ PhabricatorProjectObjectHasProjectEdgeType::EDGECONST);
$v_projects = array_reverse($v_projects);
}
@@ -105,7 +105,7 @@
->setNewValue($v_view_policy);
if (empty($errors)) {
- $proj_edge_type = PhabricatorEdgeConfig::TYPE_OBJECT_HAS_PROJECT;
+ $proj_edge_type = PhabricatorProjectObjectHasProjectEdgeType::EDGECONST;
$xactions[] = id(new PhabricatorSlowvoteTransaction())
->setTransactionType(PhabricatorTransactions::TYPE_EDGE)
->setMetadataValue('edge:type', $proj_edge_type)
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
@@ -1153,7 +1153,7 @@
}
if ($phids) {
- $edge_type = PhabricatorEdgeConfig::TYPE_OBJECT_HAS_PROJECT;
+ $edge_type = PhabricatorProjectObjectHasProjectEdgeType::EDGECONST;
$block_xactions[] = newv(get_class(head($xactions)), array())
->setIgnoreOnNoEffect(true)
->setTransactionType(PhabricatorTransactions::TYPE_EDGE)
@@ -1967,7 +1967,7 @@
if ($object instanceof PhabricatorProjectInterface) {
$project_phids = PhabricatorEdgeQuery::loadDestinationPHIDs(
$object->getPHID(),
- PhabricatorEdgeConfig::TYPE_OBJECT_HAS_PROJECT);
+ PhabricatorProjectObjectHasProjectEdgeType::EDGECONST);
} else {
$project_phids = $object->getProjectPHIDs();
}
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
@@ -57,9 +57,6 @@
const TYPE_OBJECT_USES_CREDENTIAL = 39;
const TYPE_CREDENTIAL_USED_BY_OBJECT = 40;
- const TYPE_OBJECT_HAS_PROJECT = 41;
- const TYPE_PROJECT_HAS_OBJECT = 42;
-
const TYPE_OBJECT_HAS_COLUMN = 43;
const TYPE_COLUMN_HAS_OBJECT = 44;
@@ -193,9 +190,6 @@
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_PROJECT => self::TYPE_PROJECT_HAS_OBJECT,
- self::TYPE_PROJECT_HAS_OBJECT => self::TYPE_OBJECT_HAS_PROJECT,
-
self::TYPE_OBJECT_HAS_COLUMN => self::TYPE_COLUMN_HAS_OBJECT,
self::TYPE_COLUMN_HAS_OBJECT => self::TYPE_OBJECT_HAS_COLUMN,
@@ -276,7 +270,6 @@
return '%s edited member(s), added %d: %s; removed %d: %s.';
case self::TYPE_MEMBER_OF_PROJ:
case self::TYPE_COMMIT_HAS_PROJECT:
- case self::TYPE_OBJECT_HAS_PROJECT:
return '%s edited project(s), added %d: %s; removed %d: %s.';
case self::TYPE_QUESTION_HAS_VOTING_USER:
case self::TYPE_ANSWER_HAS_VOTING_USER:
@@ -291,7 +284,6 @@
case self::TYPE_UNSUBSCRIBED_FROM_OBJECT:
case self::TYPE_FILE_HAS_OBJECT:
case self::TYPE_CONTRIBUTED_TO_OBJECT:
- case self::TYPE_PROJECT_HAS_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.';
@@ -353,7 +345,6 @@
return '%s added %d member(s): %s.';
case self::TYPE_MEMBER_OF_PROJ:
case self::TYPE_COMMIT_HAS_PROJECT:
- case self::TYPE_OBJECT_HAS_PROJECT:
return '%s added %d project(s): %s.';
case self::TYPE_QUESTION_HAS_VOTING_USER:
case self::TYPE_ANSWER_HAS_VOTING_USER:
@@ -394,7 +385,6 @@
case self::TYPE_UNSUBSCRIBED_FROM_OBJECT:
case self::TYPE_FILE_HAS_OBJECT:
case self::TYPE_CONTRIBUTED_TO_OBJECT:
- case self::TYPE_PROJECT_HAS_OBJECT:
default:
return '%s added %d object(s): %s.';
@@ -428,7 +418,6 @@
return '%s removed %d member(s): %s.';
case self::TYPE_MEMBER_OF_PROJ:
case self::TYPE_COMMIT_HAS_PROJECT:
- case self::TYPE_OBJECT_HAS_PROJECT:
return '%s removed %d project(s): %s.';
case self::TYPE_QUESTION_HAS_VOTING_USER:
case self::TYPE_ANSWER_HAS_VOTING_USER:
@@ -467,7 +456,6 @@
case self::TYPE_UNSUBSCRIBED_FROM_OBJECT:
case self::TYPE_FILE_HAS_OBJECT:
case self::TYPE_CONTRIBUTED_TO_OBJECT:
- case self::TYPE_PROJECT_HAS_OBJECT:
default:
return '%s removed %d object(s): %s.';
@@ -499,7 +487,6 @@
return '%s updated members of %s.';
case self::TYPE_MEMBER_OF_PROJ:
case self::TYPE_COMMIT_HAS_PROJECT:
- case self::TYPE_OBJECT_HAS_PROJECT:
return '%s updated projects of %s.';
case self::TYPE_QUESTION_HAS_VOTING_USER:
case self::TYPE_ANSWER_HAS_VOTING_USER:
@@ -538,7 +525,6 @@
case self::TYPE_UNSUBSCRIBED_FROM_OBJECT:
case self::TYPE_FILE_HAS_OBJECT:
case self::TYPE_CONTRIBUTED_TO_OBJECT:
- case self::TYPE_PROJECT_HAS_OBJECT:
default:
return '%s updated objects of %s.';

File Metadata

Mime Type
text/plain
Expires
Mon, Dec 23, 3:28 AM (1 h, 39 m)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
6920448
Default Alt Text
D9849.id23931.diff (18 KB)

Event Timeline