Fix phpstorm inspection issues

Signed-off-by: Julius Härtl <jus@bitgrid.net>
This commit is contained in:
Julius Härtl
2017-10-17 00:41:53 +02:00
committed by Julius Härtl
parent 320f2bf5c8
commit c45bb71084
25 changed files with 77 additions and 93 deletions

View File

@@ -115,10 +115,9 @@ class PermissionService {
*/
public function checkPermission($mapper, $id, $permission) {
try {
$boardId = $id;
if ($mapper instanceof IPermissionMapper) {
$boardId = $mapper->findBoardId($id);
} else {
$boardId = $id;
}
if ($boardId === null) {
// Throw NoPermission to not leak information about existing entries
@@ -146,13 +145,11 @@ class PermissionService {
/**
* @param $boardId
* @return bool
* @throws \OCP\AppFramework\Db\DoesNotExistException
*/
public function userIsBoardOwner($boardId) {
$board = $this->boardMapper->find($boardId);
if ($board && $this->userId === $board->getOwner()) {
return true;
}
return false;
return $board && $this->userId === $board->getOwner();
}
/**