Skip to content

Commit 5914bbd

Browse files
committed
Remove *TransactionType classes
Summary: Remove the `*TransactionType` classes and define the constants in the corresponding `*Transaction` class instead. Test Plan: `grep` Reviewers: #blessed_reviewers, epriestley Reviewed By: #blessed_reviewers, epriestley Subscribers: Korvin, epriestley Differential Revision: https://secure.phabricator.com/D13188
1 parent 259b40f commit 5914bbd

35 files changed

+395
-441
lines changed

src/__phutil_library_map__.php

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -264,7 +264,6 @@
264264
'ConpherenceTransactionComment' => 'applications/conpherence/storage/ConpherenceTransactionComment.php',
265265
'ConpherenceTransactionQuery' => 'applications/conpherence/query/ConpherenceTransactionQuery.php',
266266
'ConpherenceTransactionRenderer' => 'applications/conpherence/ConpherenceTransactionRenderer.php',
267-
'ConpherenceTransactionType' => 'applications/conpherence/constants/ConpherenceTransactionType.php',
268267
'ConpherenceTransactionView' => 'applications/conpherence/view/ConpherenceTransactionView.php',
269268
'ConpherenceUpdateActions' => 'applications/conpherence/constants/ConpherenceUpdateActions.php',
270269
'ConpherenceUpdateController' => 'applications/conpherence/controller/ConpherenceUpdateController.php',
@@ -956,7 +955,6 @@
956955
'JavelinUIExample' => 'applications/uiexample/examples/JavelinUIExample.php',
957956
'JavelinViewExampleServerView' => 'applications/uiexample/examples/JavelinViewExampleServerView.php',
958957
'JavelinViewUIExample' => 'applications/uiexample/examples/JavelinViewUIExample.php',
959-
'LegalpadConstants' => 'applications/legalpad/constants/LegalpadConstants.php',
960958
'LegalpadController' => 'applications/legalpad/controller/LegalpadController.php',
961959
'LegalpadCreateDocumentsCapability' => 'applications/legalpad/capability/LegalpadCreateDocumentsCapability.php',
962960
'LegalpadDAO' => 'applications/legalpad/storage/LegalpadDAO.php',
@@ -990,7 +988,6 @@
990988
'LegalpadTransaction' => 'applications/legalpad/storage/LegalpadTransaction.php',
991989
'LegalpadTransactionComment' => 'applications/legalpad/storage/LegalpadTransactionComment.php',
992990
'LegalpadTransactionQuery' => 'applications/legalpad/query/LegalpadTransactionQuery.php',
993-
'LegalpadTransactionType' => 'applications/legalpad/constants/LegalpadTransactionType.php',
994991
'LegalpadTransactionView' => 'applications/legalpad/view/LegalpadTransactionView.php',
995992
'LiskChunkTestCase' => 'infrastructure/storage/lisk/__tests__/LiskChunkTestCase.php',
996993
'LiskDAO' => 'infrastructure/storage/lisk/LiskDAO.php',
@@ -1088,7 +1085,6 @@
10881085
'MetaMTAEmailTransactionCommand' => 'applications/metamta/command/MetaMTAEmailTransactionCommand.php',
10891086
'MetaMTAMailReceivedGarbageCollector' => 'applications/metamta/garbagecollector/MetaMTAMailReceivedGarbageCollector.php',
10901087
'MetaMTAMailSentGarbageCollector' => 'applications/metamta/garbagecollector/MetaMTAMailSentGarbageCollector.php',
1091-
'MetaMTANotificationType' => 'applications/metamta/constants/MetaMTANotificationType.php',
10921088
'MetaMTAReceivedMailStatus' => 'applications/metamta/constants/MetaMTAReceivedMailStatus.php',
10931089
'MultimeterContext' => 'applications/multimeter/storage/MultimeterContext.php',
10941090
'MultimeterControl' => 'applications/multimeter/data/MultimeterControl.php',
@@ -2012,7 +2008,6 @@
20122008
'PhabricatorMacroTransaction' => 'applications/macro/storage/PhabricatorMacroTransaction.php',
20132009
'PhabricatorMacroTransactionComment' => 'applications/macro/storage/PhabricatorMacroTransactionComment.php',
20142010
'PhabricatorMacroTransactionQuery' => 'applications/macro/query/PhabricatorMacroTransactionQuery.php',
2015-
'PhabricatorMacroTransactionType' => 'applications/macro/constants/PhabricatorMacroTransactionType.php',
20162011
'PhabricatorMacroViewController' => 'applications/macro/controller/PhabricatorMacroViewController.php',
20172012
'PhabricatorMailImplementationAdapter' => 'applications/metamta/adapter/PhabricatorMailImplementationAdapter.php',
20182013
'PhabricatorMailImplementationAmazonSESAdapter' => 'applications/metamta/adapter/PhabricatorMailImplementationAmazonSESAdapter.php',
@@ -2850,7 +2845,6 @@
28502845
'PhluxVariableQuery' => 'applications/phlux/query/PhluxVariableQuery.php',
28512846
'PhluxViewController' => 'applications/phlux/controller/PhluxViewController.php',
28522847
'PholioActionMenuEventListener' => 'applications/pholio/event/PholioActionMenuEventListener.php',
2853-
'PholioConstants' => 'applications/pholio/constants/PholioConstants.php',
28542848
'PholioController' => 'applications/pholio/controller/PholioController.php',
28552849
'PholioDAO' => 'applications/pholio/storage/PholioDAO.php',
28562850
'PholioDefaultEditCapability' => 'applications/pholio/capability/PholioDefaultEditCapability.php',
@@ -2882,7 +2876,6 @@
28822876
'PholioTransaction' => 'applications/pholio/storage/PholioTransaction.php',
28832877
'PholioTransactionComment' => 'applications/pholio/storage/PholioTransactionComment.php',
28842878
'PholioTransactionQuery' => 'applications/pholio/query/PholioTransactionQuery.php',
2885-
'PholioTransactionType' => 'applications/pholio/constants/PholioTransactionType.php',
28862879
'PholioTransactionView' => 'applications/pholio/view/PholioTransactionView.php',
28872880
'PholioUploadedImageView' => 'applications/pholio/view/PholioUploadedImageView.php',
28882881
'PhortuneAccount' => 'applications/phortune/storage/PhortuneAccount.php',
@@ -3542,7 +3535,6 @@
35423535
'ConpherenceTransaction' => 'PhabricatorApplicationTransaction',
35433536
'ConpherenceTransactionComment' => 'PhabricatorApplicationTransactionComment',
35443537
'ConpherenceTransactionQuery' => 'PhabricatorApplicationTransactionQuery',
3545-
'ConpherenceTransactionType' => 'ConpherenceConstants',
35463538
'ConpherenceTransactionView' => 'AphrontView',
35473539
'ConpherenceUpdateActions' => 'ConpherenceConstants',
35483540
'ConpherenceUpdateController' => 'ConpherenceController',
@@ -4331,7 +4323,6 @@
43314323
'LegalpadTransaction' => 'PhabricatorApplicationTransaction',
43324324
'LegalpadTransactionComment' => 'PhabricatorApplicationTransactionComment',
43334325
'LegalpadTransactionQuery' => 'PhabricatorApplicationTransactionQuery',
4334-
'LegalpadTransactionType' => 'LegalpadConstants',
43354326
'LegalpadTransactionView' => 'PhabricatorApplicationTransactionView',
43364327
'LiskChunkTestCase' => 'PhabricatorTestCase',
43374328
'LiskDAOTestCase' => 'PhabricatorTestCase',
@@ -4440,7 +4431,6 @@
44404431
'MetaMTAEmailTransactionCommand' => 'Phobject',
44414432
'MetaMTAMailReceivedGarbageCollector' => 'PhabricatorGarbageCollector',
44424433
'MetaMTAMailSentGarbageCollector' => 'PhabricatorGarbageCollector',
4443-
'MetaMTANotificationType' => 'MetaMTAConstants',
44444434
'MetaMTAReceivedMailStatus' => 'MetaMTAConstants',
44454435
'MultimeterContext' => 'MultimeterDimension',
44464436
'MultimeterController' => 'PhabricatorController',
@@ -6430,7 +6420,6 @@
64306420
'PholioTransaction' => 'PhabricatorApplicationTransaction',
64316421
'PholioTransactionComment' => 'PhabricatorApplicationTransactionComment',
64326422
'PholioTransactionQuery' => 'PhabricatorApplicationTransactionQuery',
6433-
'PholioTransactionType' => 'PholioConstants',
64346423
'PholioTransactionView' => 'PhabricatorApplicationTransactionView',
64356424
'PholioUploadedImageView' => 'AphrontView',
64366425
'PhortuneAccount' => array(

src/applications/conpherence/ConpherenceTransactionRenderer.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ public static function renderTransactions(
6161
// between days. some setup required!
6262
$previous_transaction = null;
6363
$date_marker_transaction = id(new ConpherenceTransaction())
64-
->setTransactionType(ConpherenceTransactionType::TYPE_DATE_MARKER)
64+
->setTransactionType(ConpherenceTransaction::TYPE_DATE_MARKER)
6565
->makeEphemeral();
6666
$date_marker_transaction_view = id(new ConpherenceTransactionView())
6767
->setUser($user)

src/applications/conpherence/__tests__/ConpherenceRoomTestCase.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -157,10 +157,10 @@ private function createRoom(
157157

158158
$xactions = array();
159159
$xactions[] = id(new ConpherenceTransaction())
160-
->setTransactionType(ConpherenceTransactionType::TYPE_PARTICIPANTS)
160+
->setTransactionType(ConpherenceTransaction::TYPE_PARTICIPANTS)
161161
->setNewValue(array('+' => $participant_phids));
162162
$xactions[] = id(new ConpherenceTransaction())
163-
->setTransactionType(ConpherenceTransactionType::TYPE_TITLE)
163+
->setTransactionType(ConpherenceTransaction::TYPE_TITLE)
164164
->setNewValue('Test');
165165

166166
id(new ConpherenceEditor())

src/applications/conpherence/__tests__/ConpherenceTestCase.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ protected function addParticipants(
88
array $participant_phids) {
99

1010
$xactions = array(id(new ConpherenceTransaction())
11-
->setTransactionType(ConpherenceTransactionType::TYPE_PARTICIPANTS)
11+
->setTransactionType(ConpherenceTransaction::TYPE_PARTICIPANTS)
1212
->setNewValue(array('+' => $participant_phids)),
1313
);
1414
$editor = id(new ConpherenceEditor())
@@ -24,7 +24,7 @@ protected function removeParticipants(
2424
array $participant_phids) {
2525

2626
$xactions = array(id(new ConpherenceTransaction())
27-
->setTransactionType(ConpherenceTransactionType::TYPE_PARTICIPANTS)
27+
->setTransactionType(ConpherenceTransaction::TYPE_PARTICIPANTS)
2828
->setNewValue(array('-' => $participant_phids)),
2929
);
3030
$editor = id(new ConpherenceEditor())

src/applications/conpherence/conduit/ConpherenceUpdateThreadConduitAPIMethod.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ protected function execute(ConduitAPIRequest $request) {
7171
if ($add_participant_phids) {
7272
$xactions[] = id(new ConpherenceTransaction())
7373
->setTransactionType(
74-
ConpherenceTransactionType::TYPE_PARTICIPANTS)
74+
ConpherenceTransaction::TYPE_PARTICIPANTS)
7575
->setNewValue(array('+' => $add_participant_phids));
7676
}
7777
if ($remove_participant_phid) {
@@ -80,12 +80,12 @@ protected function execute(ConduitAPIRequest $request) {
8080
}
8181
$xactions[] = id(new ConpherenceTransaction())
8282
->setTransactionType(
83-
ConpherenceTransactionType::TYPE_PARTICIPANTS)
83+
ConpherenceTransaction::TYPE_PARTICIPANTS)
8484
->setNewValue(array('-' => array($remove_participant_phid)));
8585
}
8686
if ($title) {
8787
$xactions[] = id(new ConpherenceTransaction())
88-
->setTransactionType(ConpherenceTransactionType::TYPE_TITLE)
88+
->setTransactionType(ConpherenceTransaction::TYPE_TITLE)
8989
->setNewValue($title);
9090
}
9191
if ($message) {

src/applications/conpherence/constants/ConpherenceTransactionType.php

Lines changed: 0 additions & 12 deletions
This file was deleted.

src/applications/conpherence/controller/ConpherenceNewRoomController.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,10 @@ public function handleRequest(AphrontRequest $request) {
1414

1515
$xactions = array();
1616
$xactions[] = id(new ConpherenceTransaction())
17-
->setTransactionType(ConpherenceTransactionType::TYPE_PARTICIPANTS)
17+
->setTransactionType(ConpherenceTransaction::TYPE_PARTICIPANTS)
1818
->setNewValue(array('+' => array($user->getPHID())));
1919
$xactions[] = id(new ConpherenceTransaction())
20-
->setTransactionType(ConpherenceTransactionType::TYPE_TITLE)
20+
->setTransactionType(ConpherenceTransaction::TYPE_TITLE)
2121
->setNewValue($request->getStr('title'));
2222
$xactions[] = id(new ConpherenceTransaction())
2323
->setTransactionType(PhabricatorTransactions::TYPE_VIEW_POLICY)
@@ -41,7 +41,7 @@ public function handleRequest(AphrontRequest $request) {
4141
} catch (PhabricatorApplicationTransactionValidationException $ex) {
4242
$validation_exception = $ex;
4343

44-
$e_title = $ex->getShortMessage(ConpherenceTransactionType::TYPE_TITLE);
44+
$e_title = $ex->getShortMessage(ConpherenceTransaction::TYPE_TITLE);
4545

4646
$conpherence->setViewPolicy($request->getStr('viewPolicy'));
4747
$conpherence->setEditPolicy($request->getStr('editPolicy'));

src/applications/conpherence/controller/ConpherenceUpdateController.php

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ public function handleRequest(AphrontRequest $request) {
6767
case ConpherenceUpdateActions::JOIN_ROOM:
6868
$xactions[] = id(new ConpherenceTransaction())
6969
->setTransactionType(
70-
ConpherenceTransactionType::TYPE_PARTICIPANTS)
70+
ConpherenceTransaction::TYPE_PARTICIPANTS)
7171
->setNewValue(array('+' => array($user->getPHID())));
7272
$delete_draft = true;
7373
$message = $request->getStr('text');
@@ -101,7 +101,7 @@ public function handleRequest(AphrontRequest $request) {
101101
if (!empty($person_phids)) {
102102
$xactions[] = id(new ConpherenceTransaction())
103103
->setTransactionType(
104-
ConpherenceTransactionType::TYPE_PARTICIPANTS)
104+
ConpherenceTransaction::TYPE_PARTICIPANTS)
105105
->setNewValue(array('+' => $person_phids));
106106
}
107107
break;
@@ -114,7 +114,7 @@ public function handleRequest(AphrontRequest $request) {
114114
if ($person_phid && $person_phid == $user->getPHID()) {
115115
$xactions[] = id(new ConpherenceTransaction())
116116
->setTransactionType(
117-
ConpherenceTransactionType::TYPE_PARTICIPANTS)
117+
ConpherenceTransaction::TYPE_PARTICIPANTS)
118118
->setNewValue(array('-' => array($person_phid)));
119119
$response_mode = 'go-home';
120120
}
@@ -144,7 +144,7 @@ public function handleRequest(AphrontRequest $request) {
144144
->withIDs(array($file_id))
145145
->executeOne();
146146
$xactions[] = id(new ConpherenceTransaction())
147-
->setTransactionType(ConpherenceTransactionType::TYPE_PICTURE)
147+
->setTransactionType(ConpherenceTransaction::TYPE_PICTURE)
148148
->setNewValue($orig_file);
149149
$okay = $orig_file->isTransformableImage();
150150
if ($okay) {
@@ -157,7 +157,7 @@ public function handleRequest(AphrontRequest $request) {
157157
ConpherenceImageData::CROP_HEIGHT);
158158
$xactions[] = id(new ConpherenceTransaction())
159159
->setTransactionType(
160-
ConpherenceTransactionType::TYPE_PICTURE_CROP)
160+
ConpherenceTransaction::TYPE_PICTURE_CROP)
161161
->setNewValue($crop_file->getPHID());
162162
}
163163
$response_mode = 'redirect';
@@ -181,12 +181,12 @@ public function handleRequest(AphrontRequest $request) {
181181

182182
$xactions[] = id(new ConpherenceTransaction())
183183
->setTransactionType(
184-
ConpherenceTransactionType::TYPE_PICTURE_CROP)
184+
ConpherenceTransaction::TYPE_PICTURE_CROP)
185185
->setNewValue($image_phid);
186186
}
187187
$title = $request->getStr('title');
188188
$xactions[] = id(new ConpherenceTransaction())
189-
->setTransactionType(ConpherenceTransactionType::TYPE_TITLE)
189+
->setTransactionType(ConpherenceTransaction::TYPE_TITLE)
190190
->setNewValue($title);
191191
if ($conpherence->getIsRoom()) {
192192
$xactions[] = id(new ConpherenceTransaction())

0 commit comments

Comments
 (0)