From 231e01d252deff3e589dc4b850dc92ed0c890b38 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=B4me=20Chilliet?= Date: Mon, 10 Nov 2025 09:49:47 +0100 Subject: [PATCH] chore: Improve typing and codestyle in LoginData MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Côme Chilliet --- .../Authentication/Login/LoginData.php | 44 +++++-------------- 1 file changed, 11 insertions(+), 33 deletions(-) diff --git a/lib/private/Authentication/Login/LoginData.php b/lib/private/Authentication/Login/LoginData.php index 1ad97a9d559..2567da9b340 100644 --- a/lib/private/Authentication/Login/LoginData.php +++ b/lib/private/Authentication/Login/LoginData.php @@ -6,48 +6,26 @@ declare(strict_types=1); * SPDX-FileCopyrightText: 2019 Nextcloud GmbH and Nextcloud contributors * SPDX-License-Identifier: AGPL-3.0-or-later */ + namespace OC\Authentication\Login; use OCP\IRequest; use OCP\IUser; class LoginData { - /** @var IRequest */ - private $request; - - /** @var string */ - private $username; - - /** @var string */ - private $password; - - /** @var string */ - private $redirectUrl; - - /** @var string */ - private $timeZone; - - /** @var string */ - private $timeZoneOffset; - /** @var IUser|false|null */ private $user = null; - /** @var bool */ - private $rememberLogin = true; + private bool $rememberLogin = true; - public function __construct(IRequest $request, - string $username, - ?string $password, - ?string $redirectUrl = null, - string $timeZone = '', - string $timeZoneOffset = '') { - $this->request = $request; - $this->username = $username; - $this->password = $password; - $this->redirectUrl = $redirectUrl; - $this->timeZone = $timeZone; - $this->timeZoneOffset = $timeZoneOffset; + public function __construct( + private IRequest $request, + private string $username, + private ?string $password, + private ?string $redirectUrl = null, + private string $timeZone = '', + private string $timeZoneOffset = '', + ) { } public function getRequest(): IRequest { @@ -81,7 +59,7 @@ class LoginData { /** * @param IUser|false|null $user */ - public function setUser($user) { + public function setUser($user): void { $this->user = $user; }