From f3d49f740737d31dd940c62d8cff10c675169aea Mon Sep 17 00:00:00 2001 From: Andre Klapper Date: Sat, 31 Aug 2024 14:42:02 +0200 Subject: [PATCH] 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. This patch is a followup on top of D25814. Refs T15935 Test Plan: * Try to view a task in the browser * Try to run `./bin/auth recover` on the CLI * Try to browse projects in the browser * Try to create a new project without a name in the browser 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/D25816 --- .../auth/engine/PhabricatorAuthSessionEngine.php | 8 ++++---- .../project/controller/PhabricatorProjectController.php | 2 +- .../search/engine/PhabricatorProfileMenuItemViewList.php | 2 +- .../editor/PhabricatorApplicationTransactionEditor.php | 4 ++-- .../PhabricatorApplicationTransactionValidationError.php | 2 +- src/view/page/menu/PhabricatorMainMenuSearchView.php | 2 +- 6 files changed, 10 insertions(+), 10 deletions(-) diff --git a/src/applications/auth/engine/PhabricatorAuthSessionEngine.php b/src/applications/auth/engine/PhabricatorAuthSessionEngine.php index 2074e71f8b..e40b721634 100644 --- a/src/applications/auth/engine/PhabricatorAuthSessionEngine.php +++ b/src/applications/auth/engine/PhabricatorAuthSessionEngine.php @@ -334,7 +334,7 @@ final class PhabricatorAuthSessionEngine extends Phobject { */ public function terminateLoginSessions( PhabricatorUser $user, - PhutilOpaqueEnvelope $except_session = null) { + ?PhutilOpaqueEnvelope $except_session = null) { $sessions = id(new PhabricatorAuthSessionQuery()) ->setViewer($user) @@ -955,7 +955,7 @@ final class PhabricatorAuthSessionEngine extends Phobject { */ public function getOneTimeLoginURI( PhabricatorUser $user, - PhabricatorUserEmail $email = null, + ?PhabricatorUserEmail $email = null, $type = self::ONETIME_RESET, $force_full_session = false) { @@ -1003,7 +1003,7 @@ final class PhabricatorAuthSessionEngine extends Phobject { */ public function loadOneTimeLoginKey( PhabricatorUser $user, - PhabricatorUserEmail $email = null, + ?PhabricatorUserEmail $email = null, $key = null) { $key_hash = $this->getOneTimeLoginKeyHash($user, $email, $key); @@ -1031,7 +1031,7 @@ final class PhabricatorAuthSessionEngine extends Phobject { */ private function getOneTimeLoginKeyHash( PhabricatorUser $user, - PhabricatorUserEmail $email = null, + ?PhabricatorUserEmail $email = null, $key = null) { $parts = array( diff --git a/src/applications/project/controller/PhabricatorProjectController.php b/src/applications/project/controller/PhabricatorProjectController.php index 14b4aa151e..998cbac613 100644 --- a/src/applications/project/controller/PhabricatorProjectController.php +++ b/src/applications/project/controller/PhabricatorProjectController.php @@ -170,7 +170,7 @@ abstract class PhabricatorProjectController extends PhabricatorController { protected function newCardResponse( $board_phid, $object_phid, - PhabricatorProjectColumnOrder $ordering = null, + ?PhabricatorProjectColumnOrder $ordering = null, $sounds = array()) { $viewer = $this->getViewer(); diff --git a/src/applications/search/engine/PhabricatorProfileMenuItemViewList.php b/src/applications/search/engine/PhabricatorProfileMenuItemViewList.php index e5a3fd3d38..8cae5e6676 100644 --- a/src/applications/search/engine/PhabricatorProfileMenuItemViewList.php +++ b/src/applications/search/engine/PhabricatorProfileMenuItemViewList.php @@ -171,7 +171,7 @@ final class PhabricatorProfileMenuItemViewList private function getHighlightedItemKey( array $items, - PHUIListItemView $selected_item = null) { + ?PHUIListItemView $selected_item = null) { assert_instances_of($items, 'PHUIListItemView'); diff --git a/src/applications/transactions/editor/PhabricatorApplicationTransactionEditor.php b/src/applications/transactions/editor/PhabricatorApplicationTransactionEditor.php index d5fd81a65b..9bc00823d8 100644 --- a/src/applications/transactions/editor/PhabricatorApplicationTransactionEditor.php +++ b/src/applications/transactions/editor/PhabricatorApplicationTransactionEditor.php @@ -5026,7 +5026,7 @@ abstract class PhabricatorApplicationTransactionEditor } final protected function newSubEditor( - PhabricatorApplicationTransactionEditor $template = null) { + ?PhabricatorApplicationTransactionEditor $template = null) { $editor = $this->newEditorCopy($template); $editor->parentEditor = $this; @@ -5036,7 +5036,7 @@ abstract class PhabricatorApplicationTransactionEditor } private function newEditorCopy( - PhabricatorApplicationTransactionEditor $template = null) { + ?PhabricatorApplicationTransactionEditor $template = null) { if ($template === null) { $template = newv(get_class($this), array()); } diff --git a/src/applications/transactions/error/PhabricatorApplicationTransactionValidationError.php b/src/applications/transactions/error/PhabricatorApplicationTransactionValidationError.php index a01113483f..b769e2b6e7 100644 --- a/src/applications/transactions/error/PhabricatorApplicationTransactionValidationError.php +++ b/src/applications/transactions/error/PhabricatorApplicationTransactionValidationError.php @@ -13,7 +13,7 @@ final class PhabricatorApplicationTransactionValidationError $type, $short_message, $message, - PhabricatorApplicationTransaction $xaction = null) { + ?PhabricatorApplicationTransaction $xaction = null) { $this->type = $type; $this->shortMessage = $short_message; diff --git a/src/view/page/menu/PhabricatorMainMenuSearchView.php b/src/view/page/menu/PhabricatorMainMenuSearchView.php index e038eec6c8..a54f4a1667 100644 --- a/src/view/page/menu/PhabricatorMainMenuSearchView.php +++ b/src/view/page/menu/PhabricatorMainMenuSearchView.php @@ -118,7 +118,7 @@ final class PhabricatorMainMenuSearchView extends AphrontView { public static function getGlobalSearchScopeItems( PhabricatorUser $viewer, - PhabricatorApplication $application = null, + ?PhabricatorApplication $application = null, $global_only = false) { $items = array();