@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.

When a conduit method requires a string constant, call it "string-const" not "enum"

Summary: Ref T5058. The use of "enum" is confusing; we mean "choose one of these specific string constants". Make this more clear.

Test Plan: Viewed each call from the web UI.

Reviewers: btrahan

Reviewed By: btrahan

Subscribers: epriestley

Maniphest Tasks: T5058

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

+83 -32
+7 -2
src/applications/audit/conduit/ConduitAPI_audit_query_Method.php
··· 10 10 } 11 11 12 12 public function defineParamTypes() { 13 + $statuses = array( 14 + 'status-any', 15 + 'status-open', 16 + ); 17 + $status_const = $this->formatStringConstants($statuses); 18 + 13 19 return array( 14 20 'auditorPHIDs' => 'optional list<phid>', 15 21 'commitPHIDs' => 'optional list<phid>', 16 - 'status' => 'optional enum<"status-any", "status-open"> '. 17 - '(default = "status-any")', 22 + 'status' => 'optional '.$status_const.' (default = "status-any")', 18 23 'offset' => 'optional int', 19 24 'limit' => 'optional int (default = 100)', 20 25 );
+9
src/applications/conduit/method/ConduitAPIMethod.php
··· 165 165 } 166 166 } 167 167 168 + protected function formatStringConstants($constants) { 169 + foreach ($constants as $key => $value) { 170 + $constants[$key] = '"'.$value.'"'; 171 + } 172 + $constants = implode(', ', $constants); 173 + return 'string-constant<'.$constants.'>'; 174 + } 175 + 168 176 169 177 /* -( Paging Results )----------------------------------------------------- */ 170 178 ··· 260 268 public function describeAutomaticCapability($capability) { 261 269 return null; 262 270 } 271 + 263 272 264 273 }
+21 -5
src/applications/differential/conduit/ConduitAPI_differential_creatediff_Method.php
··· 8 8 } 9 9 10 10 public function defineParamTypes() { 11 + 12 + $vcs_const = $this->formatStringConstants( 13 + array( 14 + 'svn', 15 + 'git', 16 + 'hg', 17 + )); 18 + 19 + $status_const = $this->formatStringConstants( 20 + array( 21 + 'none', 22 + 'skip', 23 + 'okay', 24 + 'warn', 25 + 'fail', 26 + 'postponed', 27 + )); 28 + 11 29 return array( 12 30 'changes' => 'required list<dict>', 13 31 'sourceMachine' => 'required string', 14 32 'sourcePath' => 'required string', 15 33 'branch' => 'required string', 16 34 'bookmark' => 'optional string', 17 - 'sourceControlSystem' => 'required enum<svn, git, hg>', 35 + 'sourceControlSystem' => 'required '.$vcs_const, 18 36 'sourceControlPath' => 'required string', 19 37 'sourceControlBaseRevision' => 'required string', 20 38 'creationMethod' => 'optional string', 21 39 'arcanistProject' => 'optional string', 22 - 'lintStatus' => 23 - 'required enum<none, skip, okay, warn, fail, postponed>', 24 - 'unitStatus' => 25 - 'required enum<none, skip, okay, warn, fail, postponed>', 40 + 'lintStatus' => 'required '.$status_const, 41 + 'unitStatus' => 'required '.$status_const, 26 42 'repositoryPHID' => 'optional phid', 27 43 28 44 'parentRevisionID' => 'deprecated',
+1 -3
src/applications/differential/conduit/ConduitAPI_differential_find_Method.php
··· 23 23 'phids', 24 24 ); 25 25 26 - $types = implode(', ', $types); 27 - 28 26 return array( 29 - 'query' => 'required enum<'.$types.'>', 27 + 'query' => 'required '.$this->formatStringConstants($types), 30 28 'guids' => 'required nonempty list<guids>', 31 29 ); 32 30 }
+3 -1
src/applications/differential/conduit/ConduitAPI_differential_getcommitmessage_Method.php
··· 8 8 } 9 9 10 10 public function defineParamTypes() { 11 + $edit_types = array('edit', 'create'); 12 + 11 13 return array( 12 14 'revision_id' => 'optional revision_id', 13 15 'fields' => 'optional dict<string, wild>', 14 - 'edit' => 'optional enum<"edit", "create">', 16 + 'edit' => 'optional '.$this->formatStringConstants($edit_types), 15 17 ); 16 18 } 17 19
+6 -7
src/applications/differential/conduit/ConduitAPI_differential_query_Method.php
··· 9 9 10 10 public function defineParamTypes() { 11 11 $hash_types = ArcanistDifferentialRevisionHash::getTypes(); 12 - $hash_types = implode(', ', $hash_types); 12 + $hash_const = $this->formatStringConstants($hash_types); 13 13 14 14 $status_types = array( 15 15 DifferentialRevisionQuery::STATUS_ANY, ··· 17 17 DifferentialRevisionQuery::STATUS_ACCEPTED, 18 18 DifferentialRevisionQuery::STATUS_CLOSED, 19 19 ); 20 - $status_types = implode(', ', $status_types); 20 + $status_const = $this->formatStringConstants($status_types); 21 21 22 22 $order_types = array( 23 23 DifferentialRevisionQuery::ORDER_MODIFIED, 24 24 DifferentialRevisionQuery::ORDER_CREATED, 25 25 ); 26 - $order_types = implode(', ', $order_types); 26 + $order_const = $this->formatStringConstants($order_types); 27 27 28 28 return array( 29 29 'authors' => 'optional list<phid>', 30 30 'ccs' => 'optional list<phid>', 31 31 'reviewers' => 'optional list<phid>', 32 32 'paths' => 'optional list<pair<callsign, path>>', 33 - 'commitHashes' => 'optional list<pair<enum<'. 34 - $hash_types.'>, string>>', 35 - 'status' => 'optional enum<'.$status_types.'>', 36 - 'order' => 'optional enum<'.$order_types.'>', 33 + 'commitHashes' => 'optional list<pair<'.$hash_const.', string>>', 34 + 'status' => 'optional '.$status_const, 35 + 'order' => 'optional '.$order_const, 37 36 'limit' => 'optional uint', 38 37 'offset' => 'optional uint', 39 38 'ids' => 'optional list<uint>',
+4 -2
src/applications/harbormaster/conduit/ConduitAPI_harbormaster_sendmessage_Method.php
··· 10 10 } 11 11 12 12 public function defineParamTypes() { 13 + $type_const = $this->formatStringConstants(array('pass', 'fail')); 14 + 13 15 return array( 14 - 'buildTargetPHID' => 'phid', 15 - 'type' => 'enum<pass, fail>', 16 + 'buildTargetPHID' => 'required phid', 17 + 'type' => 'required '.$type_const, 16 18 ); 17 19 } 18 20
+4 -4
src/applications/maniphest/conduit/ConduitAPI_maniphest_query_Method.php
··· 27 27 ManiphestTaskQuery::STATUS_SPITE, 28 28 ManiphestTaskQuery::STATUS_DUPLICATE, 29 29 ); 30 - $statuses = implode(', ', $statuses); 30 + $status_const = $this->formatStringConstants($statuses); 31 31 32 32 $orders = array( 33 33 ManiphestTaskQuery::ORDER_PRIORITY, 34 34 ManiphestTaskQuery::ORDER_CREATED, 35 35 ManiphestTaskQuery::ORDER_MODIFIED, 36 36 ); 37 - $orders = implode(', ', $orders); 37 + $order_const = $this->formatStringConstants($orders); 38 38 39 39 return array( 40 40 'ids' => 'optional list<uint>', ··· 45 45 'ccPHIDs' => 'optional list<phid>', 46 46 'fullText' => 'optional string', 47 47 48 - 'status' => 'optional enum<'.$statuses.'>', 49 - 'order' => 'optional enum<'.$orders.'>', 48 + 'status' => 'optional '.$status_const, 49 + 'order' => 'optional '.$order_const, 50 50 51 51 'limit' => 'optional int', 52 52 'offset' => 'optional int',
+3 -1
src/applications/people/conduit/ConduitAPI_user_addstatus_Method.php
··· 18 18 } 19 19 20 20 public function defineParamTypes() { 21 + $status_const = $this->formatStringConstants(array('away', 'sporadic')); 22 + 21 23 return array( 22 24 'fromEpoch' => 'required int', 23 25 'toEpoch' => 'required int', 24 - 'status' => 'required enum<away, sporadic>', 26 + 'status' => 'required '.$status_const, 25 27 'description' => 'optional string', 26 28 ); 27 29 }
+3 -1
src/applications/project/conduit/ConduitAPI_project_query_Method.php
··· 19 19 PhabricatorProjectQuery::STATUS_ARCHIVED, 20 20 ); 21 21 22 + $status_const = $this->formatStringConstants($statuses); 23 + 22 24 return array( 23 25 'ids' => 'optional list<int>', 24 26 'phids' => 'optional list<phid>', 25 - 'status' => 'optional enum<'.implode(', ', $statuses).'>', 27 + 'status' => 'optional '.$status_const, 26 28 27 29 'members' => 'optional list<phid>', 28 30
+3 -1
src/applications/releeph/conduit/work/ConduitAPI_releephwork_getcommitmessage_Method.php
··· 14 14 } 15 15 16 16 public function defineParamTypes() { 17 + $action_const = $this->formatStringConstants(array('pick', 'revert')); 18 + 17 19 return array( 18 20 'requestPHID' => 'required string', 19 - 'action' => 'required enum<"pick", "revert">', 21 + 'action' => 'required '.$action_const, 20 22 ); 21 23 } 22 24
+7 -1
src/applications/releeph/conduit/work/ConduitAPI_releephwork_record_Method.php
··· 26 26 } 27 27 28 28 public function defineParamTypes() { 29 + $action_const = $this->formatStringConstants( 30 + array( 31 + 'pick', 32 + 'revert', 33 + )); 34 + 29 35 return array( 30 36 'requestPHID' => 'required string', 31 - 'action' => 'required enum<"pick", "revert">', 37 + 'action' => 'required '.$action_const, 32 38 'commitIdentifier' => 'required string', 33 39 ); 34 40 }
+7 -1
src/applications/releeph/conduit/work/ConduitAPI_releephwork_recordpickstatus_Method.php
··· 12 12 } 13 13 14 14 public function defineParamTypes() { 15 + $action_const = $this->formatStringConstants( 16 + array( 17 + 'pick', 18 + 'revert', 19 + )); 20 + 15 21 return array( 16 22 'requestPHID' => 'required string', 17 - 'action' => 'required enum<"pick", "revert">', 23 + 'action' => 'required '.$action_const, 18 24 'ok' => 'required bool', 19 25 'dryRun' => 'optional bool', 20 26 'details' => 'optional dict<string, wild>',
+2 -2
src/applications/remarkup/conduit/ConduitAPI_remarkup_process_Method.php
··· 23 23 24 24 public function defineParamTypes() { 25 25 $available_contexts = array_keys($this->getEngineContexts()); 26 - $available_contexts = implode(', ', $available_contexts); 26 + $available_const = $this->formatStringConstants($available_contexts); 27 27 28 28 return array( 29 - 'context' => 'required enum<'.$available_contexts.'>', 29 + 'context' => 'required '.$available_const, 30 30 'contents' => 'required list<string>', 31 31 ); 32 32 }
+3 -1
src/applications/repository/conduit/ConduitAPI_repository_create_Method.php
··· 19 19 } 20 20 21 21 public function defineParamTypes() { 22 + $vcs_const = $this->formatStringConstants(array('git', 'hg', 'svn')); 23 + 22 24 return array( 23 25 'name' => 'required string', 24 - 'vcs' => 'required enum<git, hg, svn>', 26 + 'vcs' => 'required '.$vcs_const, 25 27 'callsign' => 'required string', 26 28 'description' => 'optional string', 27 29 'encoding' => 'optional string',