Passed
Pull Request — master (#333)
by Morris
02:14
created
lib/Service/PermissionService.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -188,8 +188,8 @@  discard block
 block discarded – undo
188 188
 	 */
189 189
 	public function findUsers($boardId) {
190 190
 		// cache users of a board so we don't query them for every cards
191
-		if (array_key_exists((string)$boardId, $this->users)) {
192
-			return $this->users[(string)$boardId];
191
+		if (array_key_exists((string) $boardId, $this->users)) {
192
+			return $this->users[(string) $boardId];
193 193
 		}
194 194
 		try {
195 195
 			$board = $this->boardMapper->find($boardId);
@@ -206,14 +206,14 @@  discard block
 block discarded – undo
206 206
 				$user = $this->userManager->get($acl->getParticipant());
207 207
 				$users[$user->getUID()] = new User($user);
208 208
 			}
209
-			if($acl->getType() === Acl::PERMISSION_TYPE_GROUP) {
209
+			if ($acl->getType() === Acl::PERMISSION_TYPE_GROUP) {
210 210
 				$group = $this->groupManager->get($acl->getParticipant());
211 211
 				foreach ($group->getUsers() as $user) {
212 212
 					$users[$user->getUID()] = new User($user);
213 213
 				}
214 214
 			}
215 215
 		}
216
-		$this->users[(string)$boardId] = $users;
217
-		return $this->users[(string)$boardId];
216
+		$this->users[(string) $boardId] = $users;
217
+		return $this->users[(string) $boardId];
218 218
 	}
219 219
 }
220 220
\ No newline at end of file
Please login to merge, or discard this patch.
lib/Db/RelationalObject.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -52,7 +52,7 @@
 block discarded – undo
52 52
 	 * @throws \Exception
53 53
 	 */
54 54
 	public function getObjectSerialization() {
55
-		if($this->object instanceof \JsonSerializable) {
55
+		if ($this->object instanceof \JsonSerializable) {
56 56
 			$this->object->jsonSerialize();
57 57
 		} else {
58 58
 			throw new \Exception('jsonSerialize is not implemented on ' . get_class($this));
Please login to merge, or discard this patch.
lib/Db/RelationalEntity.php 1 patch
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -77,7 +77,7 @@  discard block
 block discarded – undo
77 77
 			}
78 78
 		}
79 79
 		foreach ($this->_resolvedProperties as $property => $value) {
80
-			if($value !== null) {
80
+			if ($value !== null) {
81 81
 				$json[$property] = $value;
82 82
 			}
83 83
 		}
@@ -107,29 +107,29 @@  discard block
 block discarded – undo
107 107
 	 */
108 108
 	public function resolveRelation($property, $resolver) {
109 109
 		$result = null;
110
-		if($property !== null && $this->$property !== null) {
110
+		if ($property !== null && $this->$property !== null) {
111 111
 			$result = $resolver($this->$property);
112 112
 		}
113 113
 
114
-		if($result instanceof RelationalObject || $result === null) {
114
+		if ($result instanceof RelationalObject || $result === null) {
115 115
 			$this->_resolvedProperties[$property] = $result;
116 116
 		} else {
117 117
 			throw new \Exception('resolver must return an instance of RelationalObject');
118 118
 		}
119 119
 	}
120 120
 
121
-	public function __call($methodName, $args){
122
-		$attr = lcfirst( substr($methodName, 7) );
123
-		if(array_key_exists($attr, $this->_resolvedProperties) && strpos($methodName, 'resolve') === 0) {
124
-			if($this->_resolvedProperties[$attr] !== null) {
121
+	public function __call($methodName, $args) {
122
+		$attr = lcfirst(substr($methodName, 7));
123
+		if (array_key_exists($attr, $this->_resolvedProperties) && strpos($methodName, 'resolve') === 0) {
124
+			if ($this->_resolvedProperties[$attr] !== null) {
125 125
 				return $this->_resolvedProperties[$attr];
126 126
 			}
127 127
 			return $this->getter($attr);
128 128
 		}
129 129
 
130
-		$attr = lcfirst( substr($methodName, 3) );
131
-		if(array_key_exists($attr, $this->_resolvedProperties) && strpos($methodName, 'set') === 0) {
132
-			if(!is_scalar($args[0])) {
130
+		$attr = lcfirst(substr($methodName, 3));
131
+		if (array_key_exists($attr, $this->_resolvedProperties) && strpos($methodName, 'set') === 0) {
132
+			if (!is_scalar($args[0])) {
133 133
 				$args[0] = $args[0]['primaryKey'];
134 134
 			}
135 135
 			parent::setter($attr, $args);
Please login to merge, or discard this patch.
lib/Db/Card.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -64,7 +64,7 @@  discard block
 block discarded – undo
64 64
 	}
65 65
 
66 66
 	public function getDuedate($isoFormat = false) {
67
-		if($this->duedate === null) {
67
+		if ($this->duedate === null) {
68 68
 			return null;
69 69
 		}
70 70
 		$dt = new DateTime($this->duedate);
@@ -80,16 +80,16 @@  discard block
 block discarded – undo
80 80
 		$due = strtotime($this->duedate);
81 81
 
82 82
 		$today = new DateTime();
83
-		$today->setTime( 0, 0);
83
+		$today->setTime(0, 0);
84 84
 
85 85
 		$match_date = new DateTime($this->duedate);
86 86
 
87
-		$match_date->setTime( 0, 0);
87
+		$match_date->setTime(0, 0);
88 88
 
89
-		$diff = $today->diff( $match_date );
90
-		$diffDays = (integer)$diff->format('%R%a'); // Extract days count in interval
89
+		$diff = $today->diff($match_date);
90
+		$diffDays = (integer) $diff->format('%R%a'); // Extract days count in interval
91 91
 
92
-		if($due !== false) {
92
+		if ($due !== false) {
93 93
 			if ($diffDays === 1) {
94 94
 				$json['overdue'] = self::DUEDATE_NEXT;
95 95
 			}
Please login to merge, or discard this patch.
lib/Db/BoardMapper.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -140,7 +140,7 @@  discard block
 block discarded – undo
140 140
 
141 141
 	public function findToDelete() {
142 142
 		// add buffer of 5 min
143
-		$timeLimit = time()-(60*5);
143
+		$timeLimit = time() - (60 * 5);
144 144
 		$sql = 'SELECT id, title, owner, color, archived, deleted_at FROM `*PREFIX*deck_boards` ' .
145 145
 			'WHERE `deleted_at` > 0 AND `deleted_at` < ?';
146 146
 		return $this->findEntities($sql, [$timeLimit]);
@@ -177,21 +177,21 @@  discard block
 block discarded – undo
177 177
 		return $id;
178 178
 	}
179 179
 
180
-	public function mapAcl(Acl &$acl) {
180
+	public function mapAcl(Acl & $acl) {
181 181
 		$userManager = $this->userManager;
182 182
 		$groupManager = $this->groupManager;
183 183
 		$acl->resolveRelation('participant', function($participant) use (&$acl, &$userManager, &$groupManager) {
184
-			if($acl->getType() === Acl::PERMISSION_TYPE_USER) {
184
+			if ($acl->getType() === Acl::PERMISSION_TYPE_USER) {
185 185
 				$user = $userManager->get($participant);
186
-				if($user !== null) {
186
+				if ($user !== null) {
187 187
 					return new User($user);
188 188
 				}
189 189
 				\OC::$server->getLogger()->debug('User ' . $acl->getId() . ' not found when mapping acl ' . $acl->getParticipant());
190 190
 				return null;
191 191
 			}
192
-			if($acl->getType() === Acl::PERMISSION_TYPE_GROUP) {
192
+			if ($acl->getType() === Acl::PERMISSION_TYPE_GROUP) {
193 193
 				$group = $groupManager->get($participant);
194
-				if($group !== null) {
194
+				if ($group !== null) {
195 195
 					return new Group($group);
196 196
 				}
197 197
 				\OC::$server->getLogger()->debug('Group ' . $acl->getId() . ' not found when mapping acl ' . $acl->getParticipant());
@@ -204,11 +204,11 @@  discard block
 block discarded – undo
204 204
 	/**
205 205
 	 * @param Board $board
206 206
 	 */
207
-	public function mapOwner(Board &$board) {
207
+	public function mapOwner(Board & $board) {
208 208
 		$userManager = $this->userManager;
209 209
 		$board->resolveRelation('owner', function($owner) use (&$userManager) {
210 210
 			$user = $userManager->get($owner);
211
-			if($user !== null) {
211
+			if ($user !== null) {
212 212
 				return new User($user);
213 213
 			}
214 214
 			return null;
Please login to merge, or discard this patch.