From 351f65884384431a0492d3aa3a06eec94f713085 Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Thu, 5 Jan 2023 06:43:58 +0100 Subject: refactor(breakout): Use PHP8 constructor promotion Signed-off-by: Joas Schilling --- lib/Controller/BreakoutRoomController.php | 11 +++++----- lib/Service/BreakoutRoomService.php | 35 +++++++++---------------------- 2 files changed, 15 insertions(+), 31 deletions(-) diff --git a/lib/Controller/BreakoutRoomController.php b/lib/Controller/BreakoutRoomController.php index 1e322fb16..161ec1aff 100644 --- a/lib/Controller/BreakoutRoomController.php +++ b/lib/Controller/BreakoutRoomController.php @@ -33,13 +33,12 @@ use OCP\Comments\MessageTooLongException; use OCP\IRequest; class BreakoutRoomController extends AEnvironmentAwareController { - protected BreakoutRoomService $breakoutRoomService; - - public function __construct(string $appName, - IRequest $request, - BreakoutRoomService $breakoutRoomService) { + public function __construct( + string $appName, + IRequest $request, + protected BreakoutRoomService $breakoutRoomService, + ) { parent::__construct($appName, $request); - $this->breakoutRoomService = $breakoutRoomService; } /** diff --git a/lib/Service/BreakoutRoomService.php b/lib/Service/BreakoutRoomService.php index ebcb7a9a5..e3400f74d 100644 --- a/lib/Service/BreakoutRoomService.php +++ b/lib/Service/BreakoutRoomService.php @@ -40,31 +40,16 @@ use OCP\Notification\IManager as INotificationManager; use OCP\IL10N; class BreakoutRoomService { - protected Config $config; - protected Manager $manager; - protected RoomService $roomService; - protected ParticipantService $participantService; - protected ChatManager $chatManager; - protected INotificationManager $notificationManager; - protected IEventDispatcher $dispatcher; - protected IL10N $l; - - public function __construct(Config $config, - Manager $manager, - RoomService $roomService, - ParticipantService $participantService, - ChatManager $chatManager, - INotificationManager $notificationManager, - IEventDispatcher $dispatcher, - IL10N $l) { - $this->config = $config; - $this->manager = $manager; - $this->roomService = $roomService; - $this->participantService = $participantService; - $this->chatManager = $chatManager; - $this->notificationManager = $notificationManager; - $this->dispatcher = $dispatcher; - $this->l = $l; + public function __construct( + protected Config $config, + protected Manager $manager, + protected RoomService $roomService, + protected ParticipantService $participantService, + protected ChatManager $chatManager, + protected INotificationManager $notificationManager, + protected IEventDispatcher $dispatcher, + protected IL10N $l, + ) { } /** -- cgit v1.2.3