@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

Rename "HeraldAction" to "HeraldActionRecord"

Summary:
Ref T8726. I want to modularize actions like fields, but the base class should be "HeraldAction".

Eventually, "HeraldCondition" should probably be "HeraldFieldRecord", and then both Action and Condition should just be rolled into Rule, probably, but that can wait and doesn't block anything.

Test Plan: Ran migration, poked around UI, used `git grep`.

Reviewers: btrahan

Reviewed By: btrahan

Subscribers: epriestley

Maniphest Tasks: T8726

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

+16 -14
+1 -1
resources/sql/autopatches/20150606.mlist.1.php
··· 99 99 echo pht('Updated mailing lists in Herald condition %d.', $id)."\n"; 100 100 } 101 101 102 - $table = new HeraldAction(); 102 + $table = new HeraldActionRecord(); 103 103 $conn_w = $table->establishConnection('w'); 104 104 foreach (new LiskMigrationIterator($table) as $action) { 105 105 $name = $action->getAction();
+2
resources/sql/autopatches/20150717.herald.1.sql
··· 1 + RENAME TABLE {$NAMESPACE}_herald.herald_action 2 + TO {$NAMESPACE}_herald.herald_actionrecord;
+2 -2
src/__phutil_library_map__.php
··· 1007 1007 'HarbormasterUploadArtifactBuildStepImplementation' => 'applications/harbormaster/step/HarbormasterUploadArtifactBuildStepImplementation.php', 1008 1008 'HarbormasterWaitForPreviousBuildStepImplementation' => 'applications/harbormaster/step/HarbormasterWaitForPreviousBuildStepImplementation.php', 1009 1009 'HarbormasterWorker' => 'applications/harbormaster/worker/HarbormasterWorker.php', 1010 - 'HeraldAction' => 'applications/herald/storage/HeraldAction.php', 1010 + 'HeraldActionRecord' => 'applications/herald/storage/HeraldActionRecord.php', 1011 1011 'HeraldAdapter' => 'applications/herald/adapter/HeraldAdapter.php', 1012 1012 'HeraldAlwaysField' => 'applications/herald/field/HeraldAlwaysField.php', 1013 1013 'HeraldAnotherRuleField' => 'applications/herald/field/HeraldAnotherRuleField.php', ··· 4661 4661 'HarbormasterUploadArtifactBuildStepImplementation' => 'HarbormasterBuildStepImplementation', 4662 4662 'HarbormasterWaitForPreviousBuildStepImplementation' => 'HarbormasterBuildStepImplementation', 4663 4663 'HarbormasterWorker' => 'PhabricatorWorker', 4664 - 'HeraldAction' => 'HeraldDAO', 4664 + 'HeraldActionRecord' => 'HeraldDAO', 4665 4665 'HeraldAdapter' => 'Phobject', 4666 4666 'HeraldAlwaysField' => 'HeraldField', 4667 4667 'HeraldAnotherRuleField' => 'HeraldField',
+3 -3
src/applications/herald/adapter/HeraldAdapter.php
··· 690 690 691 691 public function willSaveAction( 692 692 HeraldRule $rule, 693 - HeraldAction $action) { 693 + HeraldActionRecord $action) { 694 694 695 695 $target = $action->getTarget(); 696 696 if (is_array($target)) { ··· 996 996 } 997 997 998 998 private function renderActionAsText( 999 - HeraldAction $action, 999 + HeraldActionRecord $action, 1000 1000 PhabricatorHandleList $handles) { 1001 1001 $rule_global = HeraldRuleTypeConfig::RULE_TYPE_GLOBAL; 1002 1002 ··· 1028 1028 } 1029 1029 1030 1030 private function renderActionTargetAsText( 1031 - HeraldAction $action, 1031 + HeraldActionRecord $action, 1032 1032 PhabricatorHandleList $handles) { 1033 1033 1034 1034 $target = $action->getTarget();
+1 -1
src/applications/herald/controller/HeraldRuleController.php
··· 313 313 $action[1] = null; 314 314 } 315 315 316 - $obj = new HeraldAction(); 316 + $obj = new HeraldActionRecord(); 317 317 $obj->setAction($action[0]); 318 318 $obj->setTarget($action[1]); 319 319
+1 -1
src/applications/herald/query/HeraldRuleQuery.php
··· 108 108 $rule_ids); 109 109 $conditions = mgroup($conditions, 'getRuleID'); 110 110 111 - $actions = id(new HeraldAction())->loadAllWhere( 111 + $actions = id(new HeraldActionRecord())->loadAllWhere( 112 112 'ruleID IN (%Ld)', 113 113 $rule_ids); 114 114 $actions = mgroup($actions, 'getRuleID');
+1 -1
src/applications/herald/storage/HeraldAction.php src/applications/herald/storage/HeraldActionRecord.php
··· 1 1 <?php 2 2 3 - final class HeraldAction extends HeraldDAO { 3 + final class HeraldActionRecord extends HeraldDAO { 4 4 5 5 protected $ruleID; 6 6
+5 -5
src/applications/herald/storage/HeraldRule.php
··· 99 99 if (!$this->getID()) { 100 100 return array(); 101 101 } 102 - return id(new HeraldAction())->loadAllWhere( 102 + return id(new HeraldActionRecord())->loadAllWhere( 103 103 'ruleID = %d', 104 104 $this->getID()); 105 105 } 106 106 107 107 public function attachActions(array $actions) { 108 108 // TODO: validate actions have been attached. 109 - assert_instances_of($actions, 'HeraldAction'); 109 + assert_instances_of($actions, 'HeraldActionRecord'); 110 110 $this->actions = $actions; 111 111 return $this; 112 112 } ··· 123 123 } 124 124 125 125 public function saveActions(array $actions) { 126 - assert_instances_of($actions, 'HeraldAction'); 126 + assert_instances_of($actions, 'HeraldActionRecord'); 127 127 return $this->saveChildren( 128 - id(new HeraldAction())->getTableName(), 128 + id(new HeraldActionRecord())->getTableName(), 129 129 $actions); 130 130 } 131 131 ··· 162 162 queryfx( 163 163 $this->establishConnection('w'), 164 164 'DELETE FROM %T WHERE ruleID = %d', 165 - id(new HeraldAction())->getTableName(), 165 + id(new HeraldActionRecord())->getTableName(), 166 166 $this->getID()); 167 167 $result = parent::delete(); 168 168 $this->saveTransaction();