1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-11-25 00:02:41 +01:00

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
This commit is contained in:
Andre Klapper 2024-05-16 16:41:44 +02:00
parent 23a3f59be2
commit c1a8b83bd7
6 changed files with 2 additions and 4 deletions

View file

@ -523,6 +523,7 @@ final class AphrontApplicationConfiguration
return array($result->getController(), $result->getURIData());
}
}
return null;
}
private function buildSiteForRequest(AphrontRequest $request) {

View file

@ -231,7 +231,6 @@ final class PhabricatorUserEmail
*
* @param PhabricatorUser The user sending the notification.
* @param PhabricatorUserEmail New primary email address.
* @return this
* @task email
*/
public function sendOldPrimaryEmail(

View file

@ -268,6 +268,7 @@ final class PhamePost extends PhameDAO
case self::MARKUP_FIELD_BODY:
return $this->getBody();
}
return null;
}
public function didMarkupText(

View file

@ -262,7 +262,6 @@ abstract class PhabricatorWorker extends Phobject {
* you are using queues to improve locking behavior).
*
* @param map<string, wild> Optional default options.
* @return this
*/
final public function flushTaskQueue($defaults = array()) {
foreach ($this->getQueuedTasks() as $task) {

View file

@ -90,7 +90,6 @@ final class PhabricatorEdgeEditor extends Phobject {
* (e.g., adds followed by removals) if their outcomes are not dependent,
* since transactions will not be held open as long.
*
* @return this
* @task edit
*/
public function save() {

View file

@ -317,7 +317,6 @@ final class PhabricatorStartup {
* @param Throwable The exception itself.
* @param bool True if it's okay to show the exception's stack trace
* to the user. The trace will always be logged.
* @return exit This method **does not return**.
*
* @task apocalypse
*/