Completed
Pull Request — master (#977)
by Julius
02:46
created
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/Activity/DeckProvider.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -281,11 +281,11 @@
 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 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()
Please login to merge, or discard this patch.
lib/Provider/DeckProvider.php 1 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.
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/Controller/CardApiController.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -147,7 +147,7 @@
 block discarded – undo
147 147
 	 * Assign a user to a card
148 148
 	 */
149 149
 	public function assignUser($userId) {
150
-		$card = $this->cardService->assignUser($this->request->getParam('cardId'), $userId);;
150
+		$card = $this->cardService->assignUser($this->request->getParam('cardId'), $userId); ;
151 151
 		return new DataResponse($card, HTTP::STATUS_OK);
152 152
 	}
153 153
 
Please login to merge, or discard this patch.
lib/Collaboration/Resources/ResourceProvider.php 1 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/AppInfo/Application.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -155,7 +155,7 @@  discard block
 block discarded – undo
155 155
 	 * @throws \OCP\AppFramework\QueryException
156 156
 	 */
157 157
 	protected function registerCommentsEventHandler() {
158
-		$this->getContainer()->getServer()->getCommentsManager()->registerEventHandler(function () {
158
+		$this->getContainer()->getServer()->getCommentsManager()->registerEventHandler(function() {
159 159
 			return $this->getContainer()->query(CommentEventHandler::class);
160 160
 		});
161 161
 	}
@@ -175,7 +175,7 @@  discard block
 block discarded – undo
175 175
 		/** @var IManager $resourceManager */
176 176
 		$resourceManager = $this->getContainer()->query(IManager::class);
177 177
 		$resourceManager->registerResourceProvider(\OCA\Deck\Collaboration\Resources\ResourceProvider::class);
178
-		\OC::$server->getEventDispatcher()->addListener('\OCP\Collaboration\Resources::loadAdditionalScripts', function () {
178
+		\OC::$server->getEventDispatcher()->addListener('\OCP\Collaboration\Resources::loadAdditionalScripts', function() {
179 179
 			\OCP\Util::addScript('deck', 'build/collections');
180 180
 		});
181 181
 	}
Please login to merge, or discard this patch.
lib/Service/BoardService.php 1 patch
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -97,8 +97,8 @@  discard block
 block discarded – undo
97 97
 	public function findAll($since = 0, $details = null) {
98 98
 		$userInfo = $this->getBoardPrerequisites();
99 99
 		$userBoards = $this->boardMapper->findAllByUser($userInfo['user'], null, null, $since);
100
-		$groupBoards = $this->boardMapper->findAllByGroups($userInfo['user'], $userInfo['groups'],null, null,  $since);
101
-		$circleBoards = $this->boardMapper->findAllByCircles($userInfo['user'], null, null,  $since);
100
+		$groupBoards = $this->boardMapper->findAllByGroups($userInfo['user'], $userInfo['groups'], null, null, $since);
101
+		$circleBoards = $this->boardMapper->findAllByCircles($userInfo['user'], null, null, $since);
102 102
 		$complete = array_merge($userBoards, $groupBoards, $circleBoards);
103 103
 		$result = [];
104 104
 		/** @var Board $item */
@@ -138,7 +138,7 @@  discard block
 block discarded – undo
138 138
 	 */
139 139
 	public function find($boardId) {
140 140
 
141
-		if ( is_numeric($boardId) === false ) {
141
+		if (is_numeric($boardId) === false) {
142 142
 			throw new BadRequestException('board id must be a number');
143 143
 		}
144 144
 
@@ -186,7 +186,7 @@  discard block
 block discarded – undo
186 186
 	 */
187 187
 	public function isArchived($mapper, $id) {
188 188
 
189
-		if (is_numeric($id) === false)  {
189
+		if (is_numeric($id) === false) {
190 190
 			throw new BadRequestException('id must be a number');
191 191
 		}
192 192
 
@@ -220,7 +220,7 @@  discard block
 block discarded – undo
220 220
 			throw new BadRequestException('mapper must be provided');
221 221
 		}
222 222
 
223
-		if (is_numeric($id) === false)  {
223
+		if (is_numeric($id) === false) {
224 224
 			throw new BadRequestException('id must be a number');
225 225
 		}
226 226
 
@@ -358,7 +358,7 @@  discard block
 block discarded – undo
358 358
 	 * @throws BadRequestException
359 359
 	 */
360 360
 	public function deleteForce($id) {
361
-		if (is_numeric($id) === false)  {
361
+		if (is_numeric($id) === false) {
362 362
 			throw new BadRequestException('id must be a number');
363 363
 		}
364 364
 
@@ -392,7 +392,7 @@  discard block
 block discarded – undo
392 392
 			throw new BadRequestException('color must be provided');
393 393
 		}
394 394
 
395
-		if ( is_bool($archived) === false ) {
395
+		if (is_bool($archived) === false) {
396 396
 			throw new BadRequestException('archived must be a boolean');
397 397
 		}
398 398
 
@@ -554,7 +554,7 @@  discard block
 block discarded – undo
554 554
 	private function enrichWithStacks($board, $since = -1) {
555 555
 		$stacks = $this->stackMapper->findAll($board->getId(), null, null, $since);
556 556
 
557
-		if(\count($stacks) === 0) {
557
+		if (\count($stacks) === 0) {
558 558
 			return;
559 559
 		}
560 560
 
@@ -564,7 +564,7 @@  discard block
 block discarded – undo
564 564
 	private function enrichWithLabels($board, $since = -1) {
565 565
 		$labels = $this->labelMapper->findAll($board->getId(), null, null, $since);
566 566
 
567
-		if(\count($labels) === 0) {
567
+		if (\count($labels) === 0) {
568 568
 			return;
569 569
 		}
570 570
 
@@ -573,7 +573,7 @@  discard block
 block discarded – undo
573 573
 
574 574
 	private function enrichWithUsers($board, $since = -1) {
575 575
 		$boardUsers = $this->permissionService->findUsers($board->getId());
576
-		if(\count($boardUsers) === 0) {
576
+		if (\count($boardUsers) === 0) {
577 577
 			return;
578 578
 		}
579 579
 		$board->setUsers(array_values($boardUsers));
Please login to merge, or discard this patch.