Skip to content

Commit

Permalink
Move DI of IUserManager, IGroupManager, userId to the BoardService
Browse files Browse the repository at this point in the history
Signed-off-by: Julius Härtl <[email protected]>
  • Loading branch information
juliusknorr committed Jul 12, 2018
1 parent 4c774f4 commit e47c4c2
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 6 deletions.
6 changes: 1 addition & 5 deletions lib/Controller/BoardController.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
13 changes: 12 additions & 1 deletion lib/Service/BoardService.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -45,6 +47,9 @@ class BoardService {
private $permissionService;
private $notificationHelper;
private $assignedUsersMapper;
private $userManager;
private $groupManager;
private $userId;

public function __construct(
BoardMapper $boardMapper,
Expand All @@ -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;
Expand All @@ -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() {
Expand Down

0 comments on commit e47c4c2

Please sign in to comment.