@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

Misc return type fixes

Summary:
Fix a few issues raised by static code analysis:

* /src/applications/audit/query/DiffusionInternalCommitSearchEngine.php:39 Method DiffusionInternalCommitSearchEngine::getURI() should return string but returns null.
* /src/applications/diviner/storage/DivinerLiveSymbol.php:250 Method DivinerLiveSymbol::getMarkupText() should return string but empty return statement found.
* /src/applications/phame/search/PhamePostFerretEngine.php:15 Method PhamePostFerretEngine::newSearchEngine() should return string but returns PhamePostSearchEngine.
* /src/applications/phame/storage/PhamePost.php:270 Method PhamePost::getMarkupText() should return string but returns null.
* /src/applications/policy/rule/PhabricatorPolicyRule.php:188 Method PhabricatorPolicyRule::getObjectPolicyKey() should return string but returns null.
* /src/applications/project/query/PhabricatorProjectColumnSearchEngine.php:45 Method PhabricatorProjectColumnSearchEngine::getURI() should return string but returns null.
* /src/applications/transactions/feed/PhabricatorApplicationTransactionFeedStory.php:124 Method PhabricatorApplicationTransactionFeedStory::getMarkupText() should return string but returns null.

Test Plan: Read the code, run static code analysis.

Reviewers: O1 Blessed Committers, mainframe98

Reviewed By: O1 Blessed Committers, mainframe98

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

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

+7 -7
+1 -1
src/applications/audit/query/DiffusionInternalCommitSearchEngine.php
··· 36 36 } 37 37 38 38 protected function getURI($path) { 39 - return null; 39 + return ''; 40 40 } 41 41 42 42 protected function renderResultList(
+1 -1
src/applications/diviner/storage/DivinerLiveSymbol.php
··· 247 247 248 248 public function getMarkupText($field) { 249 249 if (!$this->getAtom()) { 250 - return; 250 + return ''; 251 251 } 252 252 253 253 return $this->getAtom()->getDocblockText();
+1 -1
src/applications/phame/storage/PhamePost.php
··· 267 267 case self::MARKUP_FIELD_BODY: 268 268 return $this->getBody(); 269 269 } 270 - return null; 270 + return ''; 271 271 } 272 272 273 273 public function didMarkupText(
+1 -1
src/applications/policy/rule/PhabricatorPolicyRule.php
··· 185 185 * @task objectpolicy 186 186 */ 187 187 public function getObjectPolicyKey() { 188 - return null; 188 + return ''; 189 189 } 190 190 191 191 final public function getObjectPolicyFullKey() {
+1 -1
src/applications/project/query/PhabricatorProjectColumnSearchEngine.php
··· 42 42 protected function getURI($path) { 43 43 // NOTE: There's no way to query columns in the web UI, at least for 44 44 // the moment. 45 - return null; 45 + return ''; 46 46 } 47 47 48 48 protected function getBuiltinQueryNames() {
+1 -1
src/applications/search/engine/PhabricatorApplicationSearchEngine.php
··· 463 463 * Return the URI to a path within the application. Used to construct default 464 464 * URIs for management and results. 465 465 * 466 - * @return string URI to path. 466 + * @return string URI to path; empty string if not implemented or applicable. 467 467 * @task uri 468 468 */ 469 469 abstract protected function getURI($path);
+1 -1
src/applications/transactions/feed/PhabricatorApplicationTransactionFeedStory.php
··· 121 121 } 122 122 } 123 123 124 - return null; 124 + return ''; 125 125 } 126 126 127 127 public function renderView() {