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

Fix implicitly nullable parameter declarations for PHP 8.4

Summary:
Followup to rPdb61eb20 and rPf3d49f74. This patch should cover all remaining issues now that PHPStan covers it (instead of the previous trial-and-error approach).

Implicitly nullable parameter declarations are deprecated in PHP 8.4:
https://php.watch/versions/8.4/implicitly-marking-parameter-type-nullable-deprecated

The proposed syntax was introduced in PHP 7.1 and Phorge requires PHP 7.2 now.

Test Plan: Run static code analysis.

Reviewers: O1 Blessed Committers, avivey

Reviewed By: O1 Blessed Committers, avivey

Subscribers: tobiaswiese, valerio.bozzolan, Matthew, Cigaryno

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

+56 -56
+1 -1
src/applications/auth/engine/PhabricatorAuthInviteEngine.php
··· 125 125 private function handleLoggedInInvite( 126 126 PhabricatorAuthInvite $invite, 127 127 PhabricatorUser $viewer, 128 - PhabricatorUserEmail $email = null) { 128 + ?PhabricatorUserEmail $email = null) { 129 129 130 130 if ($email && ($email->getUserPHID() !== $viewer->getPHID())) { 131 131 $other_user = $this->loadUserForEmail($email);
+2 -2
src/applications/base/controller/PhabricatorController.php
··· 485 485 486 486 protected function buildTransactionTimeline( 487 487 PhabricatorApplicationTransactionInterface $object, 488 - PhabricatorApplicationTransactionQuery $query = null, 489 - PhabricatorMarkupEngine $engine = null, 488 + ?PhabricatorApplicationTransactionQuery $query = null, 489 + ?PhabricatorMarkupEngine $engine = null, 490 490 $view_data = array()) { 491 491 492 492 $request = $this->getRequest();
+1 -1
src/applications/calendar/import/PhabricatorCalendarImportEngine.php
··· 55 55 final protected function importEventDocument( 56 56 PhabricatorUser $viewer, 57 57 PhabricatorCalendarImport $import, 58 - PhutilCalendarRootNode $root = null) { 58 + ?PhutilCalendarRootNode $root = null) { 59 59 60 60 $event_type = PhutilCalendarEventNode::NODETYPE; 61 61
+2 -2
src/applications/calendar/parser/data/PhutilCalendarRecurrenceSet.php
··· 21 21 } 22 22 23 23 public function getEventsBetween( 24 - PhutilCalendarDateTime $start = null, 25 - PhutilCalendarDateTime $end = null, 24 + ?PhutilCalendarDateTime $start = null, 25 + ?PhutilCalendarDateTime $end = null, 26 26 $limit = null) { 27 27 28 28 if ($end === null && $limit === null) {
+2 -2
src/applications/conduit/controller/PhabricatorConduitAPIController.php
··· 527 527 528 528 private function buildHumanReadableResponse( 529 529 $method, 530 - ConduitAPIRequest $request = null, 530 + ?ConduitAPIRequest $request = null, 531 531 $result = null, 532 - ConduitAPIMethod $method_implementation = null) { 532 + ?ConduitAPIMethod $method_implementation = null) { 533 533 534 534 $param_rows = array(); 535 535 $param_rows[] = array('Method', $this->renderAPIValue($method));
+1 -1
src/applications/conduit/method/ConduitGetCertificateConduitAPIMethod.php
··· 80 80 81 81 private function logFailure( 82 82 ConduitAPIRequest $request, 83 - PhabricatorConduitCertificateToken $info = null) { 83 + ?PhabricatorConduitCertificateToken $info = null) { 84 84 85 85 $log = PhabricatorUserLog::initializeNewLog( 86 86 $request->getUser(),
+1 -1
src/applications/config/controller/settings/PhabricatorConfigSettingsListController.php
··· 75 75 76 76 private function newConfigOptionView( 77 77 PhabricatorConfigOption $option, 78 - PhabricatorConfigEntry $stored_value = null) { 78 + ?PhabricatorConfigEntry $stored_value = null) { 79 79 80 80 $summary = $option->getSummary(); 81 81
+1 -1
src/applications/conpherence/view/ConpherenceDurableColumnView.php
··· 32 32 } 33 33 34 34 public function setSelectedConpherence( 35 - ConpherenceThread $conpherence = null) { 35 + ?ConpherenceThread $conpherence = null) { 36 36 $this->selectedConpherence = $conpherence; 37 37 return $this; 38 38 }
+1 -1
src/applications/dashboard/controller/dashboard/PhabricatorDashboardAdjustController.php
··· 204 204 private function handleMoveRequest( 205 205 PhabricatorDashboard $dashboard, 206 206 PhabricatorDashboardPanelRef $panel_ref, 207 - PhabricatorDashboardPanelRef $after_ref = null) { 207 + ?PhabricatorDashboardPanelRef $after_ref = null) { 208 208 209 209 $request = $this->getRequest(); 210 210 $request->validateCSRF();
+1 -1
src/applications/dashboard/layoutconfig/PhabricatorDashboardPanelRefList.php
··· 121 121 public function movePanelRef( 122 122 PhabricatorDashboardPanelRef $target, 123 123 $column_key, 124 - PhabricatorDashboardPanelRef $after = null) { 124 + ?PhabricatorDashboardPanelRef $after = null) { 125 125 126 126 $target->setColumnKey($column_key); 127 127
+1 -1
src/applications/differential/conduit/DifferentialConduitAPIMethod.php
··· 20 20 21 21 protected function buildInlineInfoDictionary( 22 22 DifferentialInlineComment $inline, 23 - DifferentialChangeset $changeset = null) { 23 + ?DifferentialChangeset $changeset = null) { 24 24 25 25 $file_path = null; 26 26 $diff_id = null;
+3 -3
src/applications/differential/controller/DifferentialRevisionViewController.php
··· 863 863 864 864 private function loadChangesetsAndVsMap( 865 865 DifferentialDiff $target, 866 - DifferentialDiff $diff_vs = null, 867 - PhabricatorRepository $repository = null) { 866 + ?DifferentialDiff $diff_vs = null, 867 + ?PhabricatorRepository $repository = null) { 868 868 $viewer = $this->getViewer(); 869 869 870 870 $load_diffs = array($target); ··· 1049 1049 array $changesets, 1050 1050 array $vs_changesets, 1051 1051 array $vs_map, 1052 - PhabricatorRepository $repository = null) { 1052 + ?PhabricatorRepository $repository = null) { 1053 1053 1054 1054 assert_instances_of($changesets, 'DifferentialChangeset'); 1055 1055 assert_instances_of($vs_changesets, 'DifferentialChangeset');
+2 -2
src/applications/differential/render/DifferentialChangesetRenderer.php
··· 105 105 return $this->depthOnlyLines; 106 106 } 107 107 108 - public function attachOldFile(PhabricatorFile $old = null) { 108 + public function attachOldFile(?PhabricatorFile $old = null) { 109 109 $this->oldFile = $old; 110 110 return $this; 111 111 } ··· 121 121 return (bool)$this->oldFile; 122 122 } 123 123 124 - public function attachNewFile(PhabricatorFile $new = null) { 124 + public function attachNewFile(?PhabricatorFile $new = null) { 125 125 $this->newFile = $new; 126 126 return $this; 127 127 }
+1 -1
src/applications/diffusion/controller/DiffusionLastModifiedController.php
··· 84 84 85 85 private function renderColumns( 86 86 DiffusionRequest $drequest, 87 - PhabricatorRepositoryCommit $commit = null, 87 + ?PhabricatorRepositoryCommit $commit = null, 88 88 $lint = null) { 89 89 $viewer = $this->getViewer(); 90 90
+1 -1
src/applications/diffusion/data/DiffusionLocalRepositoryFilter.php
··· 20 20 return $this->viewer; 21 21 } 22 22 23 - public function setDevice(AlmanacDevice $device = null) { 23 + public function setDevice(?AlmanacDevice $device = null) { 24 24 $this->device = $device; 25 25 return $this; 26 26 }
+1 -1
src/applications/diffusion/document/DiffusionDocumentRenderingEngine.php
··· 65 65 66 66 protected function addApplicationCrumbs( 67 67 PHUICrumbsView $crumbs, 68 - PhabricatorDocumentRef $ref = null) { 68 + ?PhabricatorDocumentRef $ref = null) { 69 69 return; 70 70 } 71 71
+1 -1
src/applications/diffusion/query/DiffusionCommitRevisionQuery.php
··· 68 68 PhabricatorUser $viewer, 69 69 $source_object, 70 70 array $object_names, 71 - PhabricatorRepository $repository_scope = null) { 71 + ?PhabricatorRepository $repository_scope = null) { 72 72 73 73 // Fetch commits first, since we need to load data on commits in order 74 74 // to identify associated revisions later on.
+1 -1
src/applications/files/diff/PhabricatorDocumentEngineBlocks.php
··· 39 39 } 40 40 41 41 public function addBlockList( 42 - PhabricatorDocumentRef $ref = null, 42 + ?PhabricatorDocumentRef $ref = null, 43 43 array $blocks = array()) { 44 44 45 45 assert_instances_of($blocks, 'PhabricatorDocumentEngineBlock');
+2 -2
src/applications/files/document/PhabricatorDocumentEngine.php
··· 32 32 } 33 33 34 34 public function canDiffDocuments( 35 - PhabricatorDocumentRef $uref = null, 36 - PhabricatorDocumentRef $vref = null) { 35 + ?PhabricatorDocumentRef $uref = null, 36 + ?PhabricatorDocumentRef $vref = null) { 37 37 return false; 38 38 } 39 39
+4 -4
src/applications/files/document/PhabricatorImageDocumentEngine.php
··· 18 18 } 19 19 20 20 public function canDiffDocuments( 21 - PhabricatorDocumentRef $uref = null, 22 - PhabricatorDocumentRef $vref = null) { 21 + ?PhabricatorDocumentRef $uref = null, 22 + ?PhabricatorDocumentRef $vref = null) { 23 23 24 24 // For now, we can only render a rich image diff if the documents have 25 25 // their data stored in Files already. ··· 36 36 } 37 37 38 38 public function newEngineBlocks( 39 - PhabricatorDocumentRef $uref = null, 40 - PhabricatorDocumentRef $vref = null) { 39 + ?PhabricatorDocumentRef $uref = null, 40 + ?PhabricatorDocumentRef $vref = null) { 41 41 42 42 if ($uref) { 43 43 $u_blocks = $this->newDiffBlocks($uref);
+4 -4
src/applications/files/document/PhabricatorJupyterDocumentEngine.php
··· 36 36 } 37 37 38 38 public function canDiffDocuments( 39 - PhabricatorDocumentRef $uref = null, 40 - PhabricatorDocumentRef $vref = null) { 39 + ?PhabricatorDocumentRef $uref = null, 40 + ?PhabricatorDocumentRef $vref = null) { 41 41 return true; 42 42 } 43 43 44 44 public function newEngineBlocks( 45 - PhabricatorDocumentRef $uref = null, 46 - PhabricatorDocumentRef $vref = null) { 45 + ?PhabricatorDocumentRef $uref = null, 46 + ?PhabricatorDocumentRef $vref = null) { 47 47 48 48 $blocks = new PhabricatorDocumentEngineBlocks(); 49 49
+1 -1
src/applications/files/document/render/PhabricatorDocumentRenderingEngine.php
··· 329 329 330 330 protected function addApplicationCrumbs( 331 331 PHUICrumbsView $crumbs, 332 - PhabricatorDocumentRef $ref = null) { 332 + ?PhabricatorDocumentRef $ref = null) { 333 333 return; 334 334 } 335 335
+1 -1
src/applications/files/document/render/PhabricatorFileDocumentRenderingEngine.php
··· 35 35 36 36 protected function addApplicationCrumbs( 37 37 PHUICrumbsView $crumbs, 38 - PhabricatorDocumentRef $ref = null) { 38 + ?PhabricatorDocumentRef $ref = null) { 39 39 40 40 if ($ref) { 41 41 $file = $ref->getFile();
+1 -1
src/applications/project/__tests__/PhabricatorProjectCoreTestCase.php
··· 1534 1534 1535 1535 private function createProject( 1536 1536 PhabricatorUser $user, 1537 - PhabricatorProject $parent = null, 1537 + ?PhabricatorProject $parent = null, 1538 1538 $is_milestone = false) { 1539 1539 1540 1540 $project = PhabricatorProject::initializeNewProject($user, $parent);
+1 -1
src/applications/project/view/ProjectBoardTaskCard.php
··· 54 54 return $this->task; 55 55 } 56 56 57 - public function setOwner(PhabricatorObjectHandle $owner = null) { 57 + public function setOwner(?PhabricatorObjectHandle $owner = null) { 58 58 $this->owner = $owner; 59 59 return $this; 60 60 }
+1 -1
src/applications/repository/daemon/PhabricatorRepositoryPullLocalDaemon.php
··· 405 405 private function loadPullableRepositories( 406 406 array $include, 407 407 array $exclude, 408 - AlmanacDevice $device = null) { 408 + ?AlmanacDevice $device = null) { 409 409 410 410 $query = id(new PhabricatorRepositoryQuery()) 411 411 ->setViewer($this->getViewer());
+1 -1
src/applications/repository/engine/PhabricatorRepositoryPullEngine.php
··· 172 172 $this->donePull(); 173 173 } 174 174 175 - private function abortPull($message, Exception $ex = null) { 175 + private function abortPull($message, ?Exception $ex = null) { 176 176 $code_error = PhabricatorRepositoryStatusMessage::CODE_ERROR; 177 177 $this->updateRepositoryInitStatus($code_error, $message); 178 178 if ($ex) {
+1 -1
src/applications/search/compiler/PhutilSearchQueryCompiler.php
··· 437 437 438 438 private function renderToken( 439 439 PhutilSearchQueryToken $token, 440 - PhutilSearchStemmer $stemmer = null) { 440 + ?PhutilSearchStemmer $stemmer = null) { 441 441 $value = $token->getValue(); 442 442 443 443 if ($stemmer) {
+1 -1
src/applications/search/compiler/__tests__/PhutilSearchQueryCompilerTestCase.php
··· 227 227 private function assertCompileQueries( 228 228 array $tests, 229 229 $operators = null, 230 - PhutilSearchStemmer $stemmer = null) { 230 + ?PhutilSearchStemmer $stemmer = null) { 231 231 foreach ($tests as $input => $expect) { 232 232 $caught = null; 233 233
+3 -3
src/applications/search/fulltextstorage/PhabricatorElasticFulltextStorageEngine.php
··· 263 263 $exceptions); 264 264 } 265 265 266 - public function indexExists(PhabricatorElasticsearchHost $host = null) { 266 + public function indexExists(?PhabricatorElasticsearchHost $host = null) { 267 267 if (!$host) { 268 268 $host = $this->getHostForRead(); 269 269 } ··· 397 397 return $data; 398 398 } 399 399 400 - public function indexIsSane(PhabricatorElasticsearchHost $host = null) { 400 + public function indexIsSane(?PhabricatorElasticsearchHost $host = null) { 401 401 if (!$host) { 402 402 $host = $this->getHostForRead(); 403 403 } ··· 476 476 $this->executeRequest($host, '/', $data, 'PUT'); 477 477 } 478 478 479 - public function getIndexStats(PhabricatorElasticsearchHost $host = null) { 479 + public function getIndexStats(?PhabricatorElasticsearchHost $host = null) { 480 480 if ($this->version < 2) { 481 481 return false; 482 482 }
+1 -1
src/applications/search/menuitem/PhabricatorDashboardProfileMenuItem.php
··· 27 27 return true; 28 28 } 29 29 30 - private function attachDashboard(PhabricatorDashboard $dashboard = null) { 30 + private function attachDashboard(?PhabricatorDashboard $dashboard = null) { 31 31 $this->dashboard = $dashboard; 32 32 return $this; 33 33 }
+1 -1
src/applications/search/query/PhabricatorSearchApplicationSearchEngine.php
··· 201 201 } 202 202 203 203 public static function getIndexableDocumentTypes( 204 - PhabricatorUser $viewer = null) { 204 + ?PhabricatorUser $viewer = null) { 205 205 206 206 // TODO: This is inelegant and not very efficient, but gets us reasonable 207 207 // results. It would be nice to do this more elegantly.
+2 -2
src/applications/settings/panel/PhabricatorEmailPreferencesSettingsPanel.php
··· 146 146 return $form_box; 147 147 } 148 148 149 - private function getAllEditorsWithTags(PhabricatorUser $user = null) { 149 + private function getAllEditorsWithTags(?PhabricatorUser $user = null) { 150 150 $editors = id(new PhutilClassMapQuery()) 151 151 ->setAncestorClass('PhabricatorApplicationTransactionEditor') 152 152 ->setFilterMethod('getMailTagsMap') ··· 165 165 return $editors; 166 166 } 167 167 168 - private function getAllTags(PhabricatorUser $user = null) { 168 + private function getAllTags(?PhabricatorUser $user = null) { 169 169 $tags = array(); 170 170 foreach ($this->getAllEditorsWithTags($user) as $editor) { 171 171 $tags += $editor->getMailTagsMap();
+1 -1
src/applications/settings/setting/PhabricatorSetting.php
··· 4 4 5 5 private $viewer = false; 6 6 7 - public function setViewer(PhabricatorUser $viewer = null) { 7 + public function setViewer(?PhabricatorUser $viewer = null) { 8 8 $this->viewer = $viewer; 9 9 return $this; 10 10 }
+1 -1
src/applications/transactions/draft/PhabricatorDraftEngine.php
··· 27 27 } 28 28 29 29 final public function setVersionedDraft( 30 - PhabricatorVersionedDraft $draft = null) { 30 + ?PhabricatorVersionedDraft $draft = null) { 31 31 $this->hasVersionedDraft = true; 32 32 $this->versionedDraft = $draft; 33 33 return $this;
+2 -2
src/infrastructure/diff/interface/PhabricatorInlineComment.php
··· 288 288 289 289 public function attachVersionedDraftForViewer( 290 290 PhabricatorUser $viewer, 291 - PhabricatorVersionedDraft $draft = null) { 291 + ?PhabricatorVersionedDraft $draft = null) { 292 292 293 293 $key = $viewer->getCacheFragment(); 294 294 $this->versionedDrafts[$key] = $draft; ··· 415 415 416 416 private function getWireContentStateMap( 417 417 $is_edit, 418 - PhabricatorUser $viewer = null) { 418 + ?PhabricatorUser $viewer = null) { 419 419 420 420 $initial_state = $this->getInitialContentState(); 421 421 $committed_state = $this->getCommittedContentState();
+1 -1
src/infrastructure/util/__tests__/PhabricatorGlobalLockTestCase.php
··· 205 205 206 206 private function tryHeldLock( 207 207 $lock_name, 208 - AphrontDatabaseConnection $conn = null) { 208 + ?AphrontDatabaseConnection $conn = null) { 209 209 210 210 $lock = PhabricatorGlobalLock::newLock($lock_name); 211 211
+1 -1
src/view/AphrontDialogView.php
··· 273 273 } 274 274 275 275 public function setValidationException( 276 - PhabricatorApplicationTransactionValidationException $ex = null) { 276 + ?PhabricatorApplicationTransactionValidationException $ex = null) { 277 277 $this->validationException = $ex; 278 278 return $this; 279 279 }
+1 -1
src/view/phui/PHUIObjectBoxView.php
··· 135 135 } 136 136 137 137 public function setValidationException( 138 - PhabricatorApplicationTransactionValidationException $ex = null) { 138 + ?PhabricatorApplicationTransactionValidationException $ex = null) { 139 139 $this->validationException = $ex; 140 140 return $this; 141 141 }