@@ -26,10 +26,8 @@ |
||
26 | 26 | |
27 | 27 | use OCA\Deck\StatusException; |
28 | 28 | use OCP\AppFramework\ApiController; |
29 | -use OCP\AppFramework\Http; |
|
30 | 29 | use OCP\AppFramework\Http\DataResponse; |
31 | 30 | use OCP\IRequest; |
32 | - |
|
33 | 31 | use OCA\Deck\Service\BoardService; |
34 | 32 | use Sabre\HTTP\Util; |
35 | 33 |
@@ -95,6 +95,9 @@ discard block |
||
95 | 95 | $this->cardMapper->markNotified($card); |
96 | 96 | } |
97 | 97 | |
98 | + /** |
|
99 | + * @param \OCA\Deck\Db\Card $card |
|
100 | + */ |
|
98 | 101 | public function markDuedateAsRead($card) { |
99 | 102 | $notification = $this->notificationManager->createNotification(); |
100 | 103 | $notification |
@@ -104,6 +107,9 @@ discard block |
||
104 | 107 | $this->notificationManager->markProcessed($notification); |
105 | 108 | } |
106 | 109 | |
110 | + /** |
|
111 | + * @param \OCA\Deck\Db\Card $card |
|
112 | + */ |
|
107 | 113 | public function sendCardAssigned($card, $userId) { |
108 | 114 | $boardId = $this->cardMapper->findBoardId($card->getId()); |
109 | 115 | $board = $this->getBoard($boardId); |
@@ -77,7 +77,7 @@ |
||
77 | 77 | * DeckProvider constructor. |
78 | 78 | * |
79 | 79 | * @param IL10N $l10n |
80 | - * @param IUrlGenerator $urlGenerator |
|
80 | + * @param IURLGenerator $urlGenerator |
|
81 | 81 | * @param FullTextSearchService $fullTextSearchService |
82 | 82 | */ |
83 | 83 | public function __construct( |
@@ -240,7 +240,7 @@ |
||
240 | 240 | foreach ($searchResult->getDocuments() as $document) { |
241 | 241 | try { |
242 | 242 | $board = |
243 | - $this->fullTextSearchService->getBoardFromCardId((int)$document->getId()); |
|
243 | + $this->fullTextSearchService->getBoardFromCardId((int) $document->getId()); |
|
244 | 244 | $path = '#!/board/' . $board->getId() . '//card/' . $document->getId(); |
245 | 245 | $document->setLink($this->urlGenerator->linkToRoute('deck.page.index') . $path); |
246 | 246 | } catch (DoesNotExistException $e) { |
@@ -44,7 +44,6 @@ |
||
44 | 44 | use OCP\FullTextSearch\Model\ISearchResult; |
45 | 45 | use OCP\FullTextSearch\Model\ISearchTemplate; |
46 | 46 | use OCP\IL10N; |
47 | -use OCP\IURLGenerator; |
|
48 | 47 | |
49 | 48 | |
50 | 49 | /** |
@@ -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 | } |
@@ -55,7 +55,6 @@ |
||
55 | 55 | /** |
56 | 56 | * Get the type of a resource |
57 | 57 | * |
58 | - * @param IResource $resource |
|
59 | 58 | * @return string |
60 | 59 | * @since 15.0.0 |
61 | 60 | */ |
@@ -25,7 +25,6 @@ discard block |
||
25 | 25 | |
26 | 26 | |
27 | 27 | use OCA\Deck\Db\Acl; |
28 | -use OCA\Deck\Db\Board; |
|
29 | 28 | use OCA\Deck\Db\BoardMapper; |
30 | 29 | use OCA\Deck\Service\PermissionService; |
31 | 30 | use OCP\AppFramework\Db\DoesNotExistException; |
@@ -34,7 +33,6 @@ discard block |
||
34 | 33 | use OCP\Collaboration\Resources\IManager; |
35 | 34 | use OCP\Collaboration\Resources\IProvider; |
36 | 35 | use OCP\Collaboration\Resources\IResource; |
37 | -use OCP\Collaboration\Resources\ResourceException; |
|
38 | 36 | use OCP\IUser; |
39 | 37 | |
40 | 38 | class ResourceProvider implements IProvider { |
@@ -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); |
@@ -53,6 +53,9 @@ |
||
53 | 53 | $this->addResolvable('participant'); |
54 | 54 | } |
55 | 55 | |
56 | + /** |
|
57 | + * @return string |
|
58 | + */ |
|
56 | 59 | public function getPermission($permission) { |
57 | 60 | switch ($permission) { |
58 | 61 | case self::PERMISSION_READ: |
@@ -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; |
@@ -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)); |
@@ -180,7 +180,7 @@ discard block |
||
180 | 180 | } |
181 | 181 | |
182 | 182 | /** |
183 | - * @return array |
|
183 | + * @return integer |
|
184 | 184 | */ |
185 | 185 | private function getBoardPrerequisites() { |
186 | 186 | $groups = $this->groupManager->getUserGroupIds( |
@@ -658,6 +658,9 @@ discard block |
||
658 | 658 | return $newBoard; |
659 | 659 | } |
660 | 660 | |
661 | + /** |
|
662 | + * @param Board $board |
|
663 | + */ |
|
661 | 664 | private function enrichWithStacks($board, $since = -1) { |
662 | 665 | $stacks = $this->stackMapper->findAll($board->getId(), null, null, $since); |
663 | 666 | |
@@ -668,6 +671,9 @@ discard block |
||
668 | 671 | $board->setStacks($stacks); |
669 | 672 | } |
670 | 673 | |
674 | + /** |
|
675 | + * @param Board $board |
|
676 | + */ |
|
671 | 677 | private function enrichWithLabels($board, $since = -1) { |
672 | 678 | $labels = $this->labelMapper->findAll($board->getId(), null, null, $since); |
673 | 679 | |
@@ -678,6 +684,9 @@ discard block |
||
678 | 684 | $board->setLabels($labels); |
679 | 685 | } |
680 | 686 | |
687 | + /** |
|
688 | + * @param Board $board |
|
689 | + */ |
|
681 | 690 | private function enrichWithUsers($board, $since = -1) { |
682 | 691 | $boardUsers = $this->permissionService->findUsers($board->getId()); |
683 | 692 | if(\count($boardUsers) === 0) { |