Passed
Pull Request — master (#1545)
by Julius
03:01
created
lib/Provider/DeckProvider.php 3 patches
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -77,7 +77,7 @@
 block discarded – undo
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(
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -240,7 +240,7 @@
 block discarded – undo
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) {
Please login to merge, or discard this patch.
Unused Use Statements   -1 removed lines patch added patch discarded remove patch
@@ -44,7 +44,6 @@
 block discarded – undo
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
 /**
Please login to merge, or discard this patch.
lib/Service/LabelService.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -94,7 +94,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 				}
Please login to merge, or discard this patch.
lib/Collaboration/Resources/ResourceProvider.php 3 patches
Doc Comments   -1 removed lines patch added patch discarded remove patch
@@ -55,7 +55,6 @@
 block discarded – undo
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
 	 */
Please login to merge, or discard this patch.
Unused Use Statements   -2 removed lines patch added patch discarded remove patch
@@ -25,7 +25,6 @@  discard block
 block discarded – undo
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
 block discarded – undo
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 {
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -124,7 +124,7 @@
 block discarded – undo
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);
Please login to merge, or discard this patch.
lib/Db/Acl.php 1 patch
Doc Comments   +3 added lines patch added patch discarded remove patch
@@ -53,6 +53,9 @@
 block discarded – undo
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:
Please login to merge, or discard this patch.
lib/Service/PermissionService.php 2 patches
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -157,7 +157,7 @@
 block discarded – undo
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) {
Please login to merge, or discard this patch.
Unused Use Statements   -1 removed lines patch added patch discarded remove patch
@@ -33,7 +33,6 @@
 block discarded – undo
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;
Please login to merge, or discard this patch.
lib/Middleware/ExceptionMiddleware.php 1 patch
Unused Use Statements   -1 removed lines patch added patch discarded remove patch
@@ -23,7 +23,6 @@
 block discarded – undo
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;
Please login to merge, or discard this patch.
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/Activity/ActivityManager.php 2 patches
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -133,7 +133,7 @@  discard block
 block discarded – undo
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}');
@@ -302,10 +302,10 @@  discard block
 block discarded – undo
302 302
 		try {
303 303
 			$object = $this->findObjectForEntity($objectType, $entity);
304 304
 		} catch (DoesNotExistException $e) {
305
-			\OC::$server->getLogger()->error('Could not create activity entry for ' . $subject . '. Entity not found.', (array)$entity);
305
+			\OC::$server->getLogger()->error('Could not create activity entry for ' . $subject . '. Entity not found.', (array) $entity);
306 306
 			return null;
307 307
 		} catch (MultipleObjectsReturnedException $e) {
308
-			\OC::$server->getLogger()->error('Could not create activity entry for ' . $subject . '. Entity not found.', (array)$entity);
308
+			\OC::$server->getLogger()->error('Could not create activity entry for ' . $subject . '. Entity not found.', (array) $entity);
309 309
 			return null;
310 310
 		}
311 311
 
@@ -375,7 +375,7 @@  discard block
 block discarded – undo
375 375
 				break;
376 376
 		}
377 377
 
378
-		if ($subject === self::SUBJECT_CARD_UPDATE_DESCRIPTION){
378
+		if ($subject === self::SUBJECT_CARD_UPDATE_DESCRIPTION) {
379 379
 			$card = $subjectParams['card'];
380 380
 			if ($card->getLastEditor() === $this->userId) {
381 381
 				return null;
@@ -394,7 +394,7 @@  discard block
 block discarded – undo
394 394
 		$event->setApp('deck')
395 395
 			->setType($eventType)
396 396
 			->setAuthor($author === null ? $this->userId : $author)
397
-			->setObject($objectType, (int)$object->getId(), $object->getTitle())
397
+			->setObject($objectType, (int) $object->getId(), $object->getTitle())
398 398
 			->setSubject($subject, array_merge($subjectParams, $additionalParams))
399 399
 			->setTimestamp(time());
400 400
 
@@ -455,7 +455,7 @@  discard block
 block discarded – undo
455 455
 					$objectId = $entity->getObjectId();
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->cardMapper->find($objectId);
461 461
 		}
@@ -470,11 +470,11 @@  discard block
 block discarded – undo
470 470
 					$objectId = $entity->getBoardId();
471 471
 					break;
472 472
 				default:
473
-					throw new InvalidArgumentException('No entity relation present for '. $className . ' to ' . $objectType);
473
+					throw new InvalidArgumentException('No entity relation present for ' . $className . ' to ' . $objectType);
474 474
 			}
475 475
 			return $this->boardMapper->find($objectId);
476 476
 		}
477
-		throw new InvalidArgumentException('No entity relation present for '. $className . ' to ' . $objectType);
477
+		throw new InvalidArgumentException('No entity relation present for ' . $className . ' to ' . $objectType);
478 478
 	}
479 479
 
480 480
 	private function findDetailsForStack($stackId) {
Please login to merge, or discard this patch.
Doc Comments   +4 added lines, -1 removed lines patch added patch discarded remove patch
@@ -127,7 +127,7 @@  discard block
 block discarded – undo
127 127
 	}
128 128
 
129 129
 	/**
130
-	 * @param $subjectIdentifier
130
+	 * @param string $subjectIdentifier
131 131
 	 * @param array $subjectParams
132 132
 	 * @param bool $ownActivity
133 133
 	 * @return string
@@ -240,6 +240,9 @@  discard block
 block discarded – undo
240 240
 		return $subject;
241 241
 	}
242 242
 
243
+	/**
244
+	 * @param \OCP\AppFramework\Db\Entity $entity
245
+	 */
243 246
 	public function triggerEvent($objectType, $entity, $subject, $additionalParams = [], $author = null) {
244 247
 		try {
245 248
 			$event = $this->createEvent($objectType, $entity, $subject, $additionalParams, $author);
Please login to merge, or discard this patch.