@@ -157,7 +157,7 @@ |
||
157 | 157 | |
158 | 158 | /** |
159 | 159 | * @param $boardId |
160 | - * @return bool |
|
160 | + * @return boolean|null |
|
161 | 161 | */ |
162 | 162 | public function userIsBoardOwner($boardId, $userId = null) { |
163 | 163 | if ($userId === null) { |
@@ -33,7 +33,6 @@ |
||
33 | 33 | use OCP\AppFramework\Db\DoesNotExistException; |
34 | 34 | use OCP\AppFramework\Db\Entity; |
35 | 35 | use OCP\AppFramework\Db\MultipleObjectsReturnedException; |
36 | -use OCP\AppFramework\QueryException; |
|
37 | 36 | use OCP\IConfig; |
38 | 37 | use OCP\IGroupManager; |
39 | 38 | use OCP\ILogger; |
@@ -23,7 +23,6 @@ |
||
23 | 23 | |
24 | 24 | namespace OCA\Deck\Middleware; |
25 | 25 | |
26 | -use OCA\Deck\Controller\PageController; |
|
27 | 26 | use OCA\Deck\StatusException; |
28 | 27 | use OCP\AppFramework\Db\DoesNotExistException; |
29 | 28 | use OCP\AppFramework\Middleware; |
@@ -155,7 +155,7 @@ discard block |
||
155 | 155 | * @throws \OCP\AppFramework\QueryException |
156 | 156 | */ |
157 | 157 | protected function registerCommentsEventHandler() { |
158 | - $this->getContainer()->getServer()->getCommentsManager()->registerEventHandler(function () { |
|
158 | + $this->getContainer()->getServer()->getCommentsManager()->registerEventHandler(function() { |
|
159 | 159 | return $this->getContainer()->query(CommentEventHandler::class); |
160 | 160 | }); |
161 | 161 | } |
@@ -175,7 +175,7 @@ discard block |
||
175 | 175 | /** @var IManager $resourceManager */ |
176 | 176 | $resourceManager = $this->getContainer()->query(IManager::class); |
177 | 177 | $resourceManager->registerResourceProvider(\OCA\Deck\Collaboration\Resources\ResourceProvider::class); |
178 | - \OC::$server->getEventDispatcher()->addListener('\OCP\Collaboration\Resources::loadAdditionalScripts', function () { |
|
178 | + \OC::$server->getEventDispatcher()->addListener('\OCP\Collaboration\Resources::loadAdditionalScripts', function() { |
|
179 | 179 | \OCP\Util::addScript('deck', 'build/collections'); |
180 | 180 | }); |
181 | 181 | } |
@@ -33,7 +33,6 @@ |
||
33 | 33 | use OCA\Deck\Notification\Notifier; |
34 | 34 | use OCA\Deck\Service\FullTextSearchService; |
35 | 35 | use OCP\AppFramework\App; |
36 | -use OCA\Deck\Middleware\SharingMiddleware; |
|
37 | 36 | use OCP\Collaboration\Resources\IManager; |
38 | 37 | use OCP\Comments\CommentsEntityEvent; |
39 | 38 | use OCP\IGroup; |
@@ -97,8 +97,8 @@ discard block |
||
97 | 97 | public function findAll($since = 0, $details = null) { |
98 | 98 | $userInfo = $this->getBoardPrerequisites(); |
99 | 99 | $userBoards = $this->boardMapper->findAllByUser($userInfo['user'], null, null, $since); |
100 | - $groupBoards = $this->boardMapper->findAllByGroups($userInfo['user'], $userInfo['groups'],null, null, $since); |
|
101 | - $circleBoards = $this->boardMapper->findAllByCircles($userInfo['user'], null, null, $since); |
|
100 | + $groupBoards = $this->boardMapper->findAllByGroups($userInfo['user'], $userInfo['groups'], null, null, $since); |
|
101 | + $circleBoards = $this->boardMapper->findAllByCircles($userInfo['user'], null, null, $since); |
|
102 | 102 | $complete = array_merge($userBoards, $groupBoards, $circleBoards); |
103 | 103 | $result = []; |
104 | 104 | /** @var Board $item */ |
@@ -138,7 +138,7 @@ discard block |
||
138 | 138 | */ |
139 | 139 | public function find($boardId) { |
140 | 140 | |
141 | - if ( is_numeric($boardId) === false ) { |
|
141 | + if (is_numeric($boardId) === false) { |
|
142 | 142 | throw new BadRequestException('board id must be a number'); |
143 | 143 | } |
144 | 144 | |
@@ -186,7 +186,7 @@ discard block |
||
186 | 186 | */ |
187 | 187 | public function isArchived($mapper, $id) { |
188 | 188 | |
189 | - if (is_numeric($id) === false) { |
|
189 | + if (is_numeric($id) === false) { |
|
190 | 190 | throw new BadRequestException('id must be a number'); |
191 | 191 | } |
192 | 192 | |
@@ -220,7 +220,7 @@ discard block |
||
220 | 220 | throw new BadRequestException('mapper must be provided'); |
221 | 221 | } |
222 | 222 | |
223 | - if (is_numeric($id) === false) { |
|
223 | + if (is_numeric($id) === false) { |
|
224 | 224 | throw new BadRequestException('id must be a number'); |
225 | 225 | } |
226 | 226 | |
@@ -358,7 +358,7 @@ discard block |
||
358 | 358 | * @throws BadRequestException |
359 | 359 | */ |
360 | 360 | public function deleteForce($id) { |
361 | - if (is_numeric($id) === false) { |
|
361 | + if (is_numeric($id) === false) { |
|
362 | 362 | throw new BadRequestException('id must be a number'); |
363 | 363 | } |
364 | 364 | |
@@ -392,7 +392,7 @@ discard block |
||
392 | 392 | throw new BadRequestException('color must be provided'); |
393 | 393 | } |
394 | 394 | |
395 | - if ( is_bool($archived) === false ) { |
|
395 | + if (is_bool($archived) === false) { |
|
396 | 396 | throw new BadRequestException('archived must be a boolean'); |
397 | 397 | } |
398 | 398 | |
@@ -554,7 +554,7 @@ discard block |
||
554 | 554 | private function enrichWithStacks($board, $since = -1) { |
555 | 555 | $stacks = $this->stackMapper->findAll($board->getId(), null, null, $since); |
556 | 556 | |
557 | - if(\count($stacks) === 0) { |
|
557 | + if (\count($stacks) === 0) { |
|
558 | 558 | return; |
559 | 559 | } |
560 | 560 | |
@@ -564,7 +564,7 @@ discard block |
||
564 | 564 | private function enrichWithLabels($board, $since = -1) { |
565 | 565 | $labels = $this->labelMapper->findAll($board->getId(), null, null, $since); |
566 | 566 | |
567 | - if(\count($labels) === 0) { |
|
567 | + if (\count($labels) === 0) { |
|
568 | 568 | return; |
569 | 569 | } |
570 | 570 | |
@@ -573,7 +573,7 @@ discard block |
||
573 | 573 | |
574 | 574 | private function enrichWithUsers($board, $since = -1) { |
575 | 575 | $boardUsers = $this->permissionService->findUsers($board->getId()); |
576 | - if(\count($boardUsers) === 0) { |
|
576 | + if (\count($boardUsers) === 0) { |
|
577 | 577 | return; |
578 | 578 | } |
579 | 579 | $board->setUsers(array_values($boardUsers)); |
@@ -170,7 +170,7 @@ discard block |
||
170 | 170 | } |
171 | 171 | |
172 | 172 | /** |
173 | - * @return array |
|
173 | + * @return integer |
|
174 | 174 | */ |
175 | 175 | private function getBoardPrerequisites() { |
176 | 176 | $groups = $this->groupManager->getUserGroupIds( |
@@ -605,6 +605,9 @@ discard block |
||
605 | 605 | return $delete; |
606 | 606 | } |
607 | 607 | |
608 | + /** |
|
609 | + * @param Board $board |
|
610 | + */ |
|
608 | 611 | private function enrichWithStacks($board, $since = -1) { |
609 | 612 | $stacks = $this->stackMapper->findAll($board->getId(), null, null, $since); |
610 | 613 | |
@@ -615,6 +618,9 @@ discard block |
||
615 | 618 | $board->setStacks($stacks); |
616 | 619 | } |
617 | 620 | |
621 | + /** |
|
622 | + * @param Board $board |
|
623 | + */ |
|
618 | 624 | private function enrichWithLabels($board, $since = -1) { |
619 | 625 | $labels = $this->labelMapper->findAll($board->getId(), null, null, $since); |
620 | 626 | |
@@ -625,6 +631,9 @@ discard block |
||
625 | 631 | $board->setLabels($labels); |
626 | 632 | } |
627 | 633 | |
634 | + /** |
|
635 | + * @param Board $board |
|
636 | + */ |
|
628 | 637 | private function enrichWithUsers($board, $since = -1) { |
629 | 638 | $boardUsers = $this->permissionService->findUsers($board->getId()); |
630 | 639 | if(\count($boardUsers) === 0) { |