1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-12-22 21:40:55 +01:00

Rename classes for consistency

Summary: These classes are named differently from other `PhabricatorEdgeType` subclasses. Rename them for consistency.

Test Plan: I would expect the linter to complain if I missed anything.

Reviewers: epriestley, #blessed_reviewers

Reviewed By: epriestley, #blessed_reviewers

Subscribers: Korvin, epriestley

Differential Revision: https://secure.phabricator.com/D11112
This commit is contained in:
Joshua Spence 2015-01-01 15:40:26 +11:00
parent 7e54ab23b3
commit 1ff6972f7e
5 changed files with 17 additions and 15 deletions

View file

@ -1989,8 +1989,8 @@ phutil_register_library_map(array(
'PhabricatorObjectListQueryTestCase' => 'applications/phid/query/__tests__/PhabricatorObjectListQueryTestCase.php', 'PhabricatorObjectListQueryTestCase' => 'applications/phid/query/__tests__/PhabricatorObjectListQueryTestCase.php',
'PhabricatorObjectMailReceiver' => 'applications/metamta/receiver/PhabricatorObjectMailReceiver.php', 'PhabricatorObjectMailReceiver' => 'applications/metamta/receiver/PhabricatorObjectMailReceiver.php',
'PhabricatorObjectMailReceiverTestCase' => 'applications/metamta/receiver/__tests__/PhabricatorObjectMailReceiverTestCase.php', 'PhabricatorObjectMailReceiverTestCase' => 'applications/metamta/receiver/__tests__/PhabricatorObjectMailReceiverTestCase.php',
'PhabricatorObjectMentionedByObject' => 'applications/transactions/edges/PhabricatorObjectMentionedByObject.php', 'PhabricatorObjectMentionedByObjectEdgeType' => 'applications/transactions/edges/PhabricatorObjectMentionedByObjectEdgeType.php',
'PhabricatorObjectMentionsObject' => 'applications/transactions/edges/PhabricatorObjectMentionsObject.php', 'PhabricatorObjectMentionsObjectEdgeType' => 'applications/transactions/edges/PhabricatorObjectMentionsObjectEdgeType.php',
'PhabricatorObjectQuery' => 'applications/phid/query/PhabricatorObjectQuery.php', 'PhabricatorObjectQuery' => 'applications/phid/query/PhabricatorObjectQuery.php',
'PhabricatorObjectRemarkupRule' => 'infrastructure/markup/rule/PhabricatorObjectRemarkupRule.php', 'PhabricatorObjectRemarkupRule' => 'infrastructure/markup/rule/PhabricatorObjectRemarkupRule.php',
'PhabricatorObjectSelectorDialog' => 'view/control/PhabricatorObjectSelectorDialog.php', 'PhabricatorObjectSelectorDialog' => 'view/control/PhabricatorObjectSelectorDialog.php',
@ -5162,8 +5162,8 @@ phutil_register_library_map(array(
'PhabricatorObjectListQueryTestCase' => 'PhabricatorTestCase', 'PhabricatorObjectListQueryTestCase' => 'PhabricatorTestCase',
'PhabricatorObjectMailReceiver' => 'PhabricatorMailReceiver', 'PhabricatorObjectMailReceiver' => 'PhabricatorMailReceiver',
'PhabricatorObjectMailReceiverTestCase' => 'PhabricatorTestCase', 'PhabricatorObjectMailReceiverTestCase' => 'PhabricatorTestCase',
'PhabricatorObjectMentionedByObject' => 'PhabricatorEdgeType', 'PhabricatorObjectMentionedByObjectEdgeType' => 'PhabricatorEdgeType',
'PhabricatorObjectMentionsObject' => 'PhabricatorEdgeType', 'PhabricatorObjectMentionsObjectEdgeType' => 'PhabricatorEdgeType',
'PhabricatorObjectQuery' => 'PhabricatorCursorPagedPolicyAwareQuery', 'PhabricatorObjectQuery' => 'PhabricatorCursorPagedPolicyAwareQuery',
'PhabricatorObjectRemarkupRule' => 'PhutilRemarkupRule', 'PhabricatorObjectRemarkupRule' => 'PhutilRemarkupRule',
'PhabricatorOffsetPagedQuery' => 'PhabricatorQuery', 'PhabricatorOffsetPagedQuery' => 'PhabricatorQuery',

View file

@ -1,11 +1,12 @@
<?php <?php
final class PhabricatorObjectMentionedByObject extends PhabricatorEdgeType { final class PhabricatorObjectMentionedByObjectEdgeType
extends PhabricatorEdgeType {
const EDGECONST = 51; const EDGECONST = 51;
public function getInverseEdgeConstant() { public function getInverseEdgeConstant() {
return PhabricatorObjectMentionsObject::EDGECONST; return PhabricatorObjectMentionsObjectEdgeType::EDGECONST;
} }
public function shouldWriteInverseTransactions() { public function shouldWriteInverseTransactions() {

View file

@ -1,11 +1,12 @@
<?php <?php
final class PhabricatorObjectMentionsObject extends PhabricatorEdgeType { final class PhabricatorObjectMentionsObjectEdgeType
extends PhabricatorEdgeType {
const EDGECONST = 52; const EDGECONST = 52;
public function getInverseEdgeConstant() { public function getInverseEdgeConstant() {
return PhabricatorObjectMentionedByObject::EDGECONST; return PhabricatorObjectMentionedByObjectEdgeType::EDGECONST;
} }
public function shouldWriteInverseTransactions() { public function shouldWriteInverseTransactions() {

View file

@ -1249,7 +1249,7 @@ abstract class PhabricatorApplicationTransactionEditor
} }
} }
if ($mentionable_phids) { if ($mentionable_phids) {
$edge_type = PhabricatorObjectMentionsObject::EDGECONST; $edge_type = PhabricatorObjectMentionsObjectEdgeType::EDGECONST;
$block_xactions[] = newv(get_class(head($xactions)), array()) $block_xactions[] = newv(get_class(head($xactions)), array())
->setIgnoreOnNoEffect(true) ->setIgnoreOnNoEffect(true)
->setTransactionType(PhabricatorTransactions::TYPE_EDGE) ->setTransactionType(PhabricatorTransactions::TYPE_EDGE)

View file

@ -452,10 +452,10 @@ abstract class PhabricatorApplicationTransaction
case PhabricatorTransactions::TYPE_EDGE: case PhabricatorTransactions::TYPE_EDGE:
$edge_type = $this->getMetadataValue('edge:type'); $edge_type = $this->getMetadataValue('edge:type');
switch ($edge_type) { switch ($edge_type) {
case PhabricatorObjectMentionsObject::EDGECONST: case PhabricatorObjectMentionsObjectEdgeType::EDGECONST:
return true; return true;
break; break;
case PhabricatorObjectMentionedByObject::EDGECONST: case PhabricatorObjectMentionedByObjectEdgeType::EDGECONST:
$new = ipull($this->getNewValue(), 'dst'); $new = ipull($this->getNewValue(), 'dst');
$old = ipull($this->getOldValue(), 'dst'); $old = ipull($this->getOldValue(), 'dst');
$add = array_diff($new, $old); $add = array_diff($new, $old);
@ -491,8 +491,8 @@ abstract class PhabricatorApplicationTransaction
case PhabricatorTransactions::TYPE_EDGE: case PhabricatorTransactions::TYPE_EDGE:
$edge_type = $this->getMetadataValue('edge:type'); $edge_type = $this->getMetadataValue('edge:type');
switch ($edge_type) { switch ($edge_type) {
case PhabricatorObjectMentionsObject::EDGECONST: case PhabricatorObjectMentionsObjectEdgeType::EDGECONST:
case PhabricatorObjectMentionedByObject::EDGECONST: case PhabricatorObjectMentionedByObjectEdgeType::EDGECONST:
return true; return true;
break; break;
default: default:
@ -521,8 +521,8 @@ abstract class PhabricatorApplicationTransaction
case PhabricatorTransactions::TYPE_EDGE: case PhabricatorTransactions::TYPE_EDGE:
$edge_type = $this->getMetadataValue('edge:type'); $edge_type = $this->getMetadataValue('edge:type');
switch ($edge_type) { switch ($edge_type) {
case PhabricatorObjectMentionsObject::EDGECONST: case PhabricatorObjectMentionsObjectEdgeType::EDGECONST:
case PhabricatorObjectMentionedByObject::EDGECONST: case PhabricatorObjectMentionedByObjectEdgeType::EDGECONST:
return true; return true;
break; break;
default: default: