From e47c4c26eb3d002982b55531db8ced0baf33f29b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julius=20H=C3=A4rtl?= Date: Thu, 12 Jul 2018 15:24:53 +0200 Subject: [PATCH] Move DI of IUserManager, IGroupManager, userId to the BoardService MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Julius Härtl --- lib/Controller/BoardController.php | 6 +----- lib/Service/BoardService.php | 13 ++++++++++++- 2 files changed, 13 insertions(+), 6 deletions(-) diff --git a/lib/Controller/BoardController.php b/lib/Controller/BoardController.php index 1d9eb28f7..6cb65ff01 100644 --- a/lib/Controller/BoardController.php +++ b/lib/Controller/BoardController.php @@ -35,15 +35,11 @@ class BoardController extends ApiController { private $userId; private $boardService; - private $userManager; - private $groupManager; private $permissionService; - public function __construct($appName, IRequest $request, IUserManager $userManager, IGroupManager $groupManager, BoardService $boardService, PermissionService $permissionService, $userId) { + public function __construct($appName, IRequest $request, BoardService $boardService, PermissionService $permissionService, $userId) { parent::__construct($appName, $request); $this->userId = $userId; - $this->userManager = $userManager; - $this->groupManager = $groupManager; $this->boardService = $boardService; $this->permissionService = $permissionService; } diff --git a/lib/Service/BoardService.php b/lib/Service/BoardService.php index 28fc7e4aa..2a38e1462 100644 --- a/lib/Service/BoardService.php +++ b/lib/Service/BoardService.php @@ -30,10 +30,12 @@ use OCA\Deck\Db\Label; use OCA\Deck\Notification\NotificationHelper; use OCP\AppFramework\Db\DoesNotExistException; +use OCP\IGroupManager; use OCP\IL10N; use OCA\Deck\Db\Board; use OCA\Deck\Db\BoardMapper; use OCA\Deck\Db\LabelMapper; +use OCP\IUserManager; class BoardService { @@ -45,6 +47,9 @@ class BoardService { private $permissionService; private $notificationHelper; private $assignedUsersMapper; + private $userManager; + private $groupManager; + private $userId; public function __construct( BoardMapper $boardMapper, @@ -53,7 +58,10 @@ public function __construct( AclMapper $aclMapper, PermissionService $permissionService, NotificationHelper $notificationHelper, - AssignedUsersMapper $assignedUsersMapper + AssignedUsersMapper $assignedUsersMapper, + IUserManager $userManager, + IGroupManager $groupManager, + $userId ) { $this->boardMapper = $boardMapper; $this->labelMapper = $labelMapper; @@ -62,6 +70,9 @@ public function __construct( $this->permissionService = $permissionService; $this->notificationHelper = $notificationHelper; $this->assignedUsersMapper = $assignedUsersMapper; + $this->userManager = $userManager; + $this->groupManager = $groupManager; + $this->userId = $userId; } public function findAll() {