Passed
Branch feature/109/file-attachments (c720f9)
by Julius
02:45
created
lib/Service/PermissionService.php 1 patch
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -89,7 +89,7 @@
 block discarded – undo
89 89
 	/**
90 90
 	 * Get current user permissions for a board
91 91
 	 *
92
-	 * @param Board|Entity $board
92
+	 * @param Board $board
93 93
 	 * @return array|bool
94 94
 	 * @internal param $boardId
95 95
 	 */
Please login to merge, or discard this patch.
lib/Db/CardMapper.php 1 patch
Doc Comments   +4 added lines, -1 removed lines patch added patch discarded remove patch
@@ -92,7 +92,7 @@  discard block
 block discarded – undo
92 92
 
93 93
 	/**
94 94
 	 * @param $id
95
-	 * @return RelationalEntity if not found
95
+	 * @return Entity if not found
96 96
 	 * @throws \OCP\AppFramework\Db\MultipleObjectsReturnedException
97 97
 	 * @throws \OCP\AppFramework\Db\DoesNotExistException
98 98
 	 */
@@ -136,6 +136,9 @@  discard block
 block discarded – undo
136 136
 		return parent::delete($entity);
137 137
 	}
138 138
 
139
+	/**
140
+	 * @param integer $stackId
141
+	 */
139 142
 	public function deleteByStack($stackId) {
140 143
 		$cards = $this->findAllByStack($stackId);
141 144
 		foreach ($cards as $card) {
Please login to merge, or discard this patch.
lib/Db/AssignedUsersMapper.php 1 patch
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -63,7 +63,7 @@
 block discarded – undo
63 63
 	 * Check if user exists before assigning it to a card
64 64
 	 *
65 65
 	 * @param Entity $entity
66
-	 * @return null|Entity
66
+	 * @return AssignedUsers|null
67 67
 	 */
68 68
 	public function insert(Entity $entity) {
69 69
 		$user = $this->userManager->get($entity->getParticipant());
Please login to merge, or discard this patch.
lib/Service/AttachmentService.php 1 patch
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -163,7 +163,7 @@
 block discarded – undo
163 163
 	 * @param $cardId
164 164
 	 * @param $attachmentId
165 165
 	 * @param $request
166
-	 * @return mixed
166
+	 * @return \OCP\AppFramework\Db\Entity
167 167
 	 * @throws \OCA\Deck\NoPermissionException
168 168
 	 * @throws \OCP\AppFramework\Db\DoesNotExistException
169 169
 	 * @throws \OCP\AppFramework\Db\MultipleObjectsReturnedException
Please login to merge, or discard this patch.
lib/Service/StackService.php 1 patch
Unused Use Statements   -2 removed lines patch added patch discarded remove patch
@@ -30,8 +30,6 @@
 block discarded – undo
30 30
 use OCA\Deck\Db\Stack;
31 31
 use OCA\Deck\Db\StackMapper;
32 32
 use OCA\Deck\StatusException;
33
-use OCP\ICache;
34
-use OCP\ICacheFactory;
35 33
 
36 34
 
37 35
 class StackService {
Please login to merge, or discard this patch.
lib/Db/AttachmentMapper.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -53,7 +53,7 @@  discard block
 block discarded – undo
53 53
 		$qb = $this->db->getQueryBuilder();
54 54
 		$qb->select('*')
55 55
 			->from('deck_attachment')
56
-			->where($qb->expr()->eq('id', (string)$id));
56
+			->where($qb->expr()->eq('id', (string) $id));
57 57
 
58 58
 		$cursor = $qb->execute();
59 59
 		$row = $cursor->fetch(PDO::FETCH_ASSOC);
@@ -71,13 +71,13 @@  discard block
 block discarded – undo
71 71
 		$qb = $this->db->getQueryBuilder();
72 72
 		$qb->select('*')
73 73
 			->from('deck_attachment')
74
-			->where($qb->expr()->eq('card_id', (string)$cardId, IQueryBuilder::PARAM_INT))
75
-			->andWhere($qb->expr()->eq('deleted_at', (string)0, IQueryBuilder::PARAM_INT));
74
+			->where($qb->expr()->eq('card_id', (string) $cardId, IQueryBuilder::PARAM_INT))
75
+			->andWhere($qb->expr()->eq('deleted_at', (string) 0, IQueryBuilder::PARAM_INT));
76 76
 
77 77
 
78 78
 		$entities = [];
79 79
 		$cursor = $qb->execute();
80
-		while($row = $cursor->fetch()){
80
+		while ($row = $cursor->fetch()) {
81 81
 			$entities[] = $this->mapRowToEntity($row);
82 82
 		}
83 83
 		$cursor->closeCursor();
@@ -93,16 +93,16 @@  discard block
 block discarded – undo
93 93
 			->where($qb->expr()->gt('deleted_at', '0', IQueryBuilder::PARAM_INT));
94 94
 		if ($withOffset) {
95 95
 			$qb
96
-				->andWhere($qb->expr()->lt('deleted_at', (string)$timeLimit, IQueryBuilder::PARAM_INT));
96
+				->andWhere($qb->expr()->lt('deleted_at', (string) $timeLimit, IQueryBuilder::PARAM_INT));
97 97
 		}
98 98
 		if ($cardId !== null) {
99 99
 			$qb
100
-				->andWhere($qb->expr()->eq('card_id', (string)$cardId, IQueryBuilder::PARAM_INT));
100
+				->andWhere($qb->expr()->eq('card_id', (string) $cardId, IQueryBuilder::PARAM_INT));
101 101
 		}
102 102
 
103 103
 		$entities = [];
104 104
 		$cursor = $qb->execute();
105
-		while($row = $cursor->fetch()){
105
+		while ($row = $cursor->fetch()) {
106 106
 			$entities[] = $this->mapRowToEntity($row);
107 107
 		}
108 108
 		$cursor->closeCursor();
Please login to merge, or discard this patch.
lib/Service/FileService.php 2 patches
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -68,7 +68,7 @@  discard block
 block discarded – undo
68 68
 	 * @throws NotPermittedException
69 69
 	 */
70 70
 	private function getFolder(Attachment $attachment) {
71
-		$folderName = 'file-card-' . (int)$attachment->getCardId();
71
+		$folderName = 'file-card-' . (int) $attachment->getCardId();
72 72
 		try {
73 73
 			$folder = $this->appData->getFolder($folderName);
74 74
 		} catch (NotFoundException $e) {
@@ -94,7 +94,7 @@  discard block
 block discarded – undo
94 94
 		return $attachment;
95 95
 	}
96 96
 
97
-	private function getUploadedFile () {
97
+	private function getUploadedFile() {
98 98
 		$file = $this->request->getUploadedFile('file');
99 99
 		$error = null;
100 100
 		$phpFileUploadErrors = [
Please login to merge, or discard this patch.
Unused Use Statements   -2 removed lines patch added patch discarded remove patch
@@ -24,10 +24,8 @@
 block discarded – undo
24 24
 namespace OCA\Deck\Service;
25 25
 
26 26
 
27
-use OC\Security\CSP\ContentSecurityPolicyManager;
28 27
 use OCA\Deck\Db\Attachment;
29 28
 use OCP\AppFramework\Http\ContentSecurityPolicy;
30
-use OCP\AppFramework\Http\EmptyContentSecurityPolicy;
31 29
 use OCP\AppFramework\Http\FileDisplayResponse;
32 30
 use OCP\Files\IAppData;
33 31
 use OCP\Files\NotFoundException;
Please login to merge, or discard this patch.