@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 some PhpDoc return types

Summary:
Fix a bunch of PhpDoc return type fixes to make PhpStan complain less.
```
Line src/applications/differential/render/DifferentialChangesetOneUpMailRenderer.php
27 Method DifferentialChangesetOneUpMailRenderer::renderShield() should return string but returns null.
------
Line src/applications/diffusion/request/DiffusionRequest.php
166 Method DiffusionRequest::newFromIdentifier() should return DiffusionRequest but returns null.
------
Line src/applications/files/transform/PhabricatorFileImageTransform.php
219 Method PhabricatorFileImageTransform::newEmptyImage() should return resource but returns GdImage.
366 Method PhabricatorFileImageTransform::getImage() should return resource but returns GdImage.
------
Line src/applications/home/view/PHUIHomeView.php
93 Method PHUIHomeView::buildRevisionPanel() should return PHUIObjectBoxView but returns null.
------
Line src/applications/search/controller/PhabricatorApplicationSearchController.php
980 Method PhabricatorApplicationSearchController::newBuiltinUseActions() should return PhabricatorActionView but returns list.
------
Line src/applications/transactions/editor/PhabricatorApplicationTransactionEditor.php
2329 Method PhabricatorApplicationTransactionEditor::newFileTransaction() should return PhabricatorApplicationTransaction but returns null.
```

Test Plan: Read the code.

Reviewers: O1 Blessed Committers, mainframe98

Reviewed By: O1 Blessed Committers, mainframe98

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

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

+11 -11
+1 -1
src/applications/differential/render/DifferentialChangesetRenderer.php
··· 454 454 * 455 455 * @param string $message Message explaining why the diff is hidden. 456 456 * @param string|null $force Force mode, see above. 457 - * @return string Shield markup. 457 + * @return string|null Shield markup. 458 458 */ 459 459 abstract public function renderShield($message, $force = 'default'); 460 460
+5 -5
src/applications/diffusion/request/DiffusionRequest.php
··· 134 134 /** 135 135 * Internal. Use @{method:newFromDictionary}, not this method. 136 136 * 137 - * @param string $identifier Repository identifier. 138 - * @param PhabricatorUser $viewer Viewing user. 139 - * @param bool $need_edit (optional) 140 - * @return DiffusionRequest New request object, or null if no repository is 141 - * found. 137 + * @param string $identifier Repository identifier. 138 + * @param PhabricatorUser $viewer Viewing user. 139 + * @param bool $need_edit (optional) 140 + * @return DiffusionRequest|null New request object, or null if no 141 + * repository is found. 142 142 * @task new 143 143 */ 144 144 private static function newFromIdentifier(
+2 -2
src/applications/files/transform/PhabricatorFileImageTransform.php
··· 161 161 * 162 162 * @param int $w Desired image width. 163 163 * @param int $h Desired image height. 164 - * @return resource New image resource. 164 + * @return GdImage|resource New GD image resource. 165 165 */ 166 166 protected function newEmptyImage($w, $h) { 167 167 $w = (int)$w; ··· 283 283 /** 284 284 * Get the GD image resource for the image being transformed. 285 285 * 286 - * @return resource GD image resource. 286 + * @return GdImage|resource GD image resource. 287 287 */ 288 288 protected function getImage() { 289 289 if ($this->image !== null) {
+1 -1
src/applications/home/view/PHUIHomeView.php
··· 85 85 } 86 86 87 87 /** 88 - * @return PHUIObjectBoxView 88 + * @return PHUIObjectBoxView|null 89 89 */ 90 90 private function buildRevisionPanel() { 91 91 $viewer = $this->getViewer();
+1 -1
src/applications/search/controller/PhabricatorApplicationSearchController.php
··· 919 919 } 920 920 921 921 /** 922 - * @return PhabricatorActionView 922 + * @return array<PhabricatorActionView> 923 923 */ 924 924 private function newBuiltinUseActions() { 925 925 $actions = array();
+1 -1
src/applications/transactions/editor/PhabricatorApplicationTransactionEditor.php
··· 2260 2260 * @param PhabricatorLiskDAO $object 2261 2261 * @param array<PhabricatorApplicationTransaction> $xactions 2262 2262 * @param array<PhabricatorTransactionRemarkupChange> $remarkup_changes 2263 - * @return PhabricatorApplicationTransaction 2263 + * @return PhabricatorApplicationTransaction|null 2264 2264 */ 2265 2265 private function newFileTransaction( 2266 2266 PhabricatorLiskDAO $object,