@@ -63,7 +63,7 @@ |
||
63 | 63 | public function index() { |
64 | 64 | $params = [ |
65 | 65 | 'user' => $this->userId, |
66 | - 'maxUploadSize' => (int)\OCP\Util::uploadLimit(), |
|
66 | + 'maxUploadSize' => (int) \OCP\Util::uploadLimit(), |
|
67 | 67 | 'canCreate' => $this->permissionService->canCreate() |
68 | 68 | ]; |
69 | 69 |
@@ -189,6 +189,9 @@ discard block |
||
189 | 189 | return $event; |
190 | 190 | } |
191 | 191 | |
192 | + /** |
|
193 | + * @param string $paramName |
|
194 | + */ |
|
192 | 195 | private function parseParamForBoard($paramName, $subjectParams, $params) { |
193 | 196 | if (array_key_exists($paramName, $subjectParams)) { |
194 | 197 | $params[$paramName] = [ |
@@ -200,6 +203,10 @@ discard block |
||
200 | 203 | } |
201 | 204 | return $params; |
202 | 205 | } |
206 | + |
|
207 | + /** |
|
208 | + * @param string $paramName |
|
209 | + */ |
|
203 | 210 | private function parseParamForStack($paramName, $subjectParams, $params) { |
204 | 211 | if (array_key_exists($paramName, $subjectParams)) { |
205 | 212 | $params[$paramName] = [ |
@@ -211,6 +218,9 @@ discard block |
||
211 | 218 | return $params; |
212 | 219 | } |
213 | 220 | |
221 | + /** |
|
222 | + * @param string $paramName |
|
223 | + */ |
|
214 | 224 | private function parseParamForAttachment($paramName, $subjectParams, $params) { |
215 | 225 | if (array_key_exists($paramName, $subjectParams)) { |
216 | 226 | $params[$paramName] = [ |
@@ -285,6 +295,7 @@ discard block |
||
285 | 295 | * |
286 | 296 | * @param $subjectParams |
287 | 297 | * @param $params |
298 | + * @param IEvent $event |
|
288 | 299 | * @return mixed |
289 | 300 | */ |
290 | 301 | private function parseParamForChanges($subjectParams, $params, $event) { |
@@ -312,6 +323,9 @@ discard block |
||
312 | 323 | return $params; |
313 | 324 | } |
314 | 325 | |
326 | + /** |
|
327 | + * @param string $endpoint |
|
328 | + */ |
|
315 | 329 | public function deckUrl($endpoint) { |
316 | 330 | return $this->urlGenerator->linkToRouteAbsolute('deck.page.index') . '#!' . $endpoint; |
317 | 331 | } |
@@ -281,11 +281,11 @@ |
||
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 | 286 | } catch (NotFoundException $e) { |
287 | 287 | } |
288 | - $params['comment'] =[ |
|
288 | + $params['comment'] = [ |
|
289 | 289 | 'type' => 'highlight', |
290 | 290 | 'id' => $subjectParams['comment'], |
291 | 291 | 'name' => $comment->getMessage() |
@@ -43,7 +43,7 @@ |
||
43 | 43 | private $cardMapper; |
44 | 44 | |
45 | 45 | public function __construct(ActivityManager $activityManager, CardMapper $cardMapper) { |
46 | - $this->activityManager = $activityManager; |
|
46 | + $this->activityManager = $activityManager; |
|
47 | 47 | $this->cardMapper = $cardMapper; |
48 | 48 | } |
49 | 49 |
@@ -50,12 +50,12 @@ discard block |
||
50 | 50 | * @param CommentsEvent $event |
51 | 51 | */ |
52 | 52 | public function handle(CommentsEvent $event) { |
53 | - if($event->getComment()->getObjectType() !== 'deckCard') { |
|
53 | + if ($event->getComment()->getObjectType() !== 'deckCard') { |
|
54 | 54 | return; |
55 | 55 | } |
56 | 56 | |
57 | 57 | $eventType = $event->getEvent(); |
58 | - if( $eventType === CommentsEvent::EVENT_ADD |
|
58 | + if ($eventType === CommentsEvent::EVENT_ADD |
|
59 | 59 | ) { |
60 | 60 | $this->notificationHandler($event); |
61 | 61 | $this->activityHandler($event); |
@@ -65,7 +65,7 @@ discard block |
||
65 | 65 | $applicableEvents = [ |
66 | 66 | CommentsEvent::EVENT_UPDATE |
67 | 67 | ]; |
68 | - if(in_array($eventType, $applicableEvents)) { |
|
68 | + if (in_array($eventType, $applicableEvents)) { |
|
69 | 69 | $this->notificationHandler($event); |
70 | 70 | return; |
71 | 71 | } |
@@ -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); |
@@ -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 | } |
@@ -158,7 +158,7 @@ discard block |
||
158 | 158 | } |
159 | 159 | |
160 | 160 | /** |
161 | - * @return array |
|
161 | + * @return integer |
|
162 | 162 | */ |
163 | 163 | private function getBoardPrerequisites() { |
164 | 164 | $groups = $this->groupManager->getUserGroupIds( |
@@ -532,6 +532,9 @@ discard block |
||
532 | 532 | return $this->aclMapper->delete($acl); |
533 | 533 | } |
534 | 534 | |
535 | + /** |
|
536 | + * @param Board $board |
|
537 | + */ |
|
535 | 538 | private function enrichWithStacks($board, $since = -1) { |
536 | 539 | $stacks = $this->stackMapper->findAll($board->getId(), null, null, $since); |
537 | 540 |
@@ -96,8 +96,8 @@ discard block |
||
96 | 96 | public function findAll($since = 0) { |
97 | 97 | $userInfo = $this->getBoardPrerequisites(); |
98 | 98 | $userBoards = $this->boardMapper->findAllByUser($userInfo['user'], null, null, $since); |
99 | - $groupBoards = $this->boardMapper->findAllByGroups($userInfo['user'], $userInfo['groups'],null, null, $since); |
|
100 | - $circleBoards = $this->boardMapper->findAllByCircles($userInfo['user'], null, null, $since); |
|
99 | + $groupBoards = $this->boardMapper->findAllByGroups($userInfo['user'], $userInfo['groups'], null, null, $since); |
|
100 | + $circleBoards = $this->boardMapper->findAllByCircles($userInfo['user'], null, null, $since); |
|
101 | 101 | $complete = array_merge($userBoards, $groupBoards, $circleBoards); |
102 | 102 | $result = []; |
103 | 103 | /** @var Board $item */ |
@@ -133,7 +133,7 @@ discard block |
||
133 | 133 | */ |
134 | 134 | public function find($boardId) { |
135 | 135 | |
136 | - if ( is_numeric($boardId) === false ) { |
|
136 | + if (is_numeric($boardId) === false) { |
|
137 | 137 | throw new BadRequestException('board id must be a number'); |
138 | 138 | } |
139 | 139 | |
@@ -182,7 +182,7 @@ discard block |
||
182 | 182 | */ |
183 | 183 | public function isArchived($mapper, $id) { |
184 | 184 | |
185 | - if (is_numeric($id) === false) { |
|
185 | + if (is_numeric($id) === false) { |
|
186 | 186 | throw new BadRequestException('id must be a number'); |
187 | 187 | } |
188 | 188 | |
@@ -216,7 +216,7 @@ discard block |
||
216 | 216 | throw new BadRequestException('mapper must be provided'); |
217 | 217 | } |
218 | 218 | |
219 | - if (is_numeric($id) === false) { |
|
219 | + if (is_numeric($id) === false) { |
|
220 | 220 | throw new BadRequestException('id must be a number'); |
221 | 221 | } |
222 | 222 | |
@@ -354,7 +354,7 @@ discard block |
||
354 | 354 | * @throws BadRequestException |
355 | 355 | */ |
356 | 356 | public function deleteForce($id) { |
357 | - if (is_numeric($id) === false) { |
|
357 | + if (is_numeric($id) === false) { |
|
358 | 358 | throw new BadRequestException('id must be a number'); |
359 | 359 | } |
360 | 360 | |
@@ -388,7 +388,7 @@ discard block |
||
388 | 388 | throw new BadRequestException('color must be provided'); |
389 | 389 | } |
390 | 390 | |
391 | - if ( is_bool($archived) === false ) { |
|
391 | + if (is_bool($archived) === false) { |
|
392 | 392 | throw new BadRequestException('archived must be a boolean'); |
393 | 393 | } |
394 | 394 | |
@@ -536,7 +536,7 @@ discard block |
||
536 | 536 | private function enrichWithStacks($board, $since = -1) { |
537 | 537 | $stacks = $this->stackMapper->findAll($board->getId(), null, null, $since); |
538 | 538 | |
539 | - if(\count($stacks) === 0) { |
|
539 | + if (\count($stacks) === 0) { |
|
540 | 540 | return; |
541 | 541 | } |
542 | 542 |
@@ -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); |