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

Misc PhpDoc additions or improvements

Summary: Side effect of random stuff I've been poking and trying to understand what it may do.

Test Plan: Read code, check parameter and return types, e.g. via gettype() or get_class().

Reviewers: O1 Blessed Committers, valerio.bozzolan, mainframe98

Reviewed By: O1 Blessed Committers, valerio.bozzolan, mainframe98

Subscribers: mainframe98, tobiaswiese, valerio.bozzolan, Matthew, Cigaryno

Differential Revision: https://we.phorge.it/D26433

+108 -2
+3
src/applications/auth/revoker/PhabricatorAuthRevoker.php
··· 28 28 return $this->getPhobjectClassConstant('REVOKERKEY'); 29 29 } 30 30 31 + /** 32 + * @return array<PhabricatorAuthRevoker> 33 + */ 31 34 final public static function getAllRevokers() { 32 35 return id(new PhutilClassMapQuery()) 33 36 ->setAncestorClass(self::class)
+3
src/applications/diffusion/remarkup/DiffusionCommitRemarkupRule.php
··· 10 10 return true; 11 11 } 12 12 13 + /** 14 + * @return string Regex which defines a valid object ID 15 + */ 13 16 protected function getObjectIDPattern() { 14 17 return PhabricatorRepositoryCommitPHIDType::getCommitObjectNamePattern(); 15 18 }
+3
src/applications/diffusion/remarkup/DiffusionRepositoryByIDRemarkupRule.php
··· 7 7 return 'R'; 8 8 } 9 9 10 + /** 11 + * @return string Regex which defines a valid object ID 12 + */ 10 13 protected function getObjectIDPattern() { 11 14 return '[0-9]+'; 12 15 }
+3
src/applications/diffusion/remarkup/DiffusionRepositoryRemarkupRule.php
··· 7 7 return 'r'; 8 8 } 9 9 10 + /** 11 + * @return string Regex which defines a valid object ID 12 + */ 10 13 protected function getObjectIDPattern() { 11 14 return '[A-Z]+'; 12 15 }
+3
src/applications/people/mail/PhabricatorPeopleMailEngine.php
··· 25 25 return $this; 26 26 } 27 27 28 + /** 29 + * @return PhabricatorUser 30 + */ 28 31 final public function getRecipient() { 29 32 if (!$this->recipient) { 30 33 throw new PhutilInvalidStateException('setRecipient');
+4
src/applications/people/query/PhabricatorPeopleQuery.php
··· 100 100 return $this; 101 101 } 102 102 103 + /** 104 + * Set a prefix to query in a LIKE clause of the query 105 + * @param array<string> $prefixes String prefixes to search for 106 + */ 103 107 public function withNamePrefixes(array $prefixes) { 104 108 $this->namePrefixes = $prefixes; 105 109 return $this;
+3
src/applications/pholio/remarkup/PholioRemarkupRule.php
··· 6 6 return 'M'; 7 7 } 8 8 9 + /** 10 + * @return string Regex which defines a valid object ID 11 + */ 9 12 protected function getObjectIDPattern() { 10 13 // Match "M123", "M123/456", and "M123/456/". Users can hit the latter 11 14 // forms when clicking comment anchors on a mock page.
+4
src/applications/project/query/PhabricatorProjectQuery.php
··· 83 83 return $this; 84 84 } 85 85 86 + /** 87 + * Set a prefix to query in a LIKE clause of the query 88 + * @param array<string> $prefixes String prefixes to search for 89 + */ 86 90 public function withNamePrefixes(array $prefixes) { 87 91 $this->namePrefixes = $prefixes; 88 92 return $this;
+3
src/applications/project/remarkup/ProjectRemarkupRule.php
··· 21 21 return $tag; 22 22 } 23 23 24 + /** 25 + * @return string Regex which defines a valid object ID 26 + */ 24 27 protected function getObjectIDPattern() { 25 28 // NOTE: This rule matches monograms with internal periods, 26 29 // like `#domain.com`, but does not match monograms with terminal
+1 -1
src/applications/repository/graphcache/PhabricatorRepositoryGraphCache.php
··· 62 62 63 63 64 64 /** 65 - * Search the graph cache for the most modification to a path. 65 + * Search the graph cache for the most recent modification to a path. 66 66 * 67 67 * @param int $commit_id The commit ID to search ancestors of. 68 68 * @param int $path_id The path ID to search for changes to.
+16
src/applications/repository/storage/PhabricatorRepository.php
··· 1053 1053 return array_keys($this->getDetail('close-commits-filter', array())); 1054 1054 } 1055 1055 1056 + /** 1057 + * Set Refs which should not automatically get closed via commits. 1058 + * This usually includes the name of the main development branch. 1059 + */ 1056 1060 public function setPermanentRefRules(array $rules) { 1057 1061 $rules = array_fill_keys($rules, true); 1058 1062 $this->setDetail('close-commits-filter', $rules); ··· 1063 1067 return array_keys($this->getDetail('branch-filter', array())); 1064 1068 } 1065 1069 1070 + /** 1071 + * The "Track Only" feature has been deprecated since 2019 in 1072 + * https://secure.phabricator.com/T13277 and 1073 + * https://we.phorge.it/rPc33f544e741775c52c223bc435331bc3422231ee 1074 + * "Track Only" rules can be moved to "Permanent Refs" and/or "Fetch Only". 1075 + * The only use case left may be for performance reasons limiting what is 1076 + * fetched from an observed remote with tens of thousands of branches. 1077 + * 1078 + * You can find all repositories which still use this deprecated setting via 1079 + * SELECT * FROM phabricator_repository.repository WHERE 1080 + * JSON_LENGTH(JSON_EXTRACT(details, '$.branch-filter')) > 0; 1081 + */ 1066 1082 public function setTrackOnlyRules(array $rules) { 1067 1083 $rules = array_fill_keys($rules, true); 1068 1084 $this->setDetail('branch-filter', $rules);
+3
src/applications/transactions/editor/PhabricatorApplicationTransactionEditor.php
··· 5363 5363 return true; 5364 5364 } 5365 5365 5366 + /** 5367 + * Get an entire object's history (via the "!history" email command) 5368 + */ 5366 5369 private function buildHistoryMail(PhabricatorLiskDAO $object) { 5367 5370 $viewer = $this->requireActor(); 5368 5371 $recipient_phid = $this->getActingAsPHID();
+20 -1
src/applications/typeahead/datasource/PhabricatorTypeaheadDatasource.php
··· 198 198 return array_values($tokens); 199 199 } 200 200 201 + /** 202 + * Break search term entered in typeahead field into string tokens 203 + * @return array<string> 204 + */ 201 205 public function getTokens() { 202 206 return self::tokenizeString($this->getRawQuery()); 203 207 } ··· 379 383 380 384 381 385 /** 386 + * Return available function tokens for this typeahead datasource, with each 387 + * key being the function name (e.g. any, not, null, only) and each value 388 + * being another array containing name, summary, description. See the 389 + * "Function Quick Reference" in the Typeahead Function Help for details. 390 + * 391 + * @return array<array<string>|null> 382 392 * @task functions 383 393 */ 384 394 public function getDatasourceFunctions() { ··· 387 397 388 398 389 399 /** 400 + * Return all function tokens for typeahead datasources, with each key being 401 + * the function name (e.g. any, not, null, only) and each value being another 402 + * array containing name, summary, description. See the 403 + * "Function Quick Reference" in the Typeahead Function Help for details. 404 + * 405 + * @return array<array<string>> 390 406 * @task functions 391 407 */ 392 408 public function getAllDatasourceFunctions() { ··· 616 632 617 633 618 634 /** 619 - * @return array 635 + * Get the function tokens entered in the typeahead field, 636 + * e.g. "not" or "any" 637 + * 638 + * @return array<string|null> 620 639 * @task functions 621 640 */ 622 641 public function getFunctionStack() {
+33
src/infrastructure/markup/rule/PhabricatorObjectRemarkupRule.php
··· 20 20 return preg_match('/^\w/', $prefix); 21 21 } 22 22 23 + /** 24 + * @return string Regex which defines a valid object ID 25 + */ 23 26 protected function getObjectIDPattern() { 24 27 return '[1-9]\d*'; 25 28 } ··· 35 38 return $this->getObjectNamePrefix().$id; 36 39 } 37 40 41 + /** 42 + * @return array<PhabricatorHandleList> 43 + */ 38 44 protected function loadHandles(array $objects) { 39 45 $phids = mpull($objects, 'getPHID'); 40 46 ··· 63 69 return $uri; 64 70 } 65 71 72 + /** 73 + * @return string|PhutilSafeHTML|PHUITagView 74 + */ 66 75 protected function renderObjectRefForAnyMedia( 67 76 $object, 68 77 PhabricatorObjectHandle $handle, ··· 88 97 89 98 } 90 99 100 + /** 101 + * @return PHUITagView 102 + */ 91 103 protected function renderObjectRef( 92 104 $object, 93 105 PhabricatorObjectHandle $handle, ··· 111 123 return $this->renderHovertag($text, $href, $attr); 112 124 } 113 125 126 + /** 127 + * @return string|PhutilSafeHTML|PHUITagView 128 + */ 114 129 protected function renderObjectEmbedForAnyMedia( 115 130 $object, 116 131 PhabricatorObjectHandle $handle, ··· 135 150 return $this->renderObjectEmbed($object, $handle, $options); 136 151 } 137 152 153 + /** 154 + * @return PhutilSafeHTML|string|array 155 + */ 138 156 protected function renderObjectEmbed( 139 157 $object, 140 158 PhabricatorObjectHandle $handle, ··· 142 160 return $this->renderDefaultObjectEmbed($object, $handle); 143 161 } 144 162 163 + /** 164 + * @return PhutilSafeHTML|string|array 165 + */ 145 166 final protected function renderDefaultObjectEmbed( 146 167 $object, 147 168 PhabricatorObjectHandle $handle) { ··· 157 178 return $this->renderHovertag($name, $href, $attr); 158 179 } 159 180 181 + /** 182 + * @return PhutilSafeHTML 183 + */ 160 184 protected function renderObjectTagForMail( 161 185 $text, 162 186 $href, ··· 182 206 $text); 183 207 } 184 208 209 + /** 210 + * @return PhutilSafeHTML|string|array 211 + */ 185 212 protected function renderHovertag($name, $href, array $attr = array()) { 186 213 return id(new PHUITagView()) 187 214 ->setName($name) ··· 206 233 return $text; 207 234 } 208 235 236 + /** 237 + * @return string Regex 238 + */ 209 239 private function getObjectEmbedPattern() { 210 240 if ($this->embedPattern === null) { 211 241 $prefix = $this->getObjectNamePrefix(); ··· 219 249 return $this->embedPattern; 220 250 } 221 251 252 + /** 253 + * @return string Regex 254 + */ 222 255 private function getObjectReferencePattern() { 223 256 if ($this->referencePattern === null) { 224 257 $prefix = $this->getObjectNamePrefix();
+6
src/view/phui/PHUIPropertyListView.php
··· 109 109 $this->invokedWillRenderEvent = true; 110 110 } 111 111 112 + /** 113 + * Whether there are any properties to display in the list view. 114 + * Useful to e.g. display an explanation via PHUIInfoView if false. 115 + * 116 + * @return bool 117 + */ 112 118 public function hasAnyProperties() { 113 119 $this->invokeWillRenderEvent(); 114 120