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

Note: This code change does *not* fix all occurrences but only allows passing `./bin/storage upgrade`.

Refs T15935

Test Plan: Try to successfully run `./bin/storage upgrade` with PHP 8.4

Reviewers: O1 Blessed Committers, chris

Reviewed By: O1 Blessed Committers, chris

Subscribers: tobiaswiese, valerio.bozzolan, Matthew, Cigaryno

Maniphest Tasks: T15935

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

+59 -59
+2 -2
src/applications/audit/storage/PhabricatorAuditTransactionComment.php
··· 66 66 } 67 67 68 68 public function attachReplyToComment( 69 - PhabricatorAuditTransactionComment $comment = null) { 69 + ?PhabricatorAuditTransactionComment $comment = null) { 70 70 $this->replyToComment = $comment; 71 71 return $this; 72 72 } ··· 93 93 } 94 94 95 95 public function attachInlineContext( 96 - PhabricatorInlineCommentContext $context = null) { 96 + ?PhabricatorInlineCommentContext $context = null) { 97 97 $this->inlineContext = $context; 98 98 return $this; 99 99 }
+1 -1
src/applications/base/PhabricatorApplication.php
··· 338 338 */ 339 339 public function buildMainMenuItems( 340 340 PhabricatorUser $user, 341 - PhabricatorController $controller = null) { 341 + ?PhabricatorController $controller = null) { 342 342 return array(); 343 343 } 344 344
+6 -6
src/applications/calendar/storage/PhabricatorCalendarEvent.php
··· 130 130 private function newChild( 131 131 PhabricatorUser $actor, 132 132 $sequence, 133 - PhutilCalendarDateTime $start = null) { 133 + ?PhutilCalendarDateTime $start = null) { 134 134 if (!$this->isParentEvent()) { 135 135 throw new Exception( 136 136 pht( ··· 188 188 189 189 public function copyFromParent( 190 190 PhabricatorUser $actor, 191 - PhutilCalendarDateTime $start = null) { 191 + ?PhutilCalendarDateTime $start = null) { 192 192 193 193 if (!$this->isChildEvent()) { 194 194 throw new Exception( ··· 287 287 public function newGhost( 288 288 PhabricatorUser $actor, 289 289 $sequence, 290 - PhutilCalendarDateTime $start = null) { 290 + ?PhutilCalendarDateTime $start = null) { 291 291 292 292 $ghost = $this->newChild($actor, $sequence, $start); 293 293 ··· 559 559 return $this->assertAttached($this->parentEvent); 560 560 } 561 561 562 - public function attachParentEvent(PhabricatorCalendarEvent $event = null) { 562 + public function attachParentEvent(?PhabricatorCalendarEvent $event = null) { 563 563 $this->parentEvent = $event; 564 564 return $this; 565 565 } ··· 957 957 $datetime->newAbsoluteDateTime()->toDictionary()); 958 958 } 959 959 960 - public function setUntilDateTime(PhutilCalendarDateTime $datetime = null) { 960 + public function setUntilDateTime(?PhutilCalendarDateTime $datetime = null) { 961 961 if ($datetime) { 962 962 $value = $datetime->newAbsoluteDateTime()->toDictionary(); 963 963 } else { ··· 1045 1045 } 1046 1046 1047 1047 public function attachImportSource( 1048 - PhabricatorCalendarImport $import = null) { 1048 + ?PhabricatorCalendarImport $import = null) { 1049 1049 $this->importSource = $import; 1050 1050 return $this; 1051 1051 }
+2 -2
src/applications/config/schema/PhabricatorConfigSchemaQuery.php
··· 349 349 } 350 350 351 351 private function compareSchemata( 352 - PhabricatorConfigStorageSchema $expect = null, 353 - PhabricatorConfigStorageSchema $actual = null) { 352 + ?PhabricatorConfigStorageSchema $expect = null, 353 + ?PhabricatorConfigStorageSchema $actual = null) { 354 354 355 355 $expect_is_key = ($expect instanceof PhabricatorConfigKeySchema); 356 356 $actual_is_key = ($actual instanceof PhabricatorConfigKeySchema);
+3 -3
src/applications/differential/storage/DifferentialChangeset.php
··· 290 290 } 291 291 292 292 public function getAbsoluteRepositoryPath( 293 - PhabricatorRepository $repository = null, 294 - DifferentialDiff $diff = null) { 293 + ?PhabricatorRepository $repository = null, 294 + ?DifferentialDiff $diff = null) { 295 295 296 296 $base = '/'; 297 297 if ($diff && $diff->getSourceControlPath()) { ··· 550 550 } 551 551 552 552 public function newComparisonChangeset( 553 - DifferentialChangeset $against = null) { 553 + ?DifferentialChangeset $against = null) { 554 554 555 555 $left = $this; 556 556 $right = $against;
+2 -2
src/applications/differential/storage/DifferentialDiff.php
··· 332 332 return $this->assertAttached($this->revision); 333 333 } 334 334 335 - public function attachRevision(DifferentialRevision $revision = null) { 335 + public function attachRevision(?DifferentialRevision $revision = null) { 336 336 $this->revision = $revision; 337 337 return $this; 338 338 } ··· 363 363 return $this->assertAttached($this->properties); 364 364 } 365 365 366 - public function attachBuildable(HarbormasterBuildable $buildable = null) { 366 + public function attachBuildable(?HarbormasterBuildable $buildable = null) { 367 367 $this->buildable = $buildable; 368 368 return $this; 369 369 }
+1 -1
src/applications/differential/storage/DifferentialHunk.php
··· 435 435 private function destroyData( 436 436 $type, 437 437 $data, 438 - PhabricatorDestructionEngine $engine = null) { 438 + ?PhabricatorDestructionEngine $engine = null) { 439 439 440 440 if (!$engine) { 441 441 $engine = new PhabricatorDestructionEngine();
+2 -2
src/applications/differential/storage/DifferentialRevision.php
··· 592 592 return $this->assertAttached($this->repository); 593 593 } 594 594 595 - public function attachRepository(PhabricatorRepository $repository = null) { 595 + public function attachRepository(?PhabricatorRepository $repository = null) { 596 596 $this->repository = $repository; 597 597 return $this; 598 598 } ··· 668 668 669 669 public function attachFlag( 670 670 PhabricatorUser $viewer, 671 - PhabricatorFlag $flag = null) { 671 + ?PhabricatorFlag $flag = null) { 672 672 $this->flags[$viewer->getPHID()] = $flag; 673 673 return $this; 674 674 }
+2 -2
src/applications/differential/storage/DifferentialTransactionComment.php
··· 25 25 } 26 26 27 27 public function attachReplyToComment( 28 - DifferentialTransactionComment $comment = null) { 28 + ?DifferentialTransactionComment $comment = null) { 29 29 $this->replyToComment = $comment; 30 30 return $this; 31 31 } ··· 139 139 } 140 140 141 141 public function attachInlineContext( 142 - PhabricatorInlineCommentContext $context = null) { 142 + ?PhabricatorInlineCommentContext $context = null) { 143 143 $this->inlineContext = $context; 144 144 return $this; 145 145 }
+1 -1
src/applications/diviner/storage/DivinerLiveBook.php
··· 72 72 return idx($spec, 'name', $group); 73 73 } 74 74 75 - public function attachRepository(PhabricatorRepository $repository = null) { 75 + public function attachRepository(?PhabricatorRepository $repository = null) { 76 76 $this->repository = $repository; 77 77 return $this; 78 78 }
+2 -2
src/applications/diviner/storage/DivinerLiveSymbol.php
··· 102 102 return $this->assertAttached($this->repository); 103 103 } 104 104 105 - public function attachRepository(PhabricatorRepository $repository = null) { 105 + public function attachRepository(?PhabricatorRepository $repository = null) { 106 106 $this->repository = $repository; 107 107 return $this; 108 108 } ··· 111 111 return $this->assertAttached($this->atom); 112 112 } 113 113 114 - public function attachAtom(DivinerLiveAtom $atom = null) { 114 + public function attachAtom(?DivinerLiveAtom $atom = null) { 115 115 if ($atom === null) { 116 116 $this->atom = null; 117 117 } else {
+1 -1
src/applications/doorkeeper/bridge/DoorkeeperBridgedObjectInterface.php
··· 3 3 interface DoorkeeperBridgedObjectInterface { 4 4 5 5 public function getBridgedObject(); 6 - public function attachBridgedObject(DoorkeeperExternalObject $object = null); 6 + public function attachBridgedObject(?DoorkeeperExternalObject $object = null); 7 7 8 8 }
+1 -1
src/applications/drydock/storage/DrydockLease.php
··· 139 139 return $this->assertAttached($this->resource); 140 140 } 141 141 142 - public function attachResource(DrydockResource $resource = null) { 142 + public function attachResource(?DrydockResource $resource = null) { 143 143 $this->resource = $resource; 144 144 return $this; 145 145 }
+4 -4
src/applications/drydock/storage/DrydockLog.php
··· 49 49 ) + parent::getConfiguration(); 50 50 } 51 51 52 - public function attachBlueprint(DrydockBlueprint $blueprint = null) { 52 + public function attachBlueprint(?DrydockBlueprint $blueprint = null) { 53 53 $this->blueprint = $blueprint; 54 54 return $this; 55 55 } ··· 58 58 return $this->assertAttached($this->blueprint); 59 59 } 60 60 61 - public function attachResource(DrydockResource $resource = null) { 61 + public function attachResource(?DrydockResource $resource = null) { 62 62 $this->resource = $resource; 63 63 return $this; 64 64 } ··· 67 67 return $this->assertAttached($this->resource); 68 68 } 69 69 70 - public function attachLease(DrydockLease $lease = null) { 70 + public function attachLease(?DrydockLease $lease = null) { 71 71 $this->lease = $lease; 72 72 return $this; 73 73 } ··· 77 77 } 78 78 79 79 public function attachOperation( 80 - DrydockRepositoryOperation $operation = null) { 80 + ?DrydockRepositoryOperation $operation = null) { 81 81 $this->operation = $operation; 82 82 return $this; 83 83 }
+1 -1
src/applications/files/storage/PhabricatorFile.php
··· 1314 1314 return $this->assertAttached($this->originalFile); 1315 1315 } 1316 1316 1317 - public function attachOriginalFile(PhabricatorFile $file = null) { 1317 + public function attachOriginalFile(?PhabricatorFile $file = null) { 1318 1318 $this->originalFile = $file; 1319 1319 return $this; 1320 1320 }
+1 -1
src/applications/files/storage/PhabricatorFileAttachment.php
··· 71 71 return $this->assertAttached($this->object); 72 72 } 73 73 74 - public function attachFile(PhabricatorFile $file = null) { 74 + public function attachFile(?PhabricatorFile $file = null) { 75 75 $this->file = $file; 76 76 return $this; 77 77 }
+1 -1
src/applications/files/storage/PhabricatorFileChunk.php
··· 44 44 ->setByteEnd($end); 45 45 } 46 46 47 - public function attachDataFile(PhabricatorFile $file = null) { 47 + public function attachDataFile(?PhabricatorFile $file = null) { 48 48 $this->dataFile = $file; 49 49 return $this; 50 50 }
+1 -1
src/applications/fund/storage/FundBacker.php
··· 64 64 return $this->assertAttached($this->initiative); 65 65 } 66 66 67 - public function attachInitiative(FundInitiative $initiative = null) { 67 + public function attachInitiative(?FundInitiative $initiative = null) { 68 68 $this->initiative = $initiative; 69 69 return $this; 70 70 }
+1 -1
src/applications/harbormaster/storage/build/HarbormasterBuild.php
··· 90 90 } 91 91 92 92 public function attachBuildPlan( 93 - HarbormasterBuildPlan $build_plan = null) { 93 + ?HarbormasterBuildPlan $build_plan = null) { 94 94 $this->buildPlan = $build_plan; 95 95 return $this; 96 96 }
+1 -1
src/applications/harbormaster/storage/build/HarbormasterBuildLog.php
··· 715 715 $this->delete(); 716 716 } 717 717 718 - public function destroyFile(PhabricatorDestructionEngine $engine = null) { 718 + public function destroyFile(?PhabricatorDestructionEngine $engine = null) { 719 719 if (!$engine) { 720 720 $engine = new PhabricatorDestructionEngine(); 721 721 }
+1 -1
src/applications/harbormaster/storage/build/HarbormasterBuildTarget.php
··· 146 146 return $this->assertAttached($this->build); 147 147 } 148 148 149 - public function attachBuildStep(HarbormasterBuildStep $step = null) { 149 + public function attachBuildStep(?HarbormasterBuildStep $step = null) { 150 150 $this->buildStep = $step; 151 151 return $this; 152 152 }
+1 -1
src/applications/legalpad/storage/LegalpadDocument.php
··· 131 131 132 132 public function attachUserSignature( 133 133 $user_phid, 134 - LegalpadDocumentSignature $signature = null) { 134 + ?LegalpadDocumentSignature $signature = null) { 135 135 $this->userSignatures[$user_phid] = $signature; 136 136 return $this; 137 137 }
+1 -1
src/applications/macro/storage/PhabricatorFileImageMacro.php
··· 32 32 return $this->assertAttached($this->file); 33 33 } 34 34 35 - public function attachAudio(PhabricatorFile $audio = null) { 35 + public function attachAudio(?PhabricatorFile $audio = null) { 36 36 $this->audio = $audio; 37 37 return $this; 38 38 }
+1 -1
src/applications/maniphest/storage/ManiphestTask.php
··· 539 539 } 540 540 541 541 public function attachBridgedObject( 542 - DoorkeeperExternalObject $object = null) { 542 + ?DoorkeeperExternalObject $object = null) { 543 543 $this->bridgedObject = $object; 544 544 return $this; 545 545 }
+1 -1
src/applications/metamta/storage/PhabricatorMetaMTAReceivedMail.php
··· 444 444 445 445 private function sendExceptionMail( 446 446 Exception $ex, 447 - PhabricatorUser $viewer = null) { 447 + ?PhabricatorUser $viewer = null) { 448 448 449 449 // If we've failed to identify a legitimate sender, we don't send them 450 450 // an error message back. We want to avoid sending mail to unverified
+1 -1
src/applications/nuance/storage/NuanceItem.php
··· 180 180 return $this->assertAttached($this->queue); 181 181 } 182 182 183 - public function attachQueue(NuanceQueue $queue = null) { 183 + public function attachQueue(?NuanceQueue $queue = null) { 184 184 $this->queue = $queue; 185 185 return $this; 186 186 }
+1 -1
src/applications/passphrase/storage/PassphraseCredential.php
··· 91 91 PassphraseCredentialPHIDType::TYPECONST); 92 92 } 93 93 94 - public function attachSecret(PhutilOpaqueEnvelope $secret = null) { 94 + public function attachSecret(?PhutilOpaqueEnvelope $secret = null) { 95 95 $this->secret = $secret; 96 96 return $this; 97 97 }
+1 -1
src/applications/people/storage/PhabricatorUserLog.php
··· 13 13 protected $session; 14 14 15 15 public static function initializeNewLog( 16 - PhabricatorUser $actor = null, 16 + ?PhabricatorUser $actor = null, 17 17 $object_phid = null, 18 18 $action = null) { 19 19
+1 -1
src/applications/phortune/storage/PhortuneCart.php
··· 106 106 public function willApplyCharge( 107 107 PhabricatorUser $actor, 108 108 PhortunePaymentProvider $provider, 109 - PhortunePaymentMethod $method = null) { 109 + ?PhortunePaymentMethod $method = null) { 110 110 111 111 $account = $this->getAccount(); 112 112
+1 -1
src/applications/phortune/storage/PhortuneCharge.php
··· 137 137 return $this->assertAttached($this->cart); 138 138 } 139 139 140 - public function attachCart(PhortuneCart $cart = null) { 140 + public function attachCart(?PhortuneCart $cart = null) { 141 141 $this->cart = $cart; 142 142 return $this; 143 143 }
+1 -1
src/applications/policy/storage/PhabricatorPolicy.php
··· 47 47 48 48 public static function newFromPolicyAndHandle( 49 49 $policy_identifier, 50 - PhabricatorObjectHandle $handle = null) { 50 + ?PhabricatorObjectHandle $handle = null) { 51 51 52 52 $is_global = PhabricatorPolicyQuery::isGlobalPolicy($policy_identifier); 53 53 if ($is_global) {
+1 -1
src/applications/ponder/storage/PonderAnswer.php
··· 40 40 41 41 } 42 42 43 - public function attachQuestion(PonderQuestion $question = null) { 43 + public function attachQuestion(?PonderQuestion $question = null) { 44 44 $this->question = $question; 45 45 return $this; 46 46 }
+2 -2
src/applications/project/storage/PhabricatorProject.php
··· 67 67 68 68 public static function initializeNewProject( 69 69 PhabricatorUser $actor, 70 - PhabricatorProject $parent = null) { 70 + ?PhabricatorProject $parent = null) { 71 71 72 72 $app = id(new PhabricatorApplicationQuery()) 73 73 ->setViewer(PhabricatorUser::getOmnipotentUser()) ··· 498 498 return $this->assertAttached($this->parentProject); 499 499 } 500 500 501 - public function attachParentProject(PhabricatorProject $project = null) { 501 + public function attachParentProject(?PhabricatorProject $project = null) { 502 502 $this->parentProject = $project; 503 503 return $this; 504 504 }
+1 -1
src/applications/project/storage/PhabricatorProjectColumn.php
··· 186 186 return sprintf('%s%012d', $group, $sequence); 187 187 } 188 188 189 - public function attachTrigger(PhabricatorProjectTrigger $trigger = null) { 189 + public function attachTrigger(?PhabricatorProjectTrigger $trigger = null) { 190 190 $this->trigger = $trigger; 191 191 return $this; 192 192 }
+1 -1
src/applications/repository/storage/PhabricatorRepository.php
··· 250 250 } 251 251 252 252 public function attachMostRecentCommit( 253 - PhabricatorRepositoryCommit $commit = null) { 253 + ?PhabricatorRepositoryCommit $commit = null) { 254 254 $this->mostRecentCommit = $commit; 255 255 return $this; 256 256 }
+3 -3
src/applications/repository/storage/PhabricatorRepositoryCommit.php
··· 169 169 } 170 170 171 171 public function attachCommitData( 172 - PhabricatorRepositoryCommitData $data = null) { 172 + ?PhabricatorRepositoryCommitData $data = null) { 173 173 $this->commitData = $data; 174 174 return $this; 175 175 } ··· 198 198 } 199 199 200 200 public function attachIdentities( 201 - PhabricatorRepositoryIdentity $author = null, 202 - PhabricatorRepositoryIdentity $committer = null) { 201 + ?PhabricatorRepositoryIdentity $author = null, 202 + ?PhabricatorRepositoryIdentity $committer = null) { 203 203 204 204 $this->authorIdentity = $author; 205 205 $this->committerIdentity = $committer;
+1 -1
src/applications/repository/storage/PhabricatorRepositoryPullEvent.php
··· 59 59 PhabricatorRepositoryPullEventPHIDType::TYPECONST); 60 60 } 61 61 62 - public function attachRepository(PhabricatorRepository $repository = null) { 62 + public function attachRepository(?PhabricatorRepository $repository = null) { 63 63 $this->repository = $repository; 64 64 return $this; 65 65 }
+1 -1
src/applications/settings/storage/PhabricatorUserPreferences.php
··· 93 93 return $this; 94 94 } 95 95 96 - public function attachUser(PhabricatorUser $user = null) { 96 + public function attachUser(?PhabricatorUser $user = null) { 97 97 $this->user = $user; 98 98 return $this; 99 99 }
+1 -1
src/infrastructure/daemon/workers/storage/PhabricatorWorkerTrigger.php
··· 96 96 return $this->assertAttached($this->event); 97 97 } 98 98 99 - public function attachEvent(PhabricatorWorkerTriggerEvent $event = null) { 99 + public function attachEvent(?PhabricatorWorkerTriggerEvent $event = null) { 100 100 $this->event = $event; 101 101 return $this; 102 102 }
+1 -1
src/infrastructure/storage/lisk/PhabricatorLiskDAO.php
··· 159 159 $database)); 160 160 } 161 161 162 - private function raiseUnreachable($database, Exception $proxy = null) { 162 + private function raiseUnreachable($database, ?Exception $proxy = null) { 163 163 $message = pht( 164 164 'Unable to establish a connection to any database host '. 165 165 '(while trying "%s"). All masters and replicas are completely '.