Passed
Pull Request — master (#960)
by Julius
02:13
created
lib/Activity/ActivityManager.php 1 patch
Spacing   +6 added lines, -6 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}');
@@ -373,7 +373,7 @@  discard block
 block discarded – undo
373 373
 				break;
374 374
 		}
375 375
 
376
-		if ($subject === self::SUBJECT_CARD_UPDATE_DESCRIPTION){
376
+		if ($subject === self::SUBJECT_CARD_UPDATE_DESCRIPTION) {
377 377
 			$card = $subjectParams['card'];
378 378
 			if ($card->getLastEditor() === $this->userId) {
379 379
 				return null;
@@ -392,7 +392,7 @@  discard block
 block discarded – undo
392 392
 		$event->setApp('deck')
393 393
 			->setType($eventType)
394 394
 			->setAuthor($author === null ? $this->userId : $author)
395
-			->setObject($objectType, (int)$object->getId(), $object->getTitle())
395
+			->setObject($objectType, (int) $object->getId(), $object->getTitle())
396 396
 			->setSubject($subject, array_merge($subjectParams, $additionalParams))
397 397
 			->setTimestamp(time());
398 398
 
@@ -453,7 +453,7 @@  discard block
 block discarded – undo
453 453
 					$objectId = $entity->getObjectId();
454 454
 					break;
455 455
 				default:
456
-					throw new InvalidArgumentException('No entity relation present for '. $className . ' to ' . $objectType);
456
+					throw new InvalidArgumentException('No entity relation present for ' . $className . ' to ' . $objectType);
457 457
 			}
458 458
 			return $this->cardMapper->find($objectId);
459 459
 		}
@@ -468,11 +468,11 @@  discard block
 block discarded – undo
468 468
 					$objectId = $entity->getBoardId();
469 469
 					break;
470 470
 				default:
471
-					throw new InvalidArgumentException('No entity relation present for '. $className . ' to ' . $objectType);
471
+					throw new InvalidArgumentException('No entity relation present for ' . $className . ' to ' . $objectType);
472 472
 			}
473 473
 			return $this->boardMapper->find($objectId);
474 474
 		}
475
-		throw new InvalidArgumentException('No entity relation present for '. $className . ' to ' . $objectType);
475
+		throw new InvalidArgumentException('No entity relation present for ' . $className . ' to ' . $objectType);
476 476
 	}
477 477
 
478 478
 	private function findDetailsForStack($stackId) {
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/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/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   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -96,7 +96,7 @@  discard block
 block discarded – undo
96 96
 	public function findAll($since = 0, $details = null) {
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);
99
+		$groupBoards = $this->boardMapper->findAllByGroups($userInfo['user'], $userInfo['groups'], null, null, $since);
100 100
 		$complete = array_merge($userBoards, $groupBoards);
101 101
 		$result = [];
102 102
 		/** @var Board $item */
@@ -136,7 +136,7 @@  discard block
 block discarded – undo
136 136
 	 */
137 137
 	public function find($boardId) {
138 138
 
139
-		if ( is_numeric($boardId) === false ) {
139
+		if (is_numeric($boardId) === false) {
140 140
 			throw new BadRequestException('board id must be a number');
141 141
 		}
142 142
 
@@ -184,7 +184,7 @@  discard block
 block discarded – undo
184 184
 	 */
185 185
 	public function isArchived($mapper, $id) {
186 186
 
187
-		if (is_numeric($id) === false)  {
187
+		if (is_numeric($id) === false) {
188 188
 			throw new BadRequestException('id must be a number');
189 189
 		}
190 190
 
@@ -218,7 +218,7 @@  discard block
 block discarded – undo
218 218
 			throw new BadRequestException('mapper must be provided');
219 219
 		}
220 220
 
221
-		if (is_numeric($id) === false)  {
221
+		if (is_numeric($id) === false) {
222 222
 			throw new BadRequestException('id must be a number');
223 223
 		}
224 224
 
@@ -356,7 +356,7 @@  discard block
 block discarded – undo
356 356
 	 * @throws BadRequestException
357 357
 	 */
358 358
 	public function deleteForce($id) {
359
-		if (is_numeric($id) === false)  {
359
+		if (is_numeric($id) === false) {
360 360
 			throw new BadRequestException('id must be a number');
361 361
 		}
362 362
 
@@ -390,7 +390,7 @@  discard block
 block discarded – undo
390 390
 			throw new BadRequestException('color must be provided');
391 391
 		}
392 392
 
393
-		if ( is_bool($archived) === false ) {
393
+		if (is_bool($archived) === false) {
394 394
 			throw new BadRequestException('archived must be a boolean');
395 395
 		}
396 396
 
@@ -538,7 +538,7 @@  discard block
 block discarded – undo
538 538
 	private function enrichWithStacks($board, $since = -1) {
539 539
 		$stacks = $this->stackMapper->findAll($board->getId(), null, null, $since);
540 540
 
541
-		if(\count($stacks) === 0) {
541
+		if (\count($stacks) === 0) {
542 542
 			return;
543 543
 		}
544 544
 
@@ -548,7 +548,7 @@  discard block
 block discarded – undo
548 548
 	private function enrichWithLabels($board, $since = -1) {
549 549
 		$labels = $this->labelMapper->findAll($board->getId(), null, null, $since);
550 550
 
551
-		if(\count($labels) === 0) {
551
+		if (\count($labels) === 0) {
552 552
 			return;
553 553
 		}
554 554
 
@@ -557,7 +557,7 @@  discard block
 block discarded – undo
557 557
 
558 558
 	private function enrichWithUsers($board, $since = -1) {
559 559
 		$boardUsers = $this->permissionService->findUsers($board->getId());
560
-		if(\count($boardUsers) === 0) {
560
+		if (\count($boardUsers) === 0) {
561 561
 			return;
562 562
 		}
563 563
 		$board->setUsers(array_values($boardUsers));
Please login to merge, or discard this patch.