Completed
Push — master ( 5fe315...ef9868 )
by Julius
28s queued 11s
created
lib/Service/BoardService.php 2 patches
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -104,8 +104,8 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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));
Please login to merge, or discard this patch.
Doc Comments   +10 added lines, -1 removed lines patch added patch discarded remove patch
@@ -180,7 +180,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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) {
Please login to merge, or discard this patch.
lib/Db/BoardMapper.php 2 patches
Unused Use Statements   -1 removed lines patch added patch discarded remove patch
@@ -24,7 +24,6 @@
 block discarded – undo
24 24
 namespace OCA\Deck\Db;
25 25
 
26 26
 use OCP\AppFramework\Db\DoesNotExistException;
27
-use OCP\AppFramework\QueryException;
28 27
 use OCP\IDBConnection;
29 28
 use OCP\ILogger;
30 29
 use OCP\IUserManager;
Please login to merge, or discard this patch.
Doc Comments   +7 added lines, -1 removed lines patch added patch discarded remove patch
@@ -111,7 +111,7 @@  discard block
 block discarded – undo
111 111
 	/**
112 112
 	 * Find all boards for a given user
113 113
 	 *
114
-	 * @param $userId
114
+	 * @param string $userId
115 115
 	 * @param $groups
116 116
 	 * @param null $limit
117 117
 	 * @param null $offset
@@ -139,6 +139,9 @@  discard block
 block discarded – undo
139 139
 		return $entries;
140 140
 	}
141 141
 
142
+	/**
143
+	 * @param string $userId
144
+	 */
142 145
 	public function findAllByCircles($userId, $limit = null, $offset = null) {
143 146
 		if (!$this->circlesEnabled) {
144 147
 			return [];
@@ -208,6 +211,9 @@  discard block
 block discarded – undo
208 211
 		return ($board->getOwner() === $userId);
209 212
 	}
210 213
 
214
+	/**
215
+	 * @param integer $id
216
+	 */
211 217
 	public function findBoardId($id) {
212 218
 		return $id;
213 219
 	}
Please login to merge, or discard this patch.
lib/Service/FullTextSearchService.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -98,7 +98,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 
Please login to merge, or discard this patch.
lib/Collaboration/Resources/ResourceProviderCard.php 2 patches
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -134,7 +134,7 @@
 block discarded – undo
134 134
 	}
135 135
 
136 136
 	/**
137
-	 * @param $cardId
137
+	 * @param string $cardId
138 138
 	 * @return Board
139 139
 	 * @throws DoesNotExistException
140 140
 	 * @throws MultipleObjectsReturnedException
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -151,7 +151,7 @@
 block discarded – undo
151 151
 		} catch (QueryException $e) {
152 152
 		}
153 153
 		if ($cardId !== null) {
154
-			$resource = $resourceManager->getResourceForUser(self::RESOURCE_TYPE, (string)$cardId, null);
154
+			$resource = $resourceManager->getResourceForUser(self::RESOURCE_TYPE, (string) $cardId, null);
155 155
 			$resourceManager->invalidateAccessCacheForResource($resource);
156 156
 		} else {
157 157
 			$resourceManager->invalidateAccessCacheForProvider($this);
Please login to merge, or discard this patch.
lib/Service/StackService.php 1 patch
Doc Comments   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -326,8 +326,8 @@
 block discarded – undo
326 326
 	}
327 327
 
328 328
 	/**
329
-	 * @param $id
330
-	 * @param $order
329
+	 * @param integer $id
330
+	 * @param integer $order
331 331
 	 *
332 332
 	 * @return array
333 333
 	 * @throws \OCA\Deck\NoPermissionException
Please login to merge, or discard this patch.
lib/AppInfo/Application.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -167,7 +167,7 @@  discard block
 block discarded – undo
167 167
 	 * @throws \OCP\AppFramework\QueryException
168 168
 	 */
169 169
 	protected function registerCommentsEventHandler() {
170
-		$this->getContainer()->getServer()->getCommentsManager()->registerEventHandler(function () {
170
+		$this->getContainer()->getServer()->getCommentsManager()->registerEventHandler(function() {
171 171
 			return $this->getContainer()->query(CommentEventHandler::class);
172 172
 		});
173 173
 	}
@@ -196,7 +196,7 @@  discard block
 block discarded – undo
196 196
 		$resourceManager->registerResourceProvider(\OCA\Deck\Collaboration\Resources\ResourceProvider::class);
197 197
 		$resourceManager->registerResourceProvider(\OCA\Deck\Collaboration\Resources\ResourceProviderCard::class);
198 198
 
199
-		\OC::$server->getEventDispatcher()->addListener('\OCP\Collaboration\Resources::loadAdditionalScripts', function () {
199
+		\OC::$server->getEventDispatcher()->addListener('\OCP\Collaboration\Resources::loadAdditionalScripts', function() {
200 200
 			\OCP\Util::addScript('deck', 'collections');
201 201
 		});
202 202
 	}
Please login to merge, or discard this patch.
lib/Controller/CardController.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -55,7 +55,7 @@
 block discarded – undo
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
 	/**
Please login to merge, or discard this patch.
lib/Controller/StackController.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -88,7 +88,7 @@
 block discarded – undo
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
 	/**
Please login to merge, or discard this patch.