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

Correct PHPDoc or add default return for numerous methods

Summary:
Correct PHPDoc when none of the method calls try to handle a return value.
Add missing fallback `return` statements (which may never be reached if previous condition checks were always true).

This reduces the amount of errors reported by static code analysis tools.

Test Plan: Carefully read the code and check all places in which a function gets called whether a return value is expected.

Reviewers: O1 Blessed Committers, valerio.bozzolan

Reviewed By: O1 Blessed Committers, valerio.bozzolan

Subscribers: tobiaswiese, valerio.bozzolan, Matthew, Cigaryno

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

+2 -4
+1
src/aphront/configuration/AphrontApplicationConfiguration.php
··· 523 523 return array($result->getController(), $result->getURIData()); 524 524 } 525 525 } 526 + return null; 526 527 } 527 528 528 529 private function buildSiteForRequest(AphrontRequest $request) {
-1
src/applications/people/storage/PhabricatorUserEmail.php
··· 231 231 * 232 232 * @param PhabricatorUser The user sending the notification. 233 233 * @param PhabricatorUserEmail New primary email address. 234 - * @return this 235 234 * @task email 236 235 */ 237 236 public function sendOldPrimaryEmail(
+1
src/applications/phame/storage/PhamePost.php
··· 268 268 case self::MARKUP_FIELD_BODY: 269 269 return $this->getBody(); 270 270 } 271 + return null; 271 272 } 272 273 273 274 public function didMarkupText(
-1
src/infrastructure/daemon/workers/PhabricatorWorker.php
··· 262 262 * you are using queues to improve locking behavior). 263 263 * 264 264 * @param map<string, wild> Optional default options. 265 - * @return this 266 265 */ 267 266 final public function flushTaskQueue($defaults = array()) { 268 267 foreach ($this->getQueuedTasks() as $task) {
-1
src/infrastructure/edges/editor/PhabricatorEdgeEditor.php
··· 90 90 * (e.g., adds followed by removals) if their outcomes are not dependent, 91 91 * since transactions will not be held open as long. 92 92 * 93 - * @return this 94 93 * @task edit 95 94 */ 96 95 public function save() {
-1
support/startup/PhabricatorStartup.php
··· 317 317 * @param Throwable The exception itself. 318 318 * @param bool True if it's okay to show the exception's stack trace 319 319 * to the user. The trace will always be logged. 320 - * @return exit This method **does not return**. 321 320 * 322 321 * @task apocalypse 323 322 */