@@ -99,16 +99,16 @@ |
||
| 99 | 99 | $data = []; |
| 100 | 100 | foreach ($boards as $board) { |
| 101 | 101 | $fullBoard = $this->boardMapper->find($board->getId(), true, true); |
| 102 | - $data[$board->getId()] = (array)$fullBoard->jsonSerialize(); |
|
| 102 | + $data[$board->getId()] = (array) $fullBoard->jsonSerialize(); |
|
| 103 | 103 | $stacks = $this->stackMapper->findAll($board->getId()); |
| 104 | 104 | foreach ($stacks as $stack) { |
| 105 | - $data[$board->getId()]['stacks'][] = (array)$stack->jsonSerialize(); |
|
| 105 | + $data[$board->getId()]['stacks'][] = (array) $stack->jsonSerialize(); |
|
| 106 | 106 | $cards = $this->cardMapper->findAllByStack($stack->getId()); |
| 107 | 107 | foreach ($cards as $card) { |
| 108 | 108 | $fullCard = $this->cardMapper->find($card->getId()); |
| 109 | 109 | $assignedUsers = $this->assignedUsersMapper->find($card->getId()); |
| 110 | 110 | $fullCard->setAssignedUsers($assignedUsers); |
| 111 | - $data[$board->getId()]['stacks'][$stack->getId()]['cards'][] = (array)$fullCard->jsonSerialize(); |
|
| 111 | + $data[$board->getId()]['stacks'][$stack->getId()]['cards'][] = (array) $fullCard->jsonSerialize(); |
|
| 112 | 112 | } |
| 113 | 113 | } |
| 114 | 114 | } |
@@ -85,7 +85,7 @@ discard block |
||
| 85 | 85 | * @throws NotPermittedException |
| 86 | 86 | */ |
| 87 | 87 | private function getFolder(Attachment $attachment) { |
| 88 | - $folderName = 'file-card-' . (int)$attachment->getCardId(); |
|
| 88 | + $folderName = 'file-card-' . (int) $attachment->getCardId(); |
|
| 89 | 89 | try { |
| 90 | 90 | $folder = $this->appData->getFolder($folderName); |
| 91 | 91 | } catch (NotFoundException $e) { |
@@ -116,7 +116,7 @@ discard block |
||
| 116 | 116 | * @return array |
| 117 | 117 | * @throws StatusException |
| 118 | 118 | */ |
| 119 | - private function getUploadedFile () { |
|
| 119 | + private function getUploadedFile() { |
|
| 120 | 120 | $file = $this->request->getUploadedFile('file'); |
| 121 | 121 | $error = null; |
| 122 | 122 | $phpFileUploadErrors = [ |
@@ -190,7 +190,7 @@ discard block |
||
| 190 | 190 | * @throws \Exception |
| 191 | 191 | */ |
| 192 | 192 | private function getFileFromRootFolder(Attachment $attachment) { |
| 193 | - $folderName = 'file-card-' . (int)$attachment->getCardId(); |
|
| 193 | + $folderName = 'file-card-' . (int) $attachment->getCardId(); |
|
| 194 | 194 | $instanceId = $this->config->getSystemValue('instanceid', null); |
| 195 | 195 | if ($instanceId === null) { |
| 196 | 196 | throw new \Exception('no instance id!'); |
@@ -59,7 +59,7 @@ |
||
| 59 | 59 | public function index() { |
| 60 | 60 | $params = [ |
| 61 | 61 | 'user' => $this->userId, |
| 62 | - 'maxUploadSize' => (int)\OCP\Util::uploadLimit(), |
|
| 62 | + 'maxUploadSize' => (int) \OCP\Util::uploadLimit(), |
|
| 63 | 63 | ]; |
| 64 | 64 | |
| 65 | 65 | if ($this->defaultBoardService->checkFirstRun($this->userId, $this->appName)) { |
@@ -67,14 +67,14 @@ discard block |
||
| 67 | 67 | |
| 68 | 68 | $cursor = $qb->execute(); |
| 69 | 69 | $row = $cursor->fetch(PDO::FETCH_ASSOC); |
| 70 | - if($row === false) { |
|
| 70 | + if ($row === false) { |
|
| 71 | 71 | $cursor->closeCursor(); |
| 72 | 72 | throw new DoesNotExistException('Did expect one result but found none when executing' . $qb); |
| 73 | 73 | } |
| 74 | 74 | |
| 75 | 75 | $row2 = $cursor->fetch(); |
| 76 | 76 | $cursor->closeCursor(); |
| 77 | - if($row2 !== false ) { |
|
| 77 | + if ($row2 !== false) { |
|
| 78 | 78 | throw new MultipleObjectsReturnedException('Did not expect more than one result when executing' . $query); |
| 79 | 79 | } |
| 80 | 80 | |
@@ -97,7 +97,7 @@ discard block |
||
| 97 | 97 | |
| 98 | 98 | $entities = []; |
| 99 | 99 | $cursor = $qb->execute(); |
| 100 | - while($row = $cursor->fetch()){ |
|
| 100 | + while ($row = $cursor->fetch()) { |
|
| 101 | 101 | $entities[] = $this->mapRowToEntity($row); |
| 102 | 102 | } |
| 103 | 103 | $cursor->closeCursor(); |
@@ -127,7 +127,7 @@ discard block |
||
| 127 | 127 | |
| 128 | 128 | $entities = []; |
| 129 | 129 | $cursor = $qb->execute(); |
| 130 | - while($row = $cursor->fetch()){ |
|
| 130 | + while ($row = $cursor->fetch()) { |
|
| 131 | 131 | $entities[] = $this->mapRowToEntity($row); |
| 132 | 132 | } |
| 133 | 133 | $cursor->closeCursor(); |
@@ -143,7 +143,7 @@ |
||
| 143 | 143 | } |
| 144 | 144 | |
| 145 | 145 | public function assignUser($userId) { |
| 146 | - $card = $this->cardService->assignUser($this->request->getParam('cardId'), $userId);; |
|
| 146 | + $card = $this->cardService->assignUser($this->request->getParam('cardId'), $userId); ; |
|
| 147 | 147 | return new DataResponse($card, HTTP::STATUS_OK); |
| 148 | 148 | } |
| 149 | 149 | |
@@ -112,6 +112,6 @@ |
||
| 112 | 112 | ['name' => 'attachment_api#delete', 'url' => '/api/v1.0/boards/{boardId}/stacks/{stackId}/cards/{cardId}/attachments/{attachmentId}', 'verb' => 'DELETE'], |
| 113 | 113 | ['name' => 'attachment_api#restore', 'url' => '/api/v1.0/boards/{boardId}/stacks/{stackId}/cards/{cardId}/attachments/{attachmentId}/restore', 'verb' => 'PUT'], |
| 114 | 114 | |
| 115 | - ['name' => 'board_api#preflighted_cors', 'url' => '/api/v1.0/{path}','verb' => 'OPTIONS', 'requirements' => ['path' => '.+']], |
|
| 115 | + ['name' => 'board_api#preflighted_cors', 'url' => '/api/v1.0/{path}', 'verb' => 'OPTIONS', 'requirements' => ['path' => '.+']], |
|
| 116 | 116 | ] |
| 117 | 117 | ]; |
@@ -21,7 +21,7 @@ |
||
| 21 | 21 | * |
| 22 | 22 | */ |
| 23 | 23 | |
| 24 | -if ((@include_once __DIR__ . '/../vendor/autoload.php')===false) { |
|
| 24 | +if ((@include_once __DIR__ . '/../vendor/autoload.php') === false) { |
|
| 25 | 25 | throw new Exception('Cannot include autoload. Did you run install dependencies using composer?'); |
| 26 | 26 | } |
| 27 | 27 | |
@@ -142,7 +142,7 @@ |
||
| 142 | 142 | } |
| 143 | 143 | |
| 144 | 144 | protected function registerCommentsEventHandler() { |
| 145 | - $this->getContainer()->getServer()->getCommentsManager()->registerEventHandler(function () { |
|
| 145 | + $this->getContainer()->getServer()->getCommentsManager()->registerEventHandler(function() { |
|
| 146 | 146 | return $this->getContainer()->query(CommentEventHandler::class); |
| 147 | 147 | }); |
| 148 | 148 | } |
@@ -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}'); |
@@ -368,7 +368,7 @@ discard block |
||
| 368 | 368 | break; |
| 369 | 369 | } |
| 370 | 370 | |
| 371 | - if ($subject === self::SUBJECT_CARD_UPDATE_DESCRIPTION){ |
|
| 371 | + if ($subject === self::SUBJECT_CARD_UPDATE_DESCRIPTION) { |
|
| 372 | 372 | $subjectParams['diff'] = true; |
| 373 | 373 | } |
| 374 | 374 | if ($subject === self::SUBJECT_CARD_UPDATE_STACKID) { |
@@ -379,7 +379,7 @@ discard block |
||
| 379 | 379 | $event->setApp('deck') |
| 380 | 380 | ->setType('deck') |
| 381 | 381 | ->setAuthor($this->userId) |
| 382 | - ->setObject($objectType, (int)$object->getId(), $object->getTitle()) |
|
| 382 | + ->setObject($objectType, (int) $object->getId(), $object->getTitle()) |
|
| 383 | 383 | ->setSubject($subject, array_merge($subjectParams, $additionalParams)) |
| 384 | 384 | ->setTimestamp(time()); |
| 385 | 385 | |
@@ -440,7 +440,7 @@ discard block |
||
| 440 | 440 | $objectId = $entity->getObjectId(); |
| 441 | 441 | break; |
| 442 | 442 | default: |
| 443 | - throw new InvalidArgumentException('No entity relation present for '. $className . ' to ' . $objectType); |
|
| 443 | + throw new InvalidArgumentException('No entity relation present for ' . $className . ' to ' . $objectType); |
|
| 444 | 444 | } |
| 445 | 445 | return $this->cardMapper->find($objectId); |
| 446 | 446 | } |
@@ -455,11 +455,11 @@ discard block |
||
| 455 | 455 | $objectId = $entity->getBoardId(); |
| 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->boardMapper->find($objectId); |
| 461 | 461 | } |
| 462 | - throw new InvalidArgumentException('No entity relation present for '. $className . ' to ' . $objectType); |
|
| 462 | + throw new InvalidArgumentException('No entity relation present for ' . $className . ' to ' . $objectType); |
|
| 463 | 463 | } |
| 464 | 464 | |
| 465 | 465 | private function findDetailsForStack($stackId) { |