Passed
Pull Request — master (#1483)
by Julius
03:07
created
lib/Command/UserExport.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -99,16 +99,16 @@
 block discarded – undo
99 99
 		$data = [];
100 100
 		foreach ($boards as $board) {
101 101
 			$fullBoard = $this->boardMapper->find($board->getId(), true, true);
102
-			$data[$board->getId()] = (array)$fullBoard->jsonSerialize();
102
+			$data[$board->getId()] = (array) $fullBoard->jsonSerialize();
103 103
 			$stacks = $this->stackMapper->findAll($board->getId());
104 104
 			foreach ($stacks as $stack) {
105
-				$data[$board->getId()]['stacks'][] = (array)$stack->jsonSerialize();
105
+				$data[$board->getId()]['stacks'][] = (array) $stack->jsonSerialize();
106 106
 				$cards = $this->cardMapper->findAllByStack($stack->getId());
107 107
 				foreach ($cards as $card) {
108 108
 					$fullCard = $this->cardMapper->find($card->getId());
109 109
 					$assignedUsers = $this->assignedUsersMapper->find($card->getId());
110 110
 					$fullCard->setAssignedUsers($assignedUsers);
111
-					$data[$board->getId()]['stacks'][$stack->getId()]['cards'][] = (array)$fullCard->jsonSerialize();
111
+					$data[$board->getId()]['stacks'][$stack->getId()]['cards'][] = (array) $fullCard->jsonSerialize();
112 112
 				}
113 113
 			}
114 114
 		}
Please login to merge, or discard this patch.
lib/Service/FileService.php 2 patches
Unused Use Statements   -4 removed lines patch added patch discarded remove patch
@@ -23,15 +23,11 @@
 block discarded – undo
23 23
 
24 24
 namespace OCA\Deck\Service;
25 25
 
26
-use OC\Security\CSP\ContentSecurityPolicyManager;
27 26
 use OCA\Deck\Db\Attachment;
28 27
 use OCA\Deck\StatusException;
29 28
 use OCP\AppFramework\Http\ContentSecurityPolicy;
30
-use OCP\AppFramework\Http\EmptyContentSecurityPolicy;
31 29
 use OCP\AppFramework\Http\FileDisplayResponse;
32 30
 use OCP\AppFramework\Http\StreamResponse;
33
-use OCP\Files\Cache\IScanner;
34
-use OCP\Files\Folder;
35 31
 use OCP\Files\IAppData;
36 32
 use OCP\Files\IRootFolder;
37 33
 use OCP\Files\NotFoundException;
Please login to merge, or discard this patch.
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -85,7 +85,7 @@  discard block
 block discarded – undo
85 85
 	 * @throws NotPermittedException
86 86
 	 */
87 87
 	private function getFolder(Attachment $attachment) {
88
-		$folderName = 'file-card-' . (int)$attachment->getCardId();
88
+		$folderName = 'file-card-' . (int) $attachment->getCardId();
89 89
 		try {
90 90
 			$folder = $this->appData->getFolder($folderName);
91 91
 		} catch (NotFoundException $e) {
@@ -116,7 +116,7 @@  discard block
 block discarded – undo
116 116
 	 * @return array
117 117
 	 * @throws StatusException
118 118
 	 */
119
-	private function getUploadedFile () {
119
+	private function getUploadedFile() {
120 120
 		$file = $this->request->getUploadedFile('file');
121 121
 		$error = null;
122 122
 		$phpFileUploadErrors = [
@@ -190,7 +190,7 @@  discard block
 block discarded – undo
190 190
 	 * @throws \Exception
191 191
 	 */
192 192
 	private function getFileFromRootFolder(Attachment $attachment) {
193
-		$folderName = 'file-card-' . (int)$attachment->getCardId();
193
+		$folderName = 'file-card-' . (int) $attachment->getCardId();
194 194
 		$instanceId = $this->config->getSystemValue('instanceid', null);
195 195
 		if ($instanceId === null) {
196 196
 			throw new \Exception('no instance id!');
Please login to merge, or discard this patch.
lib/Db/AttachmentMapper.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -67,14 +67,14 @@  discard block
 block discarded – undo
67 67
 
68 68
 		$cursor = $qb->execute();
69 69
 		$row = $cursor->fetch(PDO::FETCH_ASSOC);
70
-		if($row === false) {
70
+		if ($row === false) {
71 71
 			$cursor->closeCursor();
72 72
 			throw new DoesNotExistException('Did expect one result but found none when executing' . $qb);
73 73
 		}
74 74
 
75 75
 		$row2 = $cursor->fetch();
76 76
 		$cursor->closeCursor();
77
-		if($row2 !== false ) {
77
+		if ($row2 !== false) {
78 78
 			throw new MultipleObjectsReturnedException('Did not expect more than one result when executing' . $query);
79 79
 		}
80 80
 
@@ -97,7 +97,7 @@  discard block
 block discarded – undo
97 97
 
98 98
 		$entities = [];
99 99
 		$cursor = $qb->execute();
100
-		while($row = $cursor->fetch()){
100
+		while ($row = $cursor->fetch()) {
101 101
 			$entities[] = $this->mapRowToEntity($row);
102 102
 		}
103 103
 		$cursor->closeCursor();
@@ -127,7 +127,7 @@  discard block
 block discarded – undo
127 127
 
128 128
 		$entities = [];
129 129
 		$cursor = $qb->execute();
130
-		while($row = $cursor->fetch()){
130
+		while ($row = $cursor->fetch()) {
131 131
 			$entities[] = $this->mapRowToEntity($row);
132 132
 		}
133 133
 		$cursor->closeCursor();
Please login to merge, or discard this patch.
appinfo/routes.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -112,6 +112,6 @@
 block discarded – undo
112 112
 		['name' => 'attachment_api#delete', 'url' => '/api/v1.0/boards/{boardId}/stacks/{stackId}/cards/{cardId}/attachments/{attachmentId}', 'verb' => 'DELETE'],
113 113
 		['name' => 'attachment_api#restore', 'url' => '/api/v1.0/boards/{boardId}/stacks/{stackId}/cards/{cardId}/attachments/{attachmentId}/restore', 'verb' => 'PUT'],
114 114
 
115
-		['name' => 'board_api#preflighted_cors', 'url' => '/api/v1.0/{path}','verb' => 'OPTIONS', 'requirements' => ['path' => '.+']],
115
+		['name' => 'board_api#preflighted_cors', 'url' => '/api/v1.0/{path}', 'verb' => 'OPTIONS', 'requirements' => ['path' => '.+']],
116 116
 	]
117 117
 ];
Please login to merge, or discard this patch.
lib/Controller/CardApiController.php 2 patches
Unused Use Statements   -1 removed lines patch added patch discarded remove patch
@@ -24,7 +24,6 @@
 block discarded – undo
24 24
  namespace OCA\Deck\Controller;
25 25
 
26 26
  use OCP\AppFramework\ApiController;
27
- use OCP\AppFramework\Http;
28 27
  use OCP\AppFramework\Http\DataResponse;
29 28
  use OCP\IRequest;
30 29
  use OCA\Deck\Service\CardService;
Please login to merge, or discard this 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.
appinfo/app.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -21,7 +21,7 @@
 block discarded – undo
21 21
  *
22 22
  */
23 23
 
24
-if ((@include_once __DIR__ . '/../vendor/autoload.php')===false) {
24
+if ((@include_once __DIR__ . '/../vendor/autoload.php') === false) {
25 25
 	throw new Exception('Cannot include autoload. Did you run install dependencies using composer?');
26 26
 }
27 27
 
Please login to merge, or discard this patch.
lib/Service/CardService.php 1 patch
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.
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/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.