From 4d5b8d2767405db59fbf0ff9bbf5679e7bedcfe9 Mon Sep 17 00:00:00 2001 From: Hamid Dehnavi Date: Sat, 8 Jul 2023 20:32:43 +0330 Subject: Refactor dashboard app Signed-off-by: Hamid Dehnavi --- .../lib/Controller/DashboardApiController.php | 17 +++------------ .../lib/Controller/DashboardController.php | 25 +++++----------------- .../lib/Controller/LayoutApiController.php | 10 ++------- 3 files changed, 10 insertions(+), 42 deletions(-) diff --git a/apps/dashboard/lib/Controller/DashboardApiController.php b/apps/dashboard/lib/Controller/DashboardApiController.php index 1062cf1bdba..a3497915a25 100644 --- a/apps/dashboard/lib/Controller/DashboardApiController.php +++ b/apps/dashboard/lib/Controller/DashboardApiController.php @@ -43,25 +43,14 @@ use OCP\Dashboard\Model\WidgetItem; class DashboardApiController extends OCSController { - /** @var IManager */ - private $dashboardManager; - /** @var IConfig */ - private $config; - /** @var string|null */ - private $userId; - public function __construct( string $appName, IRequest $request, - IManager $dashboardManager, - IConfig $config, - ?string $userId + private IManager $dashboardManager, + private IConfig $config, + private ?string $userId ) { parent::__construct($appName, $request); - - $this->dashboardManager = $dashboardManager; - $this->config = $config; - $this->userId = $userId; } /** diff --git a/apps/dashboard/lib/Controller/DashboardController.php b/apps/dashboard/lib/Controller/DashboardController.php index b0e150e00f7..b6a882af437 100644 --- a/apps/dashboard/lib/Controller/DashboardController.php +++ b/apps/dashboard/lib/Controller/DashboardController.php @@ -44,32 +44,17 @@ use OCP\IRequest; class DashboardController extends Controller { - /** @var IInitialState */ - private $initialState; - /** @var IEventDispatcher */ - private $eventDispatcher; - /** @var IManager */ - private $dashboardManager; - /** @var IConfig */ - private $config; - /** @var string */ - private $userId; - public function __construct( string $appName, IRequest $request, - IInitialState $initialState, - IEventDispatcher $eventDispatcher, - IManager $dashboardManager, - IConfig $config, - $userId + private IInitialState $initialState, + private IEventDispatcher $eventDispatcher, + private IManager $dashboardManager, + private IConfig $config, + private string $userId, ) { parent::__construct($appName, $request); - $this->initialState = $initialState; - $this->eventDispatcher = $eventDispatcher; - $this->dashboardManager = $dashboardManager; - $this->config = $config; $this->userId = $userId; } diff --git a/apps/dashboard/lib/Controller/LayoutApiController.php b/apps/dashboard/lib/Controller/LayoutApiController.php index 8eb01be497e..fd8c95e0d13 100644 --- a/apps/dashboard/lib/Controller/LayoutApiController.php +++ b/apps/dashboard/lib/Controller/LayoutApiController.php @@ -31,21 +31,15 @@ use OCP\IConfig; use OCP\IRequest; class LayoutApiController extends OCSController { - /** @var IConfig */ - private $config; - /** @var string */ - private $userId; public function __construct( string $appName, IRequest $request, - IConfig $config, - $userId + private IConfig $config, + private string $userId ) { parent::__construct($appName, $request); - $this->config = $config; - $this->userId = $userId; } /** -- cgit v1.2.3 From 3aaab5b92b44ddf029a47a05d6ece04bb77decb2 Mon Sep 17 00:00:00 2001 From: Hamid Dehnavi Date: Fri, 14 Jul 2023 17:46:48 +0330 Subject: Make adjustments based on the review Co-authored-by: Joas Schilling Signed-off-by: Hamid Dehnavi --- apps/dashboard/lib/Controller/DashboardController.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/dashboard/lib/Controller/DashboardController.php b/apps/dashboard/lib/Controller/DashboardController.php index b6a882af437..adbef320a5a 100644 --- a/apps/dashboard/lib/Controller/DashboardController.php +++ b/apps/dashboard/lib/Controller/DashboardController.php @@ -51,7 +51,7 @@ class DashboardController extends Controller { private IEventDispatcher $eventDispatcher, private IManager $dashboardManager, private IConfig $config, - private string $userId, + private ?string $userId, ) { parent::__construct($appName, $request); -- cgit v1.2.3 From 1f6a121ab08f4d37f41fc2a356e2194d2482647d Mon Sep 17 00:00:00 2001 From: Hamid Dehnavi Date: Sun, 16 Jul 2023 15:52:51 +0330 Subject: Make adjustments based on the review Co-authored-by: Joas Schilling Signed-off-by: Hamid Dehnavi --- apps/dashboard/lib/Controller/DashboardApiController.php | 2 +- apps/dashboard/lib/Controller/LayoutApiController.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/apps/dashboard/lib/Controller/DashboardApiController.php b/apps/dashboard/lib/Controller/DashboardApiController.php index a3497915a25..8e0576453f2 100644 --- a/apps/dashboard/lib/Controller/DashboardApiController.php +++ b/apps/dashboard/lib/Controller/DashboardApiController.php @@ -48,7 +48,7 @@ class DashboardApiController extends OCSController { IRequest $request, private IManager $dashboardManager, private IConfig $config, - private ?string $userId + private ?string $userId, ) { parent::__construct($appName, $request); } diff --git a/apps/dashboard/lib/Controller/LayoutApiController.php b/apps/dashboard/lib/Controller/LayoutApiController.php index fd8c95e0d13..e603997a854 100644 --- a/apps/dashboard/lib/Controller/LayoutApiController.php +++ b/apps/dashboard/lib/Controller/LayoutApiController.php @@ -36,7 +36,7 @@ class LayoutApiController extends OCSController { string $appName, IRequest $request, private IConfig $config, - private string $userId + private ?string $userId, ) { parent::__construct($appName, $request); -- cgit v1.2.3