Passed
Push — master ( a16703...c6645c )
by John
17:09 queued 13s
created
apps/dav/lib/HookManager.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -88,7 +88,7 @@  discard block
 block discarded – undo
88 88
 			'post_createUser',
89 89
 			$this,
90 90
 			'postCreateUser');
91
-		\OC::$server->getUserManager()->listen('\OC\User', 'assignedUserId', function ($uid) {
91
+		\OC::$server->getUserManager()->listen('\OC\User', 'assignedUserId', function($uid) {
92 92
 			$this->postCreateUser(['uid' => $uid]);
93 93
 		});
94 94
 		Util::connectHook('OC_User',
@@ -100,7 +100,7 @@  discard block
 block discarded – undo
100 100
 			'post_deleteUser',
101 101
 			$this,
102 102
 			'postDeleteUser');
103
-		\OC::$server->getUserManager()->listen('\OC\User', 'postUnassignedUserId', function ($uid) {
103
+		\OC::$server->getUserManager()->listen('\OC\User', 'postUnassignedUserId', function($uid) {
104 104
 			$this->postDeleteUser(['uid' => $uid]);
105 105
 		});
106 106
 		\OC::$server->getUserManager()->listen('\OC\User', 'postUnassignedUserId', [$this, 'postUnassignedUserId']);
@@ -119,7 +119,7 @@  discard block
 block discarded – undo
119 119
 
120 120
 	public function preDeleteUser($params) {
121 121
 		$uid = $params['uid'];
122
-		$userPrincipalUri = 'principals/users/' . $uid;
122
+		$userPrincipalUri = 'principals/users/'.$uid;
123 123
 		$this->usersToDelete[$uid] = $this->userManager->get($uid);
124 124
 		$this->calendarsToDelete = $this->calDav->getUsersOwnCalendars($userPrincipalUri);
125 125
 		$this->subscriptionsToDelete = $this->calDav->getSubscriptionsForUser($userPrincipalUri);
@@ -148,7 +148,7 @@  discard block
 block discarded – undo
148 148
 				$subscription['id'],
149 149
 			);
150 150
 		}
151
-		$this->calDav->deleteAllSharesByUser('principals/users/' . $uid);
151
+		$this->calDav->deleteAllSharesByUser('principals/users/'.$uid);
152 152
 
153 153
 		foreach ($this->addressBooksToDelete as $addressBook) {
154 154
 			$this->cardDav->deleteAddressBook($addressBook['id']);
@@ -168,7 +168,7 @@  discard block
 block discarded – undo
168 168
 
169 169
 	public function firstLogin(IUser $user = null) {
170 170
 		if (!is_null($user)) {
171
-			$principal = 'principals/users/' . $user->getUID();
171
+			$principal = 'principals/users/'.$user->getUID();
172 172
 			if ($this->calDav->getCalendarsForUserCount($principal) === 0) {
173 173
 				try {
174 174
 					$this->calDav->createCalendar($principal, CalDavBackend::PERSONAL_CALENDAR_URI, [
Please login to merge, or discard this patch.
apps/dav/lib/Upload/AssemblyStream.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -73,11 +73,11 @@  discard block
 block discarded – undo
73 73
 		$this->loadContext('assembly');
74 74
 
75 75
 		$nodes = $this->nodes;
76
-		usort($nodes, function (IFile $a, IFile $b) {
76
+		usort($nodes, function(IFile $a, IFile $b) {
77 77
 			return strnatcmp($a->getName(), $b->getName());
78 78
 		});
79 79
 		$this->nodes = array_values($nodes);
80
-		$this->size = array_reduce($this->nodes, function ($size, IFile $file) {
80
+		$this->size = array_reduce($this->nodes, function($size, IFile $file) {
81 81
 			return $size + $file->getSize();
82 82
 		}, 0);
83 83
 
@@ -156,7 +156,7 @@  discard block
 block discarded – undo
156 156
 				fclose($this->currentStream);
157 157
 				$currentNodeSize = $this->nodes[$this->currentNode]->getSize();
158 158
 				if ($this->currentNodeRead < $currentNodeSize) {
159
-					throw new \Exception('Stream from assembly node shorter than expected, got ' . $this->currentNodeRead . ' bytes, expected ' . $currentNodeSize);
159
+					throw new \Exception('Stream from assembly node shorter than expected, got '.$this->currentNodeRead.' bytes, expected '.$currentNodeSize);
160 160
 				}
161 161
 				$this->currentNode++;
162 162
 				$this->currentNodeRead = 0;
@@ -253,7 +253,7 @@  discard block
 block discarded – undo
253 253
 		if (isset($context[$name])) {
254 254
 			$context = $context[$name];
255 255
 		} else {
256
-			throw new \BadMethodCallException('Invalid context, "' . $name . '" options not set');
256
+			throw new \BadMethodCallException('Invalid context, "'.$name.'" options not set');
257 257
 		}
258 258
 		if (isset($context['nodes']) and is_array($context['nodes'])) {
259 259
 			$this->nodes = $context['nodes'];
Please login to merge, or discard this patch.
apps/dav/lib/Migration/RemoveDeletedUsersCalendarSubscriptions.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -91,7 +91,7 @@
 block discarded – undo
91 91
 		$result->closeCursor();
92 92
 
93 93
 		if ($count !== false) {
94
-			$count = (int)$count;
94
+			$count = (int) $count;
95 95
 		} else {
96 96
 			$count = 0;
97 97
 		}
Please login to merge, or discard this patch.
apps/dav/lib/Settings/CalDAVSettings.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -85,7 +85,7 @@
 block discarded – undo
85 85
 
86 86
 	public function getAuthorizedAppConfig(): array {
87 87
 		return [
88
-			'dav' => ['/(' . implode('|', array_keys(self::defaults)) . ')/']
88
+			'dav' => ['/('.implode('|', array_keys(self::defaults)).')/']
89 89
 		];
90 90
 	}
91 91
 }
Please login to merge, or discard this patch.
apps/user_ldap/lib/PagedResults/TLinkId.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -31,12 +31,12 @@
 block discarded – undo
31 31
 		if (is_object($link)) {
32 32
 			return spl_object_id($link);
33 33
 		} elseif (is_resource($link)) {
34
-			return (int)$link;
34
+			return (int) $link;
35 35
 		} elseif (is_array($link) && isset($link[0])) {
36 36
 			if (is_object($link[0])) {
37 37
 				return spl_object_id($link[0]);
38 38
 			} elseif (is_resource($link[0])) {
39
-				return (int)$link[0];
39
+				return (int) $link[0];
40 40
 			}
41 41
 		}
42 42
 		throw new \RuntimeException('No resource provided');
Please login to merge, or discard this patch.
apps/user_ldap/lib/User/Manager.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -177,7 +177,7 @@  discard block
 block discarded – undo
177 177
 			$this->access->getConnection()->ldapExtStorageHomeAttribute,
178 178
 		];
179 179
 
180
-		$homeRule = (string)$this->access->getConnection()->homeFolderNamingRule;
180
+		$homeRule = (string) $this->access->getConnection()->homeFolderNamingRule;
181 181
 		if (strpos($homeRule, 'attr:') === 0) {
182 182
 			$attributes[] = substr($homeRule, strlen('attr:'));
183 183
 		}
@@ -192,8 +192,8 @@  discard block
 block discarded – undo
192 192
 		}
193 193
 
194 194
 		$attributes = array_reduce($attributes,
195
-			function ($list, $attribute) {
196
-				$attribute = strtolower(trim((string)$attribute));
195
+			function($list, $attribute) {
196
+				$attribute = strtolower(trim((string) $attribute));
197 197
 				if (!empty($attribute) && !in_array($attribute, $list)) {
198 198
 					$list[] = $attribute;
199 199
 				}
@@ -214,7 +214,7 @@  discard block
 block discarded – undo
214 214
 	public function isDeletedUser($id) {
215 215
 		$isDeleted = $this->ocConfig->getUserValue(
216 216
 			$id, 'user_ldap', 'isDeleted', 0);
217
-		return (int)$isDeleted === 1;
217
+		return (int) $isDeleted === 1;
218 218
 	}
219 219
 
220 220
 	/**
Please login to merge, or discard this patch.
apps/user_ldap/lib/User_LDAP.php 1 patch
Spacing   +17 added lines, -17 removed lines patch added patch discarded remove patch
@@ -111,7 +111,7 @@  discard block
 block discarded – undo
111 111
 	 * @throws \Exception
112 112
 	 */
113 113
 	public function loginName2UserName($loginName) {
114
-		$cacheKey = 'loginName2UserName-' . $loginName;
114
+		$cacheKey = 'loginName2UserName-'.$loginName;
115 115
 		$username = $this->access->connection->getFromCache($cacheKey);
116 116
 
117 117
 		if ($username !== null) {
@@ -158,8 +158,8 @@  discard block
 block discarded – undo
158 158
 		$attrs = $this->access->userManager->getAttributes();
159 159
 		$users = $this->access->fetchUsersByLoginName($loginName, $attrs);
160 160
 		if (count($users) < 1) {
161
-			throw new NotOnLDAP('No user available for the given login name on ' .
162
-				$this->access->connection->ldapHost . ':' . $this->access->connection->ldapPort);
161
+			throw new NotOnLDAP('No user available for the given login name on '.
162
+				$this->access->connection->ldapHost.':'.$this->access->connection->ldapPort);
163 163
 		}
164 164
 		return $users[0];
165 165
 	}
@@ -186,7 +186,7 @@  discard block
 block discarded – undo
186 186
 
187 187
 		if (!$user instanceof User) {
188 188
 			$this->logger->warning(
189
-				'LDAP Login: Could not get user object for DN ' . $dn .
189
+				'LDAP Login: Could not get user object for DN '.$dn.
190 190
 				'. Maybe the LDAP entry has no set display name attribute?',
191 191
 				['app' => 'user_ldap']
192 192
 			);
@@ -222,13 +222,13 @@  discard block
 block discarded – undo
222 222
 		$user = $this->access->userManager->get($uid);
223 223
 
224 224
 		if (!$user instanceof User) {
225
-			throw new \Exception('LDAP setPassword: Could not get user object for uid ' . $uid .
225
+			throw new \Exception('LDAP setPassword: Could not get user object for uid '.$uid.
226 226
 				'. Maybe the LDAP entry has no set display name attribute?');
227 227
 		}
228 228
 		if ($user->getUsername() !== false && $this->access->setPassword($user->getDN(), $password)) {
229 229
 			$ldapDefaultPPolicyDN = $this->access->connection->ldapDefaultPPolicyDN;
230 230
 			$turnOnPasswordChange = $this->access->connection->turnOnPasswordChange;
231
-			if (!empty($ldapDefaultPPolicyDN) && ((int)$turnOnPasswordChange === 1)) {
231
+			if (!empty($ldapDefaultPPolicyDN) && ((int) $turnOnPasswordChange === 1)) {
232 232
 				//remove last password expiry warning if any
233 233
 				$notification = $this->notificationManager->createNotification();
234 234
 				$notification->setApp('user_ldap')
@@ -268,7 +268,7 @@  discard block
 block discarded – undo
268 268
 		}
269 269
 		$filter = $this->access->combineFilterWithAnd([
270 270
 			$this->access->connection->ldapUserFilter,
271
-			$this->access->connection->ldapUserDisplayName . '=*',
271
+			$this->access->connection->ldapUserDisplayName.'=*',
272 272
 			$this->access->getFilterPartForUserSearch($search)
273 273
 		]);
274 274
 
@@ -283,7 +283,7 @@  discard block
 block discarded – undo
283 283
 			$limit, $offset);
284 284
 		$ldap_users = $this->access->nextcloudUserNames($ldap_users);
285 285
 		$this->logger->debug(
286
-			'getUsers: '.count($ldap_users). ' Users found',
286
+			'getUsers: '.count($ldap_users).' Users found',
287 287
 			['app' => 'user_ldap']
288 288
 		);
289 289
 
@@ -307,11 +307,11 @@  discard block
 block discarded – undo
307 307
 			return false;
308 308
 		}
309 309
 		$uid = $user instanceof User ? $user->getUsername() : $user->getOCName();
310
-		$cacheKey = 'userExistsOnLDAP' . $uid;
310
+		$cacheKey = 'userExistsOnLDAP'.$uid;
311 311
 		if (!$ignoreCache) {
312 312
 			$userExists = $this->access->connection->getFromCache($cacheKey);
313 313
 			if (!is_null($userExists)) {
314
-				return (bool)$userExists;
314
+				return (bool) $userExists;
315 315
 			}
316 316
 		}
317 317
 
@@ -358,7 +358,7 @@  discard block
 block discarded – undo
358 358
 	public function userExists($uid) {
359 359
 		$userExists = $this->access->connection->getFromCache('userExists'.$uid);
360 360
 		if (!is_null($userExists)) {
361
-			return (bool)$userExists;
361
+			return (bool) $userExists;
362 362
 		}
363 363
 		//getting dn, if false the user does not exist. If dn, he may be mapped only, requires more checking.
364 364
 		$user = $this->access->userManager->get($uid);
@@ -390,7 +390,7 @@  discard block
 block discarded – undo
390 390
 			}
391 391
 		}
392 392
 
393
-		$marked = (int)$this->ocConfig->getUserValue($uid, 'user_ldap', 'isDeleted', 0);
393
+		$marked = (int) $this->ocConfig->getUserValue($uid, 'user_ldap', 'isDeleted', 0);
394 394
 		if ($marked === 0) {
395 395
 			try {
396 396
 				$user = $this->access->userManager->get($uid);
@@ -406,13 +406,13 @@  discard block
 block discarded – undo
406 406
 			}
407 407
 			if ($marked === 0) {
408 408
 				$this->logger->notice(
409
-					'User '.$uid . ' is not marked as deleted, not cleaning up.',
409
+					'User '.$uid.' is not marked as deleted, not cleaning up.',
410 410
 					['app' => 'user_ldap']
411 411
 				);
412 412
 				return false;
413 413
 			}
414 414
 		}
415
-		$this->logger->info('Cleaning up after user ' . $uid,
415
+		$this->logger->info('Cleaning up after user '.$uid,
416 416
 			['app' => 'user_ldap']);
417 417
 
418 418
 		$this->access->getUserMapper()->unmap($uid); // we don't emit unassign signals here, since it is implicit to delete signals fired from core
@@ -450,7 +450,7 @@  discard block
 block discarded – undo
450 450
 		if ($user instanceof User || $user instanceof OfflineUser) {
451 451
 			$path = $user->getHomePath() ?: false;
452 452
 		} else {
453
-			throw new NoUserException($uid . ' is not a valid user anymore');
453
+			throw new NoUserException($uid.' is not a valid user anymore');
454 454
 		}
455 455
 
456 456
 		$this->access->cacheUserHome($uid, $path);
@@ -558,12 +558,12 @@  discard block
 block discarded – undo
558 558
 	 * compared with \OC\User\Backend::CREATE_USER etc.
559 559
 	 */
560 560
 	public function implementsActions($actions) {
561
-		return (bool)((Backend::CHECK_PASSWORD
561
+		return (bool) ((Backend::CHECK_PASSWORD
562 562
 			| Backend::GET_HOME
563 563
 			| Backend::GET_DISPLAYNAME
564 564
 			| (($this->access->connection->ldapUserAvatarRule !== 'none') ? Backend::PROVIDE_AVATAR : 0)
565 565
 			| Backend::COUNT_USERS
566
-			| (((int)$this->access->connection->turnOnPasswordChange === 1)? Backend::SET_PASSWORD :0)
566
+			| (((int) $this->access->connection->turnOnPasswordChange === 1) ? Backend::SET_PASSWORD : 0)
567 567
 			| $this->userPluginManager->getImplementedActions())
568 568
 			& $actions);
569 569
 	}
Please login to merge, or discard this patch.
apps/files_versions/lib/Command/CleanUp.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -79,7 +79,7 @@  discard block
 block discarded – undo
79 79
 				return 1;
80 80
 			}
81 81
 
82
-			$users = [ $pathMatches[1] ];
82
+			$users = [$pathMatches[1]];
83 83
 			$path = trim($pathMatches[2], '/');
84 84
 		}
85 85
 
@@ -130,7 +130,7 @@  discard block
 block discarded – undo
130 130
 		\OC_Util::tearDownFS();
131 131
 		\OC_Util::setupFS($user);
132 132
 
133
-		$fullPath = '/' . $user . '/files_versions' . ($path ? '/' . $path : '');
133
+		$fullPath = '/'.$user.'/files_versions'.($path ? '/'.$path : '');
134 134
 		if ($this->rootFolder->nodeExists($fullPath)) {
135 135
 			$this->rootFolder->get($fullPath)->delete();
136 136
 		}
Please login to merge, or discard this patch.
apps/files_versions/lib/Expiration.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -157,7 +157,7 @@  discard block
 block discarded – undo
157 157
 		if (!ctype_digit($minValue) && $minValue !== 'auto') {
158 158
 			$isValid = false;
159 159
 			$this->logger->warning(
160
-					$minValue . ' is not a valid value for minimal versions retention obligation. Check versions_retention_obligation in your config.php. Falling back to auto.',
160
+					$minValue.' is not a valid value for minimal versions retention obligation. Check versions_retention_obligation in your config.php. Falling back to auto.',
161 161
 					['app' => 'files_versions']
162 162
 			);
163 163
 		}
@@ -165,7 +165,7 @@  discard block
 block discarded – undo
165 165
 		if (!ctype_digit($maxValue) && $maxValue !== 'auto') {
166 166
 			$isValid = false;
167 167
 			$this->logger->warning(
168
-					$maxValue . ' is not a valid value for maximal versions retention obligation. Check versions_retention_obligation in your config.php. Falling back to auto.',
168
+					$maxValue.' is not a valid value for maximal versions retention obligation. Check versions_retention_obligation in your config.php. Falling back to auto.',
169 169
 					['app' => 'files_versions']
170 170
 			);
171 171
 		}
@@ -183,13 +183,13 @@  discard block
 block discarded – undo
183 183
 			$this->canPurgeToSaveSpace = true;
184 184
 		} elseif ($minValue !== 'auto' && $maxValue === 'auto') {
185 185
 			// Keep for X days but delete anytime if space needed
186
-			$this->minAge = (int)$minValue;
186
+			$this->minAge = (int) $minValue;
187 187
 			$this->maxAge = self::NO_OBLIGATION;
188 188
 			$this->canPurgeToSaveSpace = true;
189 189
 		} elseif ($minValue === 'auto' && $maxValue !== 'auto') {
190 190
 			// Delete anytime if space needed, Delete all older than max automatically
191 191
 			$this->minAge = self::NO_OBLIGATION;
192
-			$this->maxAge = (int)$maxValue;
192
+			$this->maxAge = (int) $maxValue;
193 193
 			$this->canPurgeToSaveSpace = true;
194 194
 		} elseif ($minValue !== 'auto' && $maxValue !== 'auto') {
195 195
 			// Delete all older than max OR older than min if space needed
@@ -199,8 +199,8 @@  discard block
 block discarded – undo
199 199
 				$maxValue = $minValue;
200 200
 			}
201 201
 
202
-			$this->minAge = (int)$minValue;
203
-			$this->maxAge = (int)$maxValue;
202
+			$this->minAge = (int) $minValue;
203
+			$this->maxAge = (int) $maxValue;
204 204
 			$this->canPurgeToSaveSpace = false;
205 205
 		}
206 206
 	}
Please login to merge, or discard this patch.