Fix phpstorm inspection issues
Signed-off-by: Julius Härtl <jus@bitgrid.net>
This commit is contained in:
committed by
Julius Härtl
parent
320f2bf5c8
commit
c45bb71084
@@ -108,10 +108,9 @@ class BoardService {
|
||||
|
||||
public function isArchived($mapper, $id) {
|
||||
try {
|
||||
$boardId = $id;
|
||||
if ($mapper instanceof IPermissionMapper) {
|
||||
$boardId = $mapper->findBoardId($id);
|
||||
} else {
|
||||
$boardId = $id;
|
||||
}
|
||||
if ($boardId === null) {
|
||||
return false;
|
||||
@@ -125,10 +124,9 @@ class BoardService {
|
||||
|
||||
public function isDeleted($mapper, $id) {
|
||||
try {
|
||||
$boardId = $id;
|
||||
if ($mapper instanceof IPermissionMapper) {
|
||||
$boardId = $mapper->findBoardId($id);
|
||||
} else {
|
||||
$boardId = $id;
|
||||
}
|
||||
if ($boardId === null) {
|
||||
return false;
|
||||
@@ -189,7 +187,7 @@ class BoardService {
|
||||
$this->permissionService->checkPermission($this->boardMapper, $id, Acl::PERMISSION_READ);
|
||||
$board = $this->find($id);
|
||||
$board->setDeletedAt(0);
|
||||
$this->boardMapper->update($board);
|
||||
return $this->boardMapper->update($board);
|
||||
}
|
||||
|
||||
public function deleteForce($id) {
|
||||
|
||||
@@ -46,8 +46,7 @@ class CardService {
|
||||
|
||||
public function find($cardId) {
|
||||
$this->permissionService->checkPermission($this->cardMapper, $cardId, Acl::PERMISSION_READ);
|
||||
$card = $this->cardMapper->find($cardId);
|
||||
return $card;
|
||||
return $this->cardMapper->find($cardId);
|
||||
}
|
||||
|
||||
public function create($title, $stackId, $type, $order, $owner) {
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user