Code cleaup

Signed-off-by: Julius Härtl <jus@bitgrid.net>
This commit is contained in:
Julius Haertl
2017-02-28 14:52:15 +01:00
committed by Julius Härtl
parent 2b05227f4b
commit 1e9c86e158
7 changed files with 58 additions and 39 deletions

View File

@@ -91,12 +91,12 @@ class BoardService {
private function mapAcl(Acl &$acl) {
$userManager = $this->userManager;
$groupManager = $this->groupManager;
$acl->resolveRelation('participant', function($value) use (&$acl, &$userManager, &$groupManager) {
$acl->resolveRelation('participant', function($participant) use (&$acl, &$userManager, &$groupManager) {
if($acl->getType() === Acl::PERMISSION_TYPE_USER) {
return new User($userManager->get($acl->getParticipant($value)));
return new User($userManager->get($acl->getParticipant($participant)));
}
if($acl->getType() === Acl::PERMISSION_TYPE_GROUP) {
return new Group($groupManager->get($acl->getParticipant($value)));
return new Group($groupManager->get($acl->getParticipant($participant)));
}
});
return $acl;
@@ -104,8 +104,8 @@ class BoardService {
private function mapOwner(Board $board) {
$userManager = $this->userManager;
$board->resolveRelation('owner', function($value) use (&$userManager) {
return new User($userManager->get($value));
$board->resolveRelation('owner', function($owner) use (&$userManager) {
return new User($userManager->get($owner));
});
return $board;
}