Passed
Pull Request — master (#988)
by Julius
03:00
created
lib/Activity/DeckProvider.php 2 patches
Doc Comments   +14 added lines patch added patch discarded remove patch
@@ -189,6 +189,9 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 	}
Please login to merge, or discard this patch.
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -281,9 +281,9 @@
 block discarded – undo
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
-				$params['comment'] =[
286
+				$params['comment'] = [
287 287
 					'type' => 'highlight',
288 288
 					'id' => $subjectParams['comment'],
289 289
 					'name' => $comment->getMessage()
Please login to merge, or discard this patch.
lib/Cron/CardDescriptionActivity.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -43,7 +43,7 @@
 block discarded – undo
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
 
Please login to merge, or discard this patch.
lib/Activity/CommentEventHandler.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -50,12 +50,12 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 		}
Please login to merge, or discard this patch.
lib/Controller/BoardApiController.php 1 patch
Unused Use Statements   -2 removed lines patch added patch discarded remove patch
@@ -26,10 +26,8 @@
 block discarded – undo
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
 
Please login to merge, or discard this patch.
lib/Notification/NotificationHelper.php 1 patch
Doc Comments   +6 added lines patch added patch discarded remove patch
@@ -95,6 +95,9 @@  discard block
 block discarded – undo
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
 block discarded – undo
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);
Please login to merge, or discard this patch.
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/FullTextSearchService.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -96,7 +96,7 @@  discard block
 block discarded – undo
96 96
 		$userId = $e->getArgument('userId');
97 97
 
98 98
 		$this->fullTextSearchManager->createIndex(
99
-			DeckProvider::DECK_PROVIDER_ID, (string)$cardId, $userId, IIndex::INDEX_FULL
99
+			DeckProvider::DECK_PROVIDER_ID, (string) $cardId, $userId, IIndex::INDEX_FULL
100 100
 		);
101 101
 	}
102 102
 
@@ -108,7 +108,7 @@  discard block
 block discarded – undo
108 108
 		$cardId = $e->getArgument('id');
109 109
 
110 110
 		$this->fullTextSearchManager->updateIndexStatus(
111
-			DeckProvider::DECK_PROVIDER_ID, (string)$cardId, IIndex::INDEX_CONTENT
111
+			DeckProvider::DECK_PROVIDER_ID, (string) $cardId, IIndex::INDEX_CONTENT
112 112
 		);
113 113
 	}
114 114
 
@@ -120,7 +120,7 @@  discard block
 block discarded – undo
120 120
 		$cardId = $e->getArgument('id');
121 121
 
122 122
 		$this->fullTextSearchManager->updateIndexStatus(
123
-			DeckProvider::DECK_PROVIDER_ID, (string)$cardId, IIndex::INDEX_REMOVE
123
+			DeckProvider::DECK_PROVIDER_ID, (string) $cardId, IIndex::INDEX_REMOVE
124 124
 		);
125 125
 	}
126 126
 
@@ -149,7 +149,7 @@  discard block
 block discarded – undo
149 149
 	 * @return IIndexDocument
150 150
 	 */
151 151
 	public function generateIndexDocumentFromCard(Card $card): IIndexDocument {
152
-		$document = new IndexDocument(DeckProvider::DECK_PROVIDER_ID, (string)$card->getId());
152
+		$document = new IndexDocument(DeckProvider::DECK_PROVIDER_ID, (string) $card->getId());
153 153
 
154 154
 		return $document;
155 155
 	}
@@ -163,7 +163,7 @@  discard block
 block discarded – undo
163 163
 	 */
164 164
 	public function fillIndexDocument(IIndexDocument $document) {
165 165
 		/** @var Card $card */
166
-		$card = $this->cardMapper->find((int)$document->getId());
166
+		$card = $this->cardMapper->find((int) $document->getId());
167 167
 
168 168
 		$document->setTitle($card->getTitle());
169 169
 		$document->setContent($card->getDescription());
@@ -230,7 +230,7 @@  discard block
 block discarded – undo
230 230
 	 * @throws MultipleObjectsReturnedException
231 231
 	 */
232 232
 	public function getBoardFromCardId(int $cardId): Board {
233
-		$boardId = (int)$this->cardMapper->findBoardId($cardId);
233
+		$boardId = (int) $this->cardMapper->findBoardId($cardId);
234 234
 		/** @var Board $board */
235 235
 		$board = $this->boardMapper->find($boardId);
236 236
 
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.