Completed
Push — master ( 54b1f4...fdc61e )
by Christoph
34:11 queued 21:41
created
lib/public/Authentication/TwoFactorAuth/IProvider.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -33,8 +33,8 @@
 block discarded – undo
33 33
 	/**
34 34
 	 * @since 14.0.0
35 35
 	 */
36
-	const EVENT_SUCCESS = self::class . '::success';
37
-	const EVENT_FAILED  = self::class . '::failed';
36
+	const EVENT_SUCCESS = self::class.'::success';
37
+	const EVENT_FAILED  = self::class.'::failed';
38 38
 
39 39
 	/**
40 40
 	 * Get unique identifier of this 2FA provider
Please login to merge, or discard this patch.
apps/files_trashbin/lib/Storage.php 1 patch
Spacing   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -114,7 +114,7 @@  discard block
 block discarded – undo
114 114
 			if ($currentUser) {
115 115
 				$currentUserId = $currentUser->getUID();
116 116
 
117
-				$view = new View($currentUserId . '/files');
117
+				$view = new View($currentUserId.'/files');
118 118
 				$fileInfo = $view->getFileInfo($oldPath);
119 119
 				if ($fileInfo) {
120 120
 					$sourceStorage = $fileInfo->getStorage();
@@ -137,8 +137,8 @@  discard block
 block discarded – undo
137 137
 			]);
138 138
 		}
139 139
 
140
-		if($fileMovedOutOfSharedFolder) {
141
-			self::$moveOutOfSharedFolder['/' . $currentUserId . '/files' . $oldPath] = true;
140
+		if ($fileMovedOutOfSharedFolder) {
141
+			self::$moveOutOfSharedFolder['/'.$currentUserId.'/files'.$oldPath] = true;
142 142
 		} else {
143 143
 			self::$disableTrash = true;
144 144
 		}
@@ -178,16 +178,16 @@  discard block
 block discarded – undo
178 178
 	 */
179 179
 	public function unlink($path) {
180 180
 		try {
181
-			if (isset(self::$moveOutOfSharedFolder[$this->mountPoint . $path])) {
181
+			if (isset(self::$moveOutOfSharedFolder[$this->mountPoint.$path])) {
182 182
 				$result = $this->doDelete($path, 'unlink', true);
183
-				unset(self::$moveOutOfSharedFolder[$this->mountPoint . $path]);
183
+				unset(self::$moveOutOfSharedFolder[$this->mountPoint.$path]);
184 184
 			} else {
185 185
 				$result = $this->doDelete($path, 'unlink');
186 186
 			}
187 187
 		} catch (GenericEncryptionException $e) {
188 188
 			// in case of a encryption exception we delete the file right away
189 189
 			$this->logger->info(
190
-				"Can't move file" .  $path .
190
+				"Can't move file".$path.
191 191
 				"to the trash bin, therefore it was deleted right away");
192 192
 
193 193
 			$result = $this->storage->unlink($path);
@@ -204,9 +204,9 @@  discard block
 block discarded – undo
204 204
 	 * @return bool true if the operation succeeded, false otherwise
205 205
 	 */
206 206
 	public function rmdir($path) {
207
-		if (isset(self::$moveOutOfSharedFolder[$this->mountPoint . $path])) {
207
+		if (isset(self::$moveOutOfSharedFolder[$this->mountPoint.$path])) {
208 208
 			$result = $this->doDelete($path, 'rmdir', true);
209
-			unset(self::$moveOutOfSharedFolder[$this->mountPoint . $path]);
209
+			unset(self::$moveOutOfSharedFolder[$this->mountPoint.$path]);
210 210
 		} else {
211 211
 			$result = $this->doDelete($path, 'rmdir');
212 212
 		}
@@ -221,7 +221,7 @@  discard block
 block discarded – undo
221 221
 	 * @param $path
222 222
 	 * @return bool
223 223
 	 */
224
-	protected function shouldMoveToTrash($path){
224
+	protected function shouldMoveToTrash($path) {
225 225
 
226 226
 		// check if there is a app which want to disable the trash bin for this file
227 227
 		$fileId = $this->storage->getCache()->getId($path);
@@ -234,7 +234,7 @@  discard block
 block discarded – undo
234 234
 			}
235 235
 		}
236 236
 
237
-		$normalized = Filesystem::normalizePath($this->mountPoint . '/' . $path);
237
+		$normalized = Filesystem::normalizePath($this->mountPoint.'/'.$path);
238 238
 		$parts = explode('/', $normalized);
239 239
 		if (count($parts) < 4) {
240 240
 			return false;
@@ -282,7 +282,7 @@  discard block
 block discarded – undo
282 282
 			return false;
283 283
 		}
284 284
 
285
-		$normalized = Filesystem::normalizePath($this->mountPoint . '/' . $path, true, false, true);
285
+		$normalized = Filesystem::normalizePath($this->mountPoint.'/'.$path, true, false, true);
286 286
 		$result = true;
287 287
 		$view = Filesystem::getView();
288 288
 		if (!isset($this->deletedFiles[$normalized]) && $view instanceof View) {
@@ -310,7 +310,7 @@  discard block
 block discarded – undo
310 310
 	 * Setup the storate wrapper callback
311 311
 	 */
312 312
 	public static function setupStorage() {
313
-		\OC\Files\Filesystem::addStorageWrapper('oc_trashbin', function ($mountPoint, $storage) {
313
+		\OC\Files\Filesystem::addStorageWrapper('oc_trashbin', function($mountPoint, $storage) {
314 314
 			return new \OCA\Files_Trashbin\Storage(
315 315
 				array('storage' => $storage, 'mountPoint' => $mountPoint),
316 316
 				\OC::$server->getUserManager(),
Please login to merge, or discard this patch.
apps/federatedfilesharing/lib/Controller/MountPublicLinkController.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -150,7 +150,7 @@  discard block
 block discarded – undo
150 150
 		$storedPassword = $share->getPassword();
151 151
 		$authenticated = $this->session->get('public_link_authenticated') === $share->getId() ||
152 152
 			$this->shareManager->checkPassword($share, $password);
153
-		if (!empty($storedPassword) && !$authenticated ) {
153
+		if (!empty($storedPassword) && !$authenticated) {
154 154
 			$response = new JSONResponse(
155 155
 				['message' => 'No permission to access the share'],
156 156
 				Http::STATUS_BAD_REQUEST
@@ -198,7 +198,7 @@  discard block
 block discarded – undo
198 198
 		$httpClient = $this->clientService->newClient();
199 199
 
200 200
 		try {
201
-			$response = $httpClient->post($remote . '/index.php/apps/federatedfilesharing/createFederatedShare',
201
+			$response = $httpClient->post($remote.'/index.php/apps/federatedfilesharing/createFederatedShare',
202 202
 				[
203 203
 					'body' =>
204 204
 						[
Please login to merge, or discard this patch.
apps/federation/lib/TrustedServers.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -230,7 +230,7 @@  discard block
 block discarded – undo
230 230
 		$client = $this->httpClientService->newClient();
231 231
 		try {
232 232
 			$result = $client->get(
233
-				$url . '/status.php',
233
+				$url.'/status.php',
234 234
 				[
235 235
 					'timeout' => 3,
236 236
 					'connect_timeout' => 3,
@@ -286,6 +286,6 @@  discard block
 block discarded – undo
286 286
 
287 287
 		}
288 288
 
289
-		return 'https://' . $url;
289
+		return 'https://'.$url;
290 290
 	}
291 291
 }
Please login to merge, or discard this patch.
apps/files_external/lib/Service/StoragesService.php 1 patch
Spacing   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -72,17 +72,17 @@  discard block
 block discarded – undo
72 72
 	}
73 73
 
74 74
 	protected function getStorageConfigFromDBMount(array $mount) {
75
-		$applicableUsers = array_filter($mount['applicable'], function ($applicable) {
75
+		$applicableUsers = array_filter($mount['applicable'], function($applicable) {
76 76
 			return $applicable['type'] === DBConfigService::APPLICABLE_TYPE_USER;
77 77
 		});
78
-		$applicableUsers = array_map(function ($applicable) {
78
+		$applicableUsers = array_map(function($applicable) {
79 79
 			return $applicable['value'];
80 80
 		}, $applicableUsers);
81 81
 
82
-		$applicableGroups = array_filter($mount['applicable'], function ($applicable) {
82
+		$applicableGroups = array_filter($mount['applicable'], function($applicable) {
83 83
 			return $applicable['type'] === DBConfigService::APPLICABLE_TYPE_GROUP;
84 84
 		});
85
-		$applicableGroups = array_map(function ($applicable) {
85
+		$applicableGroups = array_map(function($applicable) {
86 86
 			return $applicable['value'];
87 87
 		}, $applicableGroups);
88 88
 
@@ -98,7 +98,7 @@  discard block
 block discarded – undo
98 98
 				$mount['priority']
99 99
 			);
100 100
 			$config->setType($mount['type']);
101
-			$config->setId((int)$mount['mount_id']);
101
+			$config->setId((int) $mount['mount_id']);
102 102
 			return $config;
103 103
 		} catch (\UnexpectedValueException $e) {
104 104
 			// don't die if a storage backend doesn't exist
@@ -126,11 +126,11 @@  discard block
 block discarded – undo
126 126
 	protected function readConfig() {
127 127
 		$mounts = $this->readDBConfig();
128 128
 		$configs = array_map([$this, 'getStorageConfigFromDBMount'], $mounts);
129
-		$configs = array_filter($configs, function ($config) {
129
+		$configs = array_filter($configs, function($config) {
130 130
 			return $config instanceof StorageConfig;
131 131
 		});
132 132
 
133
-		$keys = array_map(function (StorageConfig $config) {
133
+		$keys = array_map(function(StorageConfig $config) {
134 134
 			return $config->getId();
135 135
 		}, $configs);
136 136
 
@@ -149,14 +149,14 @@  discard block
 block discarded – undo
149 149
 		$mount = $this->dbConfig->getMountById($id);
150 150
 
151 151
 		if (!is_array($mount)) {
152
-			throw new NotFoundException('Storage with ID "' . $id . '" not found');
152
+			throw new NotFoundException('Storage with ID "'.$id.'" not found');
153 153
 		}
154 154
 
155 155
 		$config = $this->getStorageConfigFromDBMount($mount);
156 156
 		if ($this->isApplicable($config)) {
157 157
 			return $config;
158 158
 		} else {
159
-			throw new NotFoundException('Storage with ID "' . $id . '" not found');
159
+			throw new NotFoundException('Storage with ID "'.$id.'" not found');
160 160
 		}
161 161
 	}
162 162
 
@@ -379,13 +379,13 @@  discard block
 block discarded – undo
379 379
 		$existingMount = $this->dbConfig->getMountById($id);
380 380
 
381 381
 		if (!is_array($existingMount)) {
382
-			throw new NotFoundException('Storage with ID "' . $id . '" not found while updating storage');
382
+			throw new NotFoundException('Storage with ID "'.$id.'" not found while updating storage');
383 383
 		}
384 384
 
385 385
 		$oldStorage = $this->getStorageConfigFromDBMount($existingMount);
386 386
 
387 387
 		if ($oldStorage->getBackend() instanceof InvalidBackend) {
388
-			throw new NotFoundException('Storage with id "' . $id . '" cannot be edited due to missing backend');
388
+			throw new NotFoundException('Storage with id "'.$id.'" cannot be edited due to missing backend');
389 389
 		}
390 390
 
391 391
 		$removedUsers = array_diff($oldStorage->getApplicableUsers(), $updatedStorage->getApplicableUsers());
@@ -462,7 +462,7 @@  discard block
 block discarded – undo
462 462
 		$existingMount = $this->dbConfig->getMountById($id);
463 463
 
464 464
 		if (!is_array($existingMount)) {
465
-			throw new NotFoundException('Storage with ID "' . $id . '" not found');
465
+			throw new NotFoundException('Storage with ID "'.$id.'" not found');
466 466
 		}
467 467
 
468 468
 		$this->dbConfig->removeMount($id);
Please login to merge, or discard this patch.
settings/Controller/AuthSettingsController.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -201,7 +201,7 @@
 block discarded – undo
201 201
 	 */
202 202
 	public function update($id, array $scope) {
203 203
 		try {
204
-			$token = $this->tokenProvider->getTokenById((string)$id);
204
+			$token = $this->tokenProvider->getTokenById((string) $id);
205 205
 			if ($token->getUID() !== $this->uid) {
206 206
 				throw new InvalidTokenException('User mismatch');
207 207
 			}
Please login to merge, or discard this patch.
lib/private/Template/Base.php 1 patch
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -46,7 +46,7 @@  discard block
 block discarded – undo
46 46
 	 * @param \OCP\IL10N $l10n
47 47
 	 * @param Defaults $theme
48 48
 	 */
49
-	public function __construct($template, $requestToken, $l10n, $theme ) {
49
+	public function __construct($template, $requestToken, $l10n, $theme) {
50 50
 		$this->vars = array();
51 51
 		$this->vars['requesttoken'] = $requestToken;
52 52
 		$this->l10n = $l10n;
@@ -63,7 +63,7 @@  discard block
 block discarded – undo
63 63
 	 */
64 64
 	protected function getAppTemplateDirs($theme, $app, $serverRoot, $app_dir) {
65 65
 		// Check if the app is in the app folder or in the root
66
-		if( file_exists($app_dir.'/templates/' )) {
66
+		if (file_exists($app_dir.'/templates/')) {
67 67
 			return [
68 68
 				$serverRoot.'/themes/'.$theme.'/apps/'.$app.'/templates/',
69 69
 				$app_dir.'/templates/',
@@ -98,7 +98,7 @@  discard block
 block discarded – undo
98 98
 	 *
99 99
 	 * If the key existed before, it will be overwritten
100 100
 	 */
101
-	public function assign( $key, $value) {
101
+	public function assign($key, $value) {
102 102
 		$this->vars[$key] = $value;
103 103
 		return true;
104 104
 	}
@@ -113,12 +113,12 @@  discard block
 block discarded – undo
113 113
 	 * exists, the value will be appended. It can be accessed via
114 114
 	 * $_[$key][$position] in the template.
115 115
 	 */
116
-	public function append( $key, $value ) {
117
-		if( array_key_exists( $key, $this->vars )) {
116
+	public function append($key, $value) {
117
+		if (array_key_exists($key, $this->vars)) {
118 118
 			$this->vars[$key][] = $value;
119 119
 		}
120
-		else{
121
-			$this->vars[$key] = array( $value );
120
+		else {
121
+			$this->vars[$key] = array($value);
122 122
 		}
123 123
 	}
124 124
 
@@ -130,10 +130,10 @@  discard block
 block discarded – undo
130 130
 	 */
131 131
 	public function printPage() {
132 132
 		$data = $this->fetchPage();
133
-		if( $data === false ) {
133
+		if ($data === false) {
134 134
 			return false;
135 135
 		}
136
-		else{
136
+		else {
137 137
 			print $data;
138 138
 			return true;
139 139
 		}
@@ -166,8 +166,8 @@  discard block
 block discarded – undo
166 166
 		$l = $this->l10n;
167 167
 		$theme = $this->theme;
168 168
 
169
-		if(!is_null($additionalParams)) {
170
-			$_ = array_merge( $additionalParams, $this->vars );
169
+		if (!is_null($additionalParams)) {
170
+			$_ = array_merge($additionalParams, $this->vars);
171 171
 			foreach ($_ as $var => $value) {
172 172
 				${$var} = $value;
173 173
 			}
Please login to merge, or discard this patch.
apps/workflowengine/lib/Controller/RequestTime.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -36,7 +36,7 @@
 block discarded – undo
36 36
 		$timezones = \DateTimeZone::listIdentifiers();
37 37
 
38 38
 		if ($search !== '') {
39
-			$timezones = array_filter($timezones, function ($timezone) use ($search) {
39
+			$timezones = array_filter($timezones, function($timezone) use ($search) {
40 40
 				return stripos($timezone, $search) !== false;
41 41
 			});
42 42
 		}
Please login to merge, or discard this patch.
lib/private/User/Session.php 1 patch
Spacing   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -350,14 +350,14 @@  discard block
 block discarded – undo
350 350
 			throw new LoginException($message);
351 351
 		}
352 352
 
353
-		if($regenerateSessionId) {
353
+		if ($regenerateSessionId) {
354 354
 			$this->session->regenerateId();
355 355
 		}
356 356
 
357 357
 		$this->setUser($user);
358 358
 		$this->setLoginName($loginDetails['loginName']);
359 359
 
360
-		if(isset($loginDetails['token']) && $loginDetails['token'] instanceof IToken) {
360
+		if (isset($loginDetails['token']) && $loginDetails['token'] instanceof IToken) {
361 361
 			$this->setToken($loginDetails['token']->getId());
362 362
 			$this->lockdownManager->setToken($loginDetails['token']);
363 363
 			$firstTimeLogin = false;
@@ -366,7 +366,7 @@  discard block
 block discarded – undo
366 366
 			$firstTimeLogin = $user->updateLastLoginTimestamp();
367 367
 		}
368 368
 		$this->manager->emit('\OC\User', 'postLogin', [$user, $loginDetails['password']]);
369
-		if($this->isLoggedIn()) {
369
+		if ($this->isLoggedIn()) {
370 370
 			$this->prepareUserLogin($firstTimeLogin, $regenerateSessionId);
371 371
 			return true;
372 372
 		}
@@ -408,13 +408,13 @@  discard block
 block discarded – undo
408 408
 		}
409 409
 
410 410
 		// Try to login with this username and password
411
-		if (!$this->login($user, $password) ) {
411
+		if (!$this->login($user, $password)) {
412 412
 
413 413
 			// Failed, maybe the user used their email address
414 414
 			$users = $this->manager->getByEmail($user);
415 415
 			if (!(\count($users) === 1 && $this->login($users[0]->getUID(), $password))) {
416 416
 
417
-				$this->logger->warning('Login failed: \'' . $user . '\' (Remote IP: \'' . \OC::$server->getRequest()->getRemoteAddress() . '\')', ['app' => 'core']);
417
+				$this->logger->warning('Login failed: \''.$user.'\' (Remote IP: \''.\OC::$server->getRequest()->getRemoteAddress().'\')', ['app' => 'core']);
418 418
 
419 419
 				$throttler->registerAttempt('login', $request->getRemoteAddress(), ['uid' => $user]);
420 420
 				if ($currentDelay === 0) {
@@ -426,7 +426,7 @@  discard block
 block discarded – undo
426 426
 
427 427
 		if ($isTokenPassword) {
428 428
 			$this->session->set('app_password', $password);
429
-		} else if($this->supportsCookies($request)) {
429
+		} else if ($this->supportsCookies($request)) {
430 430
 			// Password login, but cookies supported -> create (browser) session token
431 431
 			$this->createSessionToken($request, $this->getUser()->getUID(), $user, $password);
432 432
 		}
@@ -506,7 +506,7 @@  discard block
 block discarded – undo
506 506
 			}
507 507
 
508 508
 			// trigger any other initialization
509
-			\OC::$server->getEventDispatcher()->dispatch(IUser::class . '::firstLogin', new GenericEvent($this->getUser()));
509
+			\OC::$server->getEventDispatcher()->dispatch(IUser::class.'::firstLogin', new GenericEvent($this->getUser()));
510 510
 		}
511 511
 	}
512 512
 
@@ -666,7 +666,7 @@  discard block
 block discarded – undo
666 666
 	private function checkTokenCredentials(IToken $dbToken, $token) {
667 667
 		// Check whether login credentials are still valid and the user was not disabled
668 668
 		// This check is performed each 5 minutes
669
-		$lastCheck = $dbToken->getLastCheck() ? : 0;
669
+		$lastCheck = $dbToken->getLastCheck() ?: 0;
670 670
 		$now = $this->timeFactory->getTime();
671 671
 		if ($lastCheck > ($now - 60 * 5)) {
672 672
 			// Checked performed recently, nothing to do now
@@ -756,7 +756,7 @@  discard block
 block discarded – undo
756 756
 		if (!$this->loginWithToken($token)) {
757 757
 			return false;
758 758
 		}
759
-		if(!$this->validateToken($token)) {
759
+		if (!$this->validateToken($token)) {
760 760
 			return false;
761 761
 		}
762 762
 		return true;
@@ -887,9 +887,9 @@  discard block
 block discarded – undo
887 887
 		setcookie('nc_session_id', '', $this->timeFactory->getTime() - 3600, OC::$WEBROOT, '', $secureCookie, true);
888 888
 		// old cookies might be stored under /webroot/ instead of /webroot
889 889
 		// and Firefox doesn't like it!
890
-		setcookie('nc_username', '', $this->timeFactory->getTime() - 3600, OC::$WEBROOT . '/', '', $secureCookie, true);
891
-		setcookie('nc_token', '', $this->timeFactory->getTime() - 3600, OC::$WEBROOT . '/', '', $secureCookie, true);
892
-		setcookie('nc_session_id', '', $this->timeFactory->getTime() - 3600, OC::$WEBROOT . '/', '', $secureCookie, true);
890
+		setcookie('nc_username', '', $this->timeFactory->getTime() - 3600, OC::$WEBROOT.'/', '', $secureCookie, true);
891
+		setcookie('nc_token', '', $this->timeFactory->getTime() - 3600, OC::$WEBROOT.'/', '', $secureCookie, true);
892
+		setcookie('nc_session_id', '', $this->timeFactory->getTime() - 3600, OC::$WEBROOT.'/', '', $secureCookie, true);
893 893
 	}
894 894
 
895 895
 	/**
Please login to merge, or discard this patch.