Passed
Pull Request — master (#333)
by Morris
02:14
created
lib/Middleware/SharingMiddleware.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -60,7 +60,7 @@
 block discarded – undo
60 60
 	 */
61 61
 	public function afterException($controller, $methodName, \Exception $exception) {
62 62
 		if ($exception instanceof StatusException) {
63
-			if($this->config->getSystemValue('loglevel', Util::WARN) === Util::DEBUG) {
63
+			if ($this->config->getSystemValue('loglevel', Util::WARN) === Util::DEBUG) {
64 64
 				$this->logger->logException($exception);
65 65
 			}
66 66
 			return new JSONResponse([
Please login to merge, or discard this patch.
lib/Service/BoardService.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -53,10 +53,10 @@  discard block
 block discarded – undo
53 53
 		$groupBoards = $this->boardMapper->findAllByGroups($userInfo['user'], $userInfo['groups']);
54 54
 		$complete = array_merge($userBoards, $groupBoards);
55 55
 		$result = [];
56
-		foreach($complete as &$item) {
57
-			if(!array_key_exists($item->getId(), $result)) {
56
+		foreach ($complete as &$item) {
57
+			if (!array_key_exists($item->getId(), $result)) {
58 58
 				$this->boardMapper->mapOwner($item);
59
-				if($item->getAcl() !== null) {
59
+				if ($item->getAcl() !== null) {
60 60
 					foreach ($item->getAcl() as &$acl) {
61 61
 						$this->boardMapper->mapAcl($acl);
62 62
 					}
@@ -73,7 +73,7 @@  discard block
 block discarded – undo
73 73
 		$board = $this->boardMapper->find($boardId, true, true);
74 74
 		$this->boardMapper->mapOwner($board);
75 75
 		foreach ($board->getAcl() as &$acl) {
76
-			if($acl !== null) {
76
+			if ($acl !== null) {
77 77
 				$this->boardMapper->mapAcl($acl);
78 78
 			}
79 79
 		}
Please login to merge, or discard this patch.
lib/Migration/UnknownUsers.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -64,15 +64,15 @@
 block discarded – undo
64 64
 			$acls = $this->aclMapper->findAll($board->getId());
65 65
 			/** @var Acl $acl */
66 66
 			foreach ($acls as $acl) {
67
-				if($acl->getType() === Acl::PERMISSION_TYPE_USER) {
67
+				if ($acl->getType() === Acl::PERMISSION_TYPE_USER) {
68 68
 					$user = $this->userManager->get($acl->getParticipant());
69
-					if($user === null) {
69
+					if ($user === null) {
70 70
 						$this->aclMapper->delete($acl);
71 71
 					}
72 72
 				}
73
-				if($acl->getType() === Acl::PERMISSION_TYPE_GROUP) {
73
+				if ($acl->getType() === Acl::PERMISSION_TYPE_GROUP) {
74 74
 					$group = $this->groupManager->get($acl->getParticipant());
75
-					if($group === null) {
75
+					if ($group === null) {
76 76
 						$this->aclMapper->delete($acl);
77 77
 					}
78 78
 				}
Please login to merge, or discard this patch.
lib/Db/CardMapper.php 2 patches
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -129,11 +129,11 @@
 block discarded – undo
129 129
 		return $row['id'];
130 130
 	}
131 131
 
132
-	public function mapOwner(Card &$card) {
132
+	public function mapOwner(Card & $card) {
133 133
 		$userManager = $this->userManager;
134 134
 		$card->resolveRelation('owner', function($owner) use (&$userManager) {
135 135
 			$user = $userManager->get($owner);
136
-			if($user !== null) {
136
+			if ($user !== null) {
137 137
 				return new User($user);
138 138
 			}
139 139
 			return null;
Please login to merge, or discard this 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/Service/StackService.php 3 patches
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -84,7 +84,7 @@  discard block
 block discarded – undo
84 84
 
85 85
 	public function create($title, $boardId, $order) {
86 86
 		$this->permissionService->checkPermission(null, $boardId, Acl::PERMISSION_MANAGE);
87
-		if($this->boardService->isArchived(null, $boardId)) {
87
+		if ($this->boardService->isArchived(null, $boardId)) {
88 88
 			throw new StatusException('Operation not allowed. This board is archived.');
89 89
 		}
90 90
 		$stack = new Stack();
@@ -102,7 +102,7 @@  discard block
 block discarded – undo
102 102
 
103 103
 	public function update($id, $title, $boardId, $order) {
104 104
 		$this->permissionService->checkPermission($this->stackMapper, $id, Acl::PERMISSION_MANAGE);
105
-		if($this->boardService->isArchived($this->stackMapper, $id)) {
105
+		if ($this->boardService->isArchived($this->stackMapper, $id)) {
106 106
 			throw new StatusException('Operation not allowed. This board is archived.');
107 107
 		}
108 108
 		$stack = $this->stackMapper->find($id);
Please login to merge, or discard this patch.
Doc Comments   +3 added lines patch added patch discarded remove patch
@@ -85,6 +85,9 @@
 block discarded – undo
85 85
 		return $stacks;
86 86
 	}
87 87
 
88
+	/**
89
+	 * @param integer $order
90
+	 */
88 91
 	public function create($title, $boardId, $order) {
89 92
 		$this->permissionService->checkPermission(null, $boardId, Acl::PERMISSION_MANAGE);
90 93
 		if($this->boardService->isArchived(null, $boardId)) {
Please login to merge, or discard this patch.
Unused Use Statements   -3 removed lines patch added patch discarded remove patch
@@ -26,10 +26,7 @@
 block discarded – undo
26 26
 use OCA\Deck\Db\Acl;
27 27
 use OCA\Deck\Db\CardMapper;
28 28
 use OCA\Deck\Db\LabelMapper;
29
-
30
-
31 29
 use OCA\Deck\Db\Stack;
32
-
33 30
 use OCA\Deck\Db\StackMapper;
34 31
 use OCA\Deck\StatusException;
35 32
 
Please login to merge, or discard this patch.
lib/Service/LabelService.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -51,7 +51,7 @@  discard block
 block discarded – undo
51 51
 
52 52
 	public function create($title, $color, $boardId) {
53 53
 		$this->permissionService->checkPermission(null, $boardId, Acl::PERMISSION_MANAGE);
54
-		if($this->boardService->isArchived(null, $boardId)) {
54
+		if ($this->boardService->isArchived(null, $boardId)) {
55 55
 			throw new StatusException('Operation not allowed. This board is archived.');
56 56
 		}
57 57
 		$label = new Label();
@@ -63,7 +63,7 @@  discard block
 block discarded – undo
63 63
 
64 64
 	public function delete($id) {
65 65
 		$this->permissionService->checkPermission($this->labelMapper, $id, Acl::PERMISSION_MANAGE);
66
-		if($this->boardService->isArchived($this->labelMapper, $id)) {
66
+		if ($this->boardService->isArchived($this->labelMapper, $id)) {
67 67
 			throw new StatusException('Operation not allowed. This board is archived.');
68 68
 		}
69 69
 		return $this->labelMapper->delete($this->find($id));
@@ -71,7 +71,7 @@  discard block
 block discarded – undo
71 71
 
72 72
 	public function update($id, $title, $color) {
73 73
 		$this->permissionService->checkPermission($this->labelMapper, $id, Acl::PERMISSION_MANAGE);
74
-		if($this->boardService->isArchived($this->labelMapper, $id)) {
74
+		if ($this->boardService->isArchived($this->labelMapper, $id)) {
75 75
 			throw new StatusException('Operation not allowed. This board is archived.');
76 76
 		}
77 77
 		$label = $this->find($id);
Please login to merge, or discard this patch.
lib/Service/CardService.php 2 patches
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -52,7 +52,7 @@  discard block
 block discarded – undo
52 52
 
53 53
 	public function create($title, $stackId, $type, $order, $owner) {
54 54
 		$this->permissionService->checkPermission($this->stackMapper, $stackId, Acl::PERMISSION_EDIT);
55
-		if($this->boardService->isArchived($this->stackMapper, $stackId)) {
55
+		if ($this->boardService->isArchived($this->stackMapper, $stackId)) {
56 56
 			throw new StatusException('Operation not allowed. This board is archived.');
57 57
 		}
58 58
 		$card = new Card();
@@ -67,7 +67,7 @@  discard block
 block discarded – undo
67 67
 
68 68
 	public function delete($id) {
69 69
 		$this->permissionService->checkPermission($this->cardMapper, $id, Acl::PERMISSION_EDIT);
70
-		if($this->boardService->isArchived($this->cardMapper, $id)) {
70
+		if ($this->boardService->isArchived($this->cardMapper, $id)) {
71 71
 			throw new StatusException('Operation not allowed. This board is archived.');
72 72
 		}
73 73
 		return $this->cardMapper->delete($this->cardMapper->find($id));
@@ -75,7 +75,7 @@  discard block
 block discarded – undo
75 75
 
76 76
 	public function update($id, $title, $stackId, $type, $order, $description, $owner, $duedate) {
77 77
 		$this->permissionService->checkPermission($this->cardMapper, $id, Acl::PERMISSION_EDIT);
78
-		if($this->boardService->isArchived($this->cardMapper, $id)) {
78
+		if ($this->boardService->isArchived($this->cardMapper, $id)) {
79 79
 			throw new StatusException('Operation not allowed. This board is archived.');
80 80
 		}
81 81
 		$card = $this->cardMapper->find($id);
@@ -94,7 +94,7 @@  discard block
 block discarded – undo
94 94
 
95 95
 	public function rename($id, $title) {
96 96
 		$this->permissionService->checkPermission($this->cardMapper, $id, Acl::PERMISSION_EDIT);
97
-		if($this->boardService->isArchived($this->cardMapper, $id)) {
97
+		if ($this->boardService->isArchived($this->cardMapper, $id)) {
98 98
 			throw new StatusException('Operation not allowed. This board is archived.');
99 99
 		}
100 100
 		$card = $this->cardMapper->find($id);
@@ -107,7 +107,7 @@  discard block
 block discarded – undo
107 107
 
108 108
 	public function reorder($id, $stackId, $order) {
109 109
 		$this->permissionService->checkPermission($this->cardMapper, $id, Acl::PERMISSION_EDIT);
110
-		if($this->boardService->isArchived($this->cardMapper, $id)) {
110
+		if ($this->boardService->isArchived($this->cardMapper, $id)) {
111 111
 			throw new StatusException('Operation not allowed. This board is archived.');
112 112
 		}
113 113
 		$cards = $this->cardMapper->findAll($stackId);
@@ -138,7 +138,7 @@  discard block
 block discarded – undo
138 138
 
139 139
 	public function archive($id) {
140 140
 		$this->permissionService->checkPermission($this->cardMapper, $id, Acl::PERMISSION_EDIT);
141
-		if($this->boardService->isArchived($this->cardMapper, $id)) {
141
+		if ($this->boardService->isArchived($this->cardMapper, $id)) {
142 142
 			throw new StatusException('Operation not allowed. This board is archived.');
143 143
 		}
144 144
 		$card = $this->cardMapper->find($id);
@@ -148,7 +148,7 @@  discard block
 block discarded – undo
148 148
 
149 149
 	public function unarchive($id) {
150 150
 		$this->permissionService->checkPermission($this->cardMapper, $id, Acl::PERMISSION_EDIT);
151
-		if($this->boardService->isArchived($this->cardMapper, $id)) {
151
+		if ($this->boardService->isArchived($this->cardMapper, $id)) {
152 152
 			throw new StatusException('Operation not allowed. This board is archived.');
153 153
 		}
154 154
 		$card = $this->cardMapper->find($id);
@@ -158,7 +158,7 @@  discard block
 block discarded – undo
158 158
 
159 159
 	public function assignLabel($cardId, $labelId) {
160 160
 		$this->permissionService->checkPermission($this->cardMapper, $cardId, Acl::PERMISSION_EDIT);
161
-		if($this->boardService->isArchived($this->cardMapper, $cardId)) {
161
+		if ($this->boardService->isArchived($this->cardMapper, $cardId)) {
162 162
 			throw new StatusException('Operation not allowed. This board is archived.');
163 163
 		}
164 164
 		$card = $this->cardMapper->find($cardId);
@@ -170,7 +170,7 @@  discard block
 block discarded – undo
170 170
 
171 171
 	public function removeLabel($cardId, $labelId) {
172 172
 		$this->permissionService->checkPermission($this->cardMapper, $cardId, Acl::PERMISSION_EDIT);
173
-		if($this->boardService->isArchived($this->cardMapper, $cardId)) {
173
+		if ($this->boardService->isArchived($this->cardMapper, $cardId)) {
174 174
 			throw new StatusException('Operation not allowed. This board is archived.');
175 175
 		}
176 176
 		$card = $this->cardMapper->find($cardId);
Please login to merge, or discard this patch.
Doc Comments   +3 added lines patch added patch discarded remove patch
@@ -49,6 +49,9 @@
 block discarded – undo
49 49
 		return $this->cardMapper->find($cardId);
50 50
 	}
51 51
 
52
+	/**
53
+	 * @param integer $order
54
+	 */
52 55
 	public function create($title, $stackId, $type, $order, $owner) {
53 56
 		$this->permissionService->checkPermission($this->stackMapper, $stackId, Acl::PERMISSION_EDIT);
54 57
 		if($this->boardService->isArchived($this->stackMapper, $stackId)) {
Please login to merge, or discard this patch.
templates/main.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -38,7 +38,7 @@  discard block
 block discarded – undo
38 38
 Util::addScript('deck', 'vendor/markdown-it-link-target/dist/markdown-it-link-target.min');
39 39
 Util::addScript('deck', 'vendor/jquery-timepicker/jquery.ui.timepicker');
40 40
 
41
-if(!\OC::$server->getConfig()->getSystemValue('debug', false)) {
41
+if (!\OC::$server->getConfig()->getSystemValue('debug', false)) {
42 42
 	Util::addScript('deck', 'public/app');
43 43
 } else {
44 44
 	// Load seperate JS files when debug mode is enabled
@@ -49,9 +49,9 @@  discard block
 block discarded – undo
49 49
 		'filters' => ['boardFilterAcl', 'cardFilter', 'cardSearchFilter', 'iconWhiteFilter', 'lightenColorFilter', 'orderObjectBy', 'dateFilters', 'textColorFilter'],
50 50
 		'service' => ['ApiService', 'BoardService', 'CardService', 'LabelService', 'StackService', 'StatusService'],
51 51
 	];
52
-	foreach($js as $folder=>$files) {
52
+	foreach ($js as $folder=>$files) {
53 53
 		foreach ($files as $file) {
54
-			Util::addScript('deck', $folder.'/'.$file);
54
+			Util::addScript('deck', $folder . '/' . $file);
55 55
 		}
56 56
 	}
57 57
 }
Please login to merge, or discard this patch.
lib/AppInfo/Application.php 2 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -100,7 +100,7 @@
 block discarded – undo
100 100
 		$self = &$this;
101 101
 		$notificationManager->registerNotifier(function() use (&$self) {
102 102
 			return $self->getContainer()->query(Notifier::class);
103
-		}, function () {
103
+		}, function() {
104 104
 			return ['id' => 'deck', 'name' => 'Deck'];
105 105
 		});
106 106
 
Please login to merge, or discard this patch.
Unused Use Statements   -1 removed lines patch added patch discarded remove patch
@@ -29,7 +29,6 @@
 block discarded – undo
29 29
 use OCP\AppFramework\App;
30 30
 use OCA\Deck\Middleware\SharingMiddleware;
31 31
 use OCP\IGroup;
32
-
33 32
 use OCP\IUser;
34 33
 use OCP\IUserManager;
35 34
 use OCP\IURLGenerator;
Please login to merge, or discard this patch.