Passed
Pull Request — master (#1554)
by
unknown
07:15 queued 04:36
created
lib/Db/LabelMapper.php 1 patch
Doc Comments   +6 added lines patch added patch discarded remove patch
@@ -66,6 +66,9 @@  discard block
 block discarded – undo
66 66
 		return $result;
67 67
 	}
68 68
 
69
+	/**
70
+	 * @param integer $labelId
71
+	 */
69 72
 	public function deleteLabelAssignments($labelId) {
70 73
 		$sql = 'DELETE FROM `*PREFIX*deck_assigned_labels` WHERE label_id = ?';
71 74
 		$stmt = $this->db->prepare($sql);
@@ -73,6 +76,9 @@  discard block
 block discarded – undo
73 76
 		$stmt->execute();
74 77
 	}
75 78
 
79
+	/**
80
+	 * @param integer $cardId
81
+	 */
76 82
 	public function deleteLabelAssignmentsForCard($cardId) {
77 83
 		$sql = 'DELETE FROM `*PREFIX*deck_assigned_labels` WHERE card_id = ?';
78 84
 		$stmt = $this->db->prepare($sql);
Please login to merge, or discard this patch.
lib/Activity/ActivityManager.php 2 patches
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -124,7 +124,7 @@
 block discarded – undo
124 124
 	}
125 125
 
126 126
 	/**
127
-	 * @param $subjectIdentifier
127
+	 * @param string $subjectIdentifier
128 128
 	 * @param array $subjectParams
129 129
 	 * @param bool $ownActivity
130 130
 	 * @return string
Please login to merge, or discard this patch.
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.
lib/Service/CardService.php 2 patches
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -91,8 +91,8 @@
 block discarded – undo
91 91
 		$card->setLabels($this->labelMapper->findAssignedLabelsForCard($cardId));
92 92
 		$card->setAttachmentCount($this->attachmentService->count($cardId));
93 93
 		$user = $this->userManager->get($this->currentUser);
94
-		$lastRead = $this->commentsManager->getReadMark('deckCard', (string)$card->getId(), $user);
95
-		$count = $this->commentsManager->getNumberOfCommentsForObject('deckCard', (string)$card->getId(), $lastRead);
94
+		$lastRead = $this->commentsManager->getReadMark('deckCard', (string) $card->getId(), $user);
95
+		$count = $this->commentsManager->getNumberOfCommentsForObject('deckCard', (string) $card->getId(), $lastRead);
96 96
 		$card->setCommentsUnread($count);
97 97
 	}
98 98
 
Please login to merge, or discard this patch.
Doc Comments   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -147,7 +147,7 @@  discard block
 block discarded – undo
147 147
 	/**
148 148
 	 * @param $title
149 149
 	 * @param $stackId
150
-	 * @param $type
150
+	 * @param string $type
151 151
 	 * @param integer $order
152 152
 	 * @param $description
153 153
 	 * @param $owner
@@ -576,7 +576,7 @@  discard block
 block discarded – undo
576 576
 	/**
577 577
 	 * @param $cardId
578 578
 	 * @param $userId
579
-	 * @return bool|null|\OCP\AppFramework\Db\Entity
579
+	 * @return AssignedUsers|null
580 580
 	 * @throws BadRequestException
581 581
 	 * @throws \OCA\Deck\NoPermissionException
582 582
 	 * @throws \OCP\AppFramework\Db\DoesNotExistException
Please login to merge, or discard this patch.
lib/Db/ChangeHelper.php 2 patches
Unused Use Statements   -4 removed lines patch added patch discarded remove patch
@@ -23,13 +23,9 @@
 block discarded – undo
23 23
 
24 24
 namespace OCA\Deck\Db;
25 25
 
26
-use OCP\AppFramework\Db\DoesNotExistException;
27
-use OCP\ICache;
28 26
 use OCP\ICacheFactory;
29 27
 use OCP\IDBConnection;
30 28
 use OCP\IRequest;
31
-use OCP\IUserManager;
32
-use OCP\IGroupManager;
33 29
 
34 30
 class ChangeHelper {
35 31
 
Please login to merge, or discard this patch.
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -61,7 +61,7 @@  discard block
 block discarded – undo
61 61
 	public function cardChanged($cardId, $updateCard = true) {
62 62
 		$time = time();
63 63
 		$etag = md5($time . microtime());
64
-		$this->cache->set(self::TYPE_CARD . '-' .$cardId, $etag);
64
+		$this->cache->set(self::TYPE_CARD . '-' . $cardId, $etag);
65 65
 		if ($updateCard) {
66 66
 			$sql = 'UPDATE `*PREFIX*deck_cards` SET `last_modified` = ?, `last_editor` = ? WHERE `id` = ?';
67 67
 			$this->db->executeUpdate($sql, [time(), $this->userId, $cardId]);
@@ -78,7 +78,7 @@  discard block
 block discarded – undo
78 78
 	public function stackChanged($stackId, $updateBoard = true) {
79 79
 		$time = time();
80 80
 		$etag = md5($time . microtime());
81
-		$this->cache->set(self::TYPE_CARD . '-' .$stackId, $etag);
81
+		$this->cache->set(self::TYPE_CARD . '-' . $stackId, $etag);
82 82
 		if ($updateBoard) {
83 83
 			$sql = 'UPDATE `*PREFIX*deck_stacks` SET `last_modified` = ? WHERE `id` = ?';
84 84
 			$this->db->executeUpdate($sql, [time(), $stackId]);
@@ -94,7 +94,7 @@  discard block
 block discarded – undo
94 94
 	}
95 95
 
96 96
 	public function getEtag($type, $id) {
97
-		$entry = $this->cache->get($type . '-' .$id);
97
+		$entry = $this->cache->get($type . '-' . $id);
98 98
 		if ($entry === 'null') {
99 99
 			return '';
100 100
 		}
Please login to merge, or discard this patch.
lib/Controller/AttachmentApiController.php 1 patch
Indentation   +34 added lines, -34 removed lines patch added patch discarded remove patch
@@ -31,76 +31,76 @@
 block discarded – undo
31 31
 
32 32
 class AttachmentApiController extends ApiController {
33 33
 
34
-    private $attachmentService;
34
+	private $attachmentService;
35 35
 
36
-    public function __construct($appName, IRequest $request, AttachmentService $attachmentService) {
37
-        parent::__construct($appName, $request);
38
-        $this->attachmentService = $attachmentService;
39
-    }
36
+	public function __construct($appName, IRequest $request, AttachmentService $attachmentService) {
37
+		parent::__construct($appName, $request);
38
+		$this->attachmentService = $attachmentService;
39
+	}
40 40
 
41
-    /**
41
+	/**
42 42
 	 * @NoAdminRequired
43 43
 	 * @CORS
44 44
 	 * @NoCSRFRequired
45 45
 	 *
46 46
 	 */
47
-    public function getAll() {
48
-        $attachment = $this->attachmentService->findAll($this->request->getParam('cardId'));
49
-        return new DataResponse($attachment, HTTP::STATUS_OK);
50
-    }
47
+	public function getAll() {
48
+		$attachment = $this->attachmentService->findAll($this->request->getParam('cardId'));
49
+		return new DataResponse($attachment, HTTP::STATUS_OK);
50
+	}
51 51
 
52
-    /**
52
+	/**
53 53
 	 * @NoAdminRequired
54 54
 	 * @CORS
55 55
 	 * @NoCSRFRequired
56 56
 	 *
57 57
 	 */
58
-    public function display() {
59
-        $attachment = $this->attachmentService->display($this->request->getParam('cardId'), $this->request->getParam('attachmentId'));
58
+	public function display() {
59
+		$attachment = $this->attachmentService->display($this->request->getParam('cardId'), $this->request->getParam('attachmentId'));
60 60
 		return $attachment;
61
-    }
61
+	}
62 62
 
63
-    /**
63
+	/**
64 64
 	 * @NoAdminRequired
65 65
 	 * @CORS
66 66
 	 * @NoCSRFRequired
67 67
 	 *
68 68
 	 */
69
-    public function create($type, $data) {
70
-        $attachment = $this->attachmentService->create($this->request->getParam('cardId'), $type, $data);
71
-        return new DataResponse($attachment, HTTP::STATUS_OK);
72
-    }
69
+	public function create($type, $data) {
70
+		$attachment = $this->attachmentService->create($this->request->getParam('cardId'), $type, $data);
71
+		return new DataResponse($attachment, HTTP::STATUS_OK);
72
+	}
73 73
 
74
-    /**
74
+	/**
75 75
 	 * @NoAdminRequired
76 76
 	 * @CORS
77 77
 	 * @NoCSRFRequired
78 78
 	 *
79 79
 	 */
80
-    public function update($data) {
81
-        $attachment = $this->attachmentService->update($this->request->getParam('cardId'), $this->request->getParam('attachmentId'), $data);
82
-        return new DataResponse($attachment, HTTP::STATUS_OK);
83
-    }
80
+	public function update($data) {
81
+		$attachment = $this->attachmentService->update($this->request->getParam('cardId'), $this->request->getParam('attachmentId'), $data);
82
+		return new DataResponse($attachment, HTTP::STATUS_OK);
83
+	}
84 84
 
85
-    /**
85
+	/**
86 86
 	 * @NoAdminRequired
87 87
 	 * @CORS
88 88
 	 * @NoCSRFRequired
89 89
 	 *
90 90
 	 */
91
-    public function delete() {
92
-        $attachment = $this->attachmentService->delete($this->request->getParam('cardId'), $this->request->getParam('attachmentId'));
93
-        return new DataResponse($attachment, HTTP::STATUS_OK);
94
-    }
91
+	public function delete() {
92
+		$attachment = $this->attachmentService->delete($this->request->getParam('cardId'), $this->request->getParam('attachmentId'));
93
+		return new DataResponse($attachment, HTTP::STATUS_OK);
94
+	}
95 95
 
96
-    /**
96
+	/**
97 97
 	 * @NoAdminRequired
98 98
 	 * @CORS
99 99
 	 * @NoCSRFRequired
100 100
 	 *
101 101
 	 */
102
-    public function restore() {
103
-        $attachment = $this->attachmentService->restore($this->request->getParam('cardId'), $this->request->getParam('attachmentId'));
104
-        return new DataResponse($attachment, HTTP::STATUS_OK);
105
-    }
102
+	public function restore() {
103
+		$attachment = $this->attachmentService->restore($this->request->getParam('cardId'), $this->request->getParam('attachmentId'));
104
+		return new DataResponse($attachment, HTTP::STATUS_OK);
105
+	}
106 106
 }
107 107
\ No newline at end of file
Please login to merge, or discard this patch.
lib/Controller/ConfigController.php 1 patch
Unused Use Statements   -3 removed lines patch added patch discarded remove patch
@@ -23,16 +23,13 @@
 block discarded – undo
23 23
 
24 24
 namespace OCA\Deck\Controller;
25 25
 
26
-use OCA\Deck\Service\DefaultBoardService;
27 26
 use OCP\AppFramework\Http\DataResponse;
28 27
 use OCP\AppFramework\Http\NotFoundResponse;
29 28
 use OCP\IConfig;
30 29
 use OCP\IGroup;
31 30
 use OCP\IGroupManager;
32 31
 use OCP\IRequest;
33
-use OCP\AppFramework\Http\TemplateResponse;
34 32
 use OCP\AppFramework\Controller;
35
-use OCP\IL10N;
36 33
 
37 34
 class ConfigController extends Controller {
38 35
 
Please login to merge, or discard this patch.
lib/Controller/PageController.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -63,7 +63,7 @@
 block discarded – undo
63 63
 	public function index() {
64 64
 		$params = [
65 65
 			'user' => $this->userId,
66
-			'maxUploadSize' => (int)\OCP\Util::uploadLimit(),
66
+			'maxUploadSize' => (int) \OCP\Util::uploadLimit(),
67 67
 			'canCreate' => $this->permissionService->canCreate()
68 68
 		];
69 69
 
Please login to merge, or discard this patch.
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.