From 381077028adf388a7081cf42026570c6be47b198 Mon Sep 17 00:00:00 2001 From: provokateurin Date: Fri, 18 Oct 2024 12:04:22 +0200 Subject: refactor(apps): Use constructor property promotion when possible Signed-off-by: provokateurin --- .../lib/Controller/AjaxController.php | 25 ++++++---------------- .../lib/Controller/ApiController.php | 9 ++------ 2 files changed, 9 insertions(+), 25 deletions(-) (limited to 'apps/files_external/lib/Controller') diff --git a/apps/files_external/lib/Controller/AjaxController.php b/apps/files_external/lib/Controller/AjaxController.php index dab7e092f00..dfc5947ed77 100644 --- a/apps/files_external/lib/Controller/AjaxController.php +++ b/apps/files_external/lib/Controller/AjaxController.php @@ -16,15 +16,6 @@ use OCP\IRequest; use OCP\IUserSession; class AjaxController extends Controller { - /** @var RSA */ - private $rsaMechanism; - /** @var GlobalAuth */ - private $globalAuth; - /** @var IUserSession */ - private $userSession; - /** @var IGroupManager */ - private $groupManager; - /** * @param string $appName * @param IRequest $request @@ -33,17 +24,15 @@ class AjaxController extends Controller { * @param IUserSession $userSession * @param IGroupManager $groupManager */ - public function __construct($appName, + public function __construct( + $appName, IRequest $request, - RSA $rsaMechanism, - GlobalAuth $globalAuth, - IUserSession $userSession, - IGroupManager $groupManager) { + private RSA $rsaMechanism, + private GlobalAuth $globalAuth, + private IUserSession $userSession, + private IGroupManager $groupManager, + ) { parent::__construct($appName, $request); - $this->rsaMechanism = $rsaMechanism; - $this->globalAuth = $globalAuth; - $this->userSession = $userSession; - $this->groupManager = $groupManager; } /** diff --git a/apps/files_external/lib/Controller/ApiController.php b/apps/files_external/lib/Controller/ApiController.php index cb8d8cbb0ff..5a7eddf1540 100644 --- a/apps/files_external/lib/Controller/ApiController.php +++ b/apps/files_external/lib/Controller/ApiController.php @@ -25,18 +25,13 @@ use OCP\IRequest; */ class ApiController extends OCSController { - private UserGlobalStoragesService $userGlobalStoragesService; - private UserStoragesService $userStoragesService; - public function __construct( string $appName, IRequest $request, - UserGlobalStoragesService $userGlobalStorageService, - UserStoragesService $userStorageService, + private UserGlobalStoragesService $userGlobalStoragesService, + private UserStoragesService $userStoragesService, ) { parent::__construct($appName, $request); - $this->userGlobalStoragesService = $userGlobalStorageService; - $this->userStoragesService = $userStorageService; } /** -- cgit v1.2.3