@@ -94,7 +94,7 @@ discard block |
||
| 94 | 94 | |
| 95 | 95 | $boardLabels = $this->labelMapper->findAll($boardId); |
| 96 | 96 | if (\is_array($boardLabels)) { |
| 97 | - foreach($boardLabels as $boardLabel) { |
|
| 97 | + foreach ($boardLabels as $boardLabel) { |
|
| 98 | 98 | if ($boardLabel->getTitle() === $title) { |
| 99 | 99 | throw new BadRequestException('title must be unique'); |
| 100 | 100 | break; |
@@ -168,7 +168,7 @@ discard block |
||
| 168 | 168 | |
| 169 | 169 | $boardLabels = $this->labelMapper->findAll($label->getBoardId()); |
| 170 | 170 | if (\is_array($boardLabels)) { |
| 171 | - foreach($boardLabels as $boardLabel) { |
|
| 171 | + foreach ($boardLabels as $boardLabel) { |
|
| 172 | 172 | if ($boardLabel->getId() === $label->getId()) { |
| 173 | 173 | continue; |
| 174 | 174 | } |
@@ -147,7 +147,7 @@ |
||
| 147 | 147 | * Assign a user to a card |
| 148 | 148 | */ |
| 149 | 149 | public function assignUser($userId) { |
| 150 | - $card = $this->cardService->assignUser($this->request->getParam('cardId'), $userId);; |
|
| 150 | + $card = $this->cardService->assignUser($this->request->getParam('cardId'), $userId); ; |
|
| 151 | 151 | return new DataResponse($card, HTTP::STATUS_OK); |
| 152 | 152 | } |
| 153 | 153 | |
@@ -124,7 +124,7 @@ |
||
| 124 | 124 | } catch (QueryException $e) { |
| 125 | 125 | } |
| 126 | 126 | if ($boardId !== null) { |
| 127 | - $resource = $resourceManager->getResourceForUser(self::RESOURCE_TYPE, (string)$boardId, null); |
|
| 127 | + $resource = $resourceManager->getResourceForUser(self::RESOURCE_TYPE, (string) $boardId, null); |
|
| 128 | 128 | $resourceManager->invalidateAccessCacheForResource($resource); |
| 129 | 129 | } else { |
| 130 | 130 | $resourceManager->invalidateAccessCacheForProvider($this); |
@@ -281,9 +281,9 @@ |
||
| 281 | 281 | if (array_key_exists('comment', $subjectParams)) { |
| 282 | 282 | /** @var IComment $comment */ |
| 283 | 283 | try { |
| 284 | - $comment = $this->commentsManager->get((int)$subjectParams['comment']); |
|
| 284 | + $comment = $this->commentsManager->get((int) $subjectParams['comment']); |
|
| 285 | 285 | $event->setParsedMessage($comment->getMessage()); |
| 286 | - $params['comment'] =[ |
|
| 286 | + $params['comment'] = [ |
|
| 287 | 287 | 'type' => 'highlight', |
| 288 | 288 | 'id' => $subjectParams['comment'], |
| 289 | 289 | 'name' => $comment->getMessage() |
@@ -104,8 +104,8 @@ discard block |
||
| 104 | 104 | public function findAll($since = -1, $details = null) { |
| 105 | 105 | $userInfo = $this->getBoardPrerequisites(); |
| 106 | 106 | $userBoards = $this->boardMapper->findAllByUser($userInfo['user'], null, null, $since); |
| 107 | - $groupBoards = $this->boardMapper->findAllByGroups($userInfo['user'], $userInfo['groups'],null, null, $since); |
|
| 108 | - $circleBoards = $this->boardMapper->findAllByCircles($userInfo['user'], null, null, $since); |
|
| 107 | + $groupBoards = $this->boardMapper->findAllByGroups($userInfo['user'], $userInfo['groups'], null, null, $since); |
|
| 108 | + $circleBoards = $this->boardMapper->findAllByCircles($userInfo['user'], null, null, $since); |
|
| 109 | 109 | $complete = array_merge($userBoards, $groupBoards, $circleBoards); |
| 110 | 110 | $result = []; |
| 111 | 111 | /** @var Board $item */ |
@@ -145,7 +145,7 @@ discard block |
||
| 145 | 145 | */ |
| 146 | 146 | public function find($boardId) { |
| 147 | 147 | |
| 148 | - if ( is_numeric($boardId) === false ) { |
|
| 148 | + if (is_numeric($boardId) === false) { |
|
| 149 | 149 | throw new BadRequestException('board id must be a number'); |
| 150 | 150 | } |
| 151 | 151 | |
@@ -193,7 +193,7 @@ discard block |
||
| 193 | 193 | */ |
| 194 | 194 | public function isArchived($mapper, $id) { |
| 195 | 195 | |
| 196 | - if (is_numeric($id) === false) { |
|
| 196 | + if (is_numeric($id) === false) { |
|
| 197 | 197 | throw new BadRequestException('id must be a number'); |
| 198 | 198 | } |
| 199 | 199 | |
@@ -227,7 +227,7 @@ discard block |
||
| 227 | 227 | throw new BadRequestException('mapper must be provided'); |
| 228 | 228 | } |
| 229 | 229 | |
| 230 | - if (is_numeric($id) === false) { |
|
| 230 | + if (is_numeric($id) === false) { |
|
| 231 | 231 | throw new BadRequestException('id must be a number'); |
| 232 | 232 | } |
| 233 | 233 | |
@@ -382,7 +382,7 @@ discard block |
||
| 382 | 382 | * @throws BadRequestException |
| 383 | 383 | */ |
| 384 | 384 | public function deleteForce($id) { |
| 385 | - if (is_numeric($id) === false) { |
|
| 385 | + if (is_numeric($id) === false) { |
|
| 386 | 386 | throw new BadRequestException('id must be a number'); |
| 387 | 387 | } |
| 388 | 388 | |
@@ -422,7 +422,7 @@ discard block |
||
| 422 | 422 | throw new BadRequestException('color must be provided'); |
| 423 | 423 | } |
| 424 | 424 | |
| 425 | - if ( is_bool($archived) === false ) { |
|
| 425 | + if (is_bool($archived) === false) { |
|
| 426 | 426 | throw new BadRequestException('archived must be a boolean'); |
| 427 | 427 | } |
| 428 | 428 | |
@@ -608,7 +608,7 @@ discard block |
||
| 608 | 608 | private function enrichWithStacks($board, $since = -1) { |
| 609 | 609 | $stacks = $this->stackMapper->findAll($board->getId(), null, null, $since); |
| 610 | 610 | |
| 611 | - if(\count($stacks) === 0) { |
|
| 611 | + if (\count($stacks) === 0) { |
|
| 612 | 612 | return; |
| 613 | 613 | } |
| 614 | 614 | |
@@ -618,7 +618,7 @@ discard block |
||
| 618 | 618 | private function enrichWithLabels($board, $since = -1) { |
| 619 | 619 | $labels = $this->labelMapper->findAll($board->getId(), null, null, $since); |
| 620 | 620 | |
| 621 | - if(\count($labels) === 0) { |
|
| 621 | + if (\count($labels) === 0) { |
|
| 622 | 622 | return; |
| 623 | 623 | } |
| 624 | 624 | |
@@ -627,7 +627,7 @@ discard block |
||
| 627 | 627 | |
| 628 | 628 | private function enrichWithUsers($board, $since = -1) { |
| 629 | 629 | $boardUsers = $this->permissionService->findUsers($board->getId()); |
| 630 | - if(\count($boardUsers) === 0) { |
|
| 630 | + if (\count($boardUsers) === 0) { |
|
| 631 | 631 | return; |
| 632 | 632 | } |
| 633 | 633 | $board->setUsers(array_values($boardUsers)); |
@@ -133,7 +133,7 @@ discard block |
||
| 133 | 133 | $subject = ''; |
| 134 | 134 | switch ($subjectIdentifier) { |
| 135 | 135 | case self::SUBJECT_BOARD_CREATE: |
| 136 | - $subject = $ownActivity ? $this->l10n->t('You have created a new board {board}'): $this->l10n->t('{user} has created a new board {board}'); |
|
| 136 | + $subject = $ownActivity ? $this->l10n->t('You have created a new board {board}') : $this->l10n->t('{user} has created a new board {board}'); |
|
| 137 | 137 | break; |
| 138 | 138 | case self::SUBJECT_BOARD_DELETE: |
| 139 | 139 | $subject = $ownActivity ? $this->l10n->t('You have deleted the board {board}') : $this->l10n->t('{user} has deleted the board {board}'); |
@@ -302,10 +302,10 @@ discard block |
||
| 302 | 302 | try { |
| 303 | 303 | $object = $this->findObjectForEntity($objectType, $entity); |
| 304 | 304 | } catch (DoesNotExistException $e) { |
| 305 | - \OC::$server->getLogger()->error('Could not create activity entry for ' . $subject . '. Entity not found.', (array)$entity); |
|
| 305 | + \OC::$server->getLogger()->error('Could not create activity entry for ' . $subject . '. Entity not found.', (array) $entity); |
|
| 306 | 306 | return null; |
| 307 | 307 | } catch (MultipleObjectsReturnedException $e) { |
| 308 | - \OC::$server->getLogger()->error('Could not create activity entry for ' . $subject . '. Entity not found.', (array)$entity); |
|
| 308 | + \OC::$server->getLogger()->error('Could not create activity entry for ' . $subject . '. Entity not found.', (array) $entity); |
|
| 309 | 309 | return null; |
| 310 | 310 | } |
| 311 | 311 | |
@@ -375,7 +375,7 @@ discard block |
||
| 375 | 375 | break; |
| 376 | 376 | } |
| 377 | 377 | |
| 378 | - if ($subject === self::SUBJECT_CARD_UPDATE_DESCRIPTION){ |
|
| 378 | + if ($subject === self::SUBJECT_CARD_UPDATE_DESCRIPTION) { |
|
| 379 | 379 | $card = $subjectParams['card']; |
| 380 | 380 | if ($card->getLastEditor() === $this->userId) { |
| 381 | 381 | return null; |
@@ -394,7 +394,7 @@ discard block |
||
| 394 | 394 | $event->setApp('deck') |
| 395 | 395 | ->setType($eventType) |
| 396 | 396 | ->setAuthor($author === null ? $this->userId : $author) |
| 397 | - ->setObject($objectType, (int)$object->getId(), $object->getTitle()) |
|
| 397 | + ->setObject($objectType, (int) $object->getId(), $object->getTitle()) |
|
| 398 | 398 | ->setSubject($subject, array_merge($subjectParams, $additionalParams)) |
| 399 | 399 | ->setTimestamp(time()); |
| 400 | 400 | |
@@ -455,7 +455,7 @@ discard block |
||
| 455 | 455 | $objectId = $entity->getObjectId(); |
| 456 | 456 | break; |
| 457 | 457 | default: |
| 458 | - throw new InvalidArgumentException('No entity relation present for '. $className . ' to ' . $objectType); |
|
| 458 | + throw new InvalidArgumentException('No entity relation present for ' . $className . ' to ' . $objectType); |
|
| 459 | 459 | } |
| 460 | 460 | return $this->cardMapper->find($objectId); |
| 461 | 461 | } |
@@ -470,11 +470,11 @@ discard block |
||
| 470 | 470 | $objectId = $entity->getBoardId(); |
| 471 | 471 | break; |
| 472 | 472 | default: |
| 473 | - throw new InvalidArgumentException('No entity relation present for '. $className . ' to ' . $objectType); |
|
| 473 | + throw new InvalidArgumentException('No entity relation present for ' . $className . ' to ' . $objectType); |
|
| 474 | 474 | } |
| 475 | 475 | return $this->boardMapper->find($objectId); |
| 476 | 476 | } |
| 477 | - throw new InvalidArgumentException('No entity relation present for '. $className . ' to ' . $objectType); |
|
| 477 | + throw new InvalidArgumentException('No entity relation present for ' . $className . ' to ' . $objectType); |
|
| 478 | 478 | } |
| 479 | 479 | |
| 480 | 480 | private function findDetailsForStack($stackId) { |
@@ -98,7 +98,7 @@ discard block |
||
| 98 | 98 | |
| 99 | 99 | try { |
| 100 | 100 | $this->fullTextSearchManager->createIndex( |
| 101 | - DeckProvider::DECK_PROVIDER_ID, (string)$cardId, $userId, IIndex::INDEX_FULL |
|
| 101 | + DeckProvider::DECK_PROVIDER_ID, (string) $cardId, $userId, IIndex::INDEX_FULL |
|
| 102 | 102 | ); |
| 103 | 103 | } catch (FullTextSearchAppNotAvailableException $e) { |
| 104 | 104 | } |
@@ -113,7 +113,7 @@ discard block |
||
| 113 | 113 | |
| 114 | 114 | try { |
| 115 | 115 | $this->fullTextSearchManager->updateIndexStatus( |
| 116 | - DeckProvider::DECK_PROVIDER_ID, (string)$cardId, IIndex::INDEX_CONTENT |
|
| 116 | + DeckProvider::DECK_PROVIDER_ID, (string) $cardId, IIndex::INDEX_CONTENT |
|
| 117 | 117 | ); |
| 118 | 118 | } catch (FullTextSearchAppNotAvailableException $e) { |
| 119 | 119 | } |
@@ -128,7 +128,7 @@ discard block |
||
| 128 | 128 | |
| 129 | 129 | try { |
| 130 | 130 | $this->fullTextSearchManager->updateIndexStatus( |
| 131 | - DeckProvider::DECK_PROVIDER_ID, (string)$cardId, IIndex::INDEX_REMOVE |
|
| 131 | + DeckProvider::DECK_PROVIDER_ID, (string) $cardId, IIndex::INDEX_REMOVE |
|
| 132 | 132 | ); |
| 133 | 133 | } catch (FullTextSearchAppNotAvailableException $e) { |
| 134 | 134 | } |
@@ -139,7 +139,7 @@ discard block |
||
| 139 | 139 | * @param GenericEvent $e |
| 140 | 140 | */ |
| 141 | 141 | public function onBoardShares(GenericEvent $e) { |
| 142 | - $boardId = (int)$e->getArgument('boardId'); |
|
| 142 | + $boardId = (int) $e->getArgument('boardId'); |
|
| 143 | 143 | |
| 144 | 144 | $cards = array_map( |
| 145 | 145 | function(Card $item) { |
@@ -162,7 +162,7 @@ discard block |
||
| 162 | 162 | * @return IIndexDocument |
| 163 | 163 | */ |
| 164 | 164 | public function generateIndexDocumentFromCard(Card $card): IIndexDocument { |
| 165 | - $document = new IndexDocument(DeckProvider::DECK_PROVIDER_ID, (string)$card->getId()); |
|
| 165 | + $document = new IndexDocument(DeckProvider::DECK_PROVIDER_ID, (string) $card->getId()); |
|
| 166 | 166 | |
| 167 | 167 | return $document; |
| 168 | 168 | } |
@@ -176,11 +176,11 @@ discard block |
||
| 176 | 176 | */ |
| 177 | 177 | public function fillIndexDocument(IIndexDocument $document) { |
| 178 | 178 | /** @var Card $card */ |
| 179 | - $card = $this->cardMapper->find((int)$document->getId()); |
|
| 179 | + $card = $this->cardMapper->find((int) $document->getId()); |
|
| 180 | 180 | |
| 181 | 181 | $document->setTitle(($card->getTitle() === null) ? '' : $card->getTitle()); |
| 182 | 182 | $document->setContent(($card->getDescription() === null) ? '' : $card->getDescription()); |
| 183 | - $document->setAccess($this->generateDocumentAccessFromCardId((int)$card->getId())); |
|
| 183 | + $document->setAccess($this->generateDocumentAccessFromCardId((int) $card->getId())); |
|
| 184 | 184 | } |
| 185 | 185 | |
| 186 | 186 | |
@@ -241,7 +241,7 @@ discard block |
||
| 241 | 241 | * @throws MultipleObjectsReturnedException |
| 242 | 242 | */ |
| 243 | 243 | public function getBoardFromCardId(int $cardId): Board { |
| 244 | - $boardId = (int)$this->cardMapper->findBoardId($cardId); |
|
| 244 | + $boardId = (int) $this->cardMapper->findBoardId($cardId); |
|
| 245 | 245 | /** @var Board $board */ |
| 246 | 246 | $board = $this->boardMapper->find($boardId); |
| 247 | 247 | |
@@ -55,7 +55,7 @@ |
||
| 55 | 55 | * @return array |
| 56 | 56 | */ |
| 57 | 57 | public function reorder($cardId, $stackId, $order) { |
| 58 | - return $this->cardService->reorder((int)$cardId, (int)$stackId, (int)$order); |
|
| 58 | + return $this->cardService->reorder((int) $cardId, (int) $stackId, (int) $order); |
|
| 59 | 59 | } |
| 60 | 60 | |
| 61 | 61 | /** |
@@ -88,7 +88,7 @@ |
||
| 88 | 88 | * @return array |
| 89 | 89 | */ |
| 90 | 90 | public function reorder($stackId, $order) { |
| 91 | - return $this->stackService->reorder((int)$stackId, (int)$order); |
|
| 91 | + return $this->stackService->reorder((int) $stackId, (int) $order); |
|
| 92 | 92 | } |
| 93 | 93 | |
| 94 | 94 | /** |