Completed
Push — master ( 126a82...e45248 )
by Morris
11:37
created
apps/oauth2/lib/Db/AccessTokenMapper.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -49,7 +49,7 @@
 block discarded – undo
49 49
 		$result = $qb->execute();
50 50
 		$row = $result->fetch();
51 51
 		$result->closeCursor();
52
-		if($row === false) {
52
+		if ($row === false) {
53 53
 			throw new AccessTokenNotFoundException();
54 54
 		}
55 55
 		return AccessToken::fromRow($row);
Please login to merge, or discard this patch.
apps/dav/lib/Connector/Sabre/Auth.php 1 patch
Spacing   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -170,12 +170,12 @@  discard block
 block discarded – undo
170 170
 	 */
171 171
 	private function requiresCSRFCheck() {
172 172
 		// GET requires no check at all
173
-		if($this->request->getMethod() === 'GET') {
173
+		if ($this->request->getMethod() === 'GET') {
174 174
 			return false;
175 175
 		}
176 176
 
177 177
 		// Official Nextcloud clients require no checks
178
-		if($this->request->isUserAgent([
178
+		if ($this->request->isUserAgent([
179 179
 			IRequest::USER_AGENT_CLIENT_DESKTOP,
180 180
 			IRequest::USER_AGENT_CLIENT_ANDROID,
181 181
 			IRequest::USER_AGENT_CLIENT_IOS,
@@ -184,17 +184,17 @@  discard block
 block discarded – undo
184 184
 		}
185 185
 
186 186
 		// If not logged-in no check is required
187
-		if(!$this->userSession->isLoggedIn()) {
187
+		if (!$this->userSession->isLoggedIn()) {
188 188
 			return false;
189 189
 		}
190 190
 
191 191
 		// POST always requires a check
192
-		if($this->request->getMethod() === 'POST') {
192
+		if ($this->request->getMethod() === 'POST') {
193 193
 			return true;
194 194
 		}
195 195
 
196 196
 		// If logged-in AND DAV authenticated no check is required
197
-		if($this->userSession->isLoggedIn() &&
197
+		if ($this->userSession->isLoggedIn() &&
198 198
 			$this->isDavAuthenticated($this->userSession->getUser()->getUID())) {
199 199
 			return false;
200 200
 		}
@@ -211,10 +211,10 @@  discard block
 block discarded – undo
211 211
 	private function auth(RequestInterface $request, ResponseInterface $response) {
212 212
 		$forcedLogout = false;
213 213
 
214
-		if(!$this->request->passesCSRFCheck() &&
214
+		if (!$this->request->passesCSRFCheck() &&
215 215
 			$this->requiresCSRFCheck()) {
216 216
 			// In case of a fail with POST we need to recheck the credentials
217
-			if($this->request->getMethod() === 'POST') {
217
+			if ($this->request->getMethod() === 'POST') {
218 218
 				$forcedLogout = true;
219 219
 			} else {
220 220
 				$response->setStatus(401);
@@ -222,10 +222,10 @@  discard block
 block discarded – undo
222 222
 			}
223 223
 		}
224 224
 
225
-		if($forcedLogout) {
225
+		if ($forcedLogout) {
226 226
 			$this->userSession->logout();
227 227
 		} else {
228
-			if($this->twoFactorManager->needsSecondFactor($this->userSession->getUser())) {
228
+			if ($this->twoFactorManager->needsSecondFactor($this->userSession->getUser())) {
229 229
 				throw new \Sabre\DAV\Exception\NotAuthenticated('2FA challenge not passed.');
230 230
 			}
231 231
 			if (\OC_User::handleApacheAuth() ||
@@ -238,19 +238,19 @@  discard block
 block discarded – undo
238 238
 				\OC_Util::setupFS($user);
239 239
 				$this->currentUser = $user;
240 240
 				$this->session->close();
241
-				return [true, $this->principalPrefix . $user];
241
+				return [true, $this->principalPrefix.$user];
242 242
 			}
243 243
 		}
244 244
 
245 245
 		if (!$this->userSession->isLoggedIn() && in_array('XMLHttpRequest', explode(',', $request->getHeader('X-Requested-With')))) {
246 246
 			// do not re-authenticate over ajax, use dummy auth name to prevent browser popup
247
-			$response->addHeader('WWW-Authenticate','DummyBasic realm="' . $this->realm . '"');
247
+			$response->addHeader('WWW-Authenticate', 'DummyBasic realm="'.$this->realm.'"');
248 248
 			$response->setStatus(401);
249 249
 			throw new \Sabre\DAV\Exception\NotAuthenticated('Cannot authenticate over ajax calls');
250 250
 		}
251 251
 
252 252
 		$data = parent::check($request, $response);
253
-		if($data[0] === true) {
253
+		if ($data[0] === true) {
254 254
 			$startPos = strrpos($data[1], '/') + 1;
255 255
 			$user = $this->userSession->getUser()->getUID();
256 256
 			$data[1] = substr_replace($data[1], $user, $startPos);
Please login to merge, or discard this patch.
apps/dav/lib/Connector/Sabre/BearerAuth.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -55,7 +55,7 @@  discard block
 block discarded – undo
55 55
 	private function setupUserFs($userId) {
56 56
 		\OC_Util::setupFS($userId);
57 57
 		$this->session->close();
58
-		return $this->principalPrefix . $userId;
58
+		return $this->principalPrefix.$userId;
59 59
 	}
60 60
 
61 61
 	/**
@@ -64,10 +64,10 @@  discard block
 block discarded – undo
64 64
 	public function validateBearerToken($bearerToken) {
65 65
 		\OC_Util::setupFS();
66 66
 
67
-		if(!$this->userSession->isLoggedIn()) {
67
+		if (!$this->userSession->isLoggedIn()) {
68 68
 			$this->userSession->tryTokenLogin($this->request);
69 69
 		}
70
-		if($this->userSession->isLoggedIn()) {
70
+		if ($this->userSession->isLoggedIn()) {
71 71
 			return $this->setupUserFs($this->userSession->getUser()->getUID());
72 72
 		}
73 73
 
Please login to merge, or discard this patch.
lib/private/Template/JSResourceLocator.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -71,26 +71,26 @@
 block discarded – undo
71 71
 		}
72 72
 
73 73
 		$app = substr($script, 0, strpos($script, '/'));
74
-		$script = substr($script, strpos($script, '/')+1);
74
+		$script = substr($script, strpos($script, '/') + 1);
75 75
 		$app_path = \OC_App::getAppPath($app);
76 76
 		$app_url = \OC_App::getAppWebPath($app);
77 77
 
78 78
 		// missing translations files fill be ignored
79 79
 		if (strpos($script, 'l10n/') === 0) {
80
-			$this->appendIfExist($app_path, $script . '.js', $app_url);
80
+			$this->appendIfExist($app_path, $script.'.js', $app_url);
81 81
 			return;
82 82
 		}
83 83
 
84 84
 		if ($app_path === false && $app_url === false) {
85 85
 			$this->logger->error('Could not find resource {resource} to load', [
86
-				'resource' => $app . '/' . $script . '.js',
86
+				'resource' => $app.'/'.$script.'.js',
87 87
 				'app' => 'jsresourceloader',
88 88
 			]);
89 89
 			return;
90 90
 		}
91 91
 
92 92
 		if (!$this->cacheAndAppendCombineJsonIfExist($app_path, $script.'.json', $app)) {
93
-			$this->append($app_path, $script . '.js', $app_url);
93
+			$this->append($app_path, $script.'.js', $app_url);
94 94
 		}
95 95
 	}
96 96
 
Please login to merge, or discard this patch.
apps/encryption/lib/Command/DisableMasterKey.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -67,7 +67,7 @@
 block discarded – undo
67 67
 
68 68
 		$isMasterKeyEnabled = $this->util->isMasterKeyEnabled();
69 69
 
70
-		if(!$isMasterKeyEnabled) {
70
+		if (!$isMasterKeyEnabled) {
71 71
 			$output->writeln('Master key already disabled');
72 72
 		} else {
73 73
 			$question = new ConfirmationQuestion(
Please login to merge, or discard this patch.
settings/Controller/PersonalSettingsController.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -67,7 +67,7 @@  discard block
 block discarded – undo
67 67
 	protected function getSettings($section) {
68 68
 		$settings = $this->settingsManager->getPersonalSettings($section);
69 69
 		$formatted = $this->formatSettings($settings);
70
-		if($section === 'additional') {
70
+		if ($section === 'additional') {
71 71
 			$formatted['content'] .= $this->getLegacyForms();
72 72
 		}
73 73
 		return $formatted;
@@ -79,9 +79,9 @@  discard block
 block discarded – undo
79 79
 	private function getLegacyForms() {
80 80
 		$forms = \OC_App::getForms('personal');
81 81
 
82
-		$forms = array_map(function ($form) {
82
+		$forms = array_map(function($form) {
83 83
 			if (preg_match('%(<h2(?P<class>[^>]*)>.*?</h2>)%i', $form, $regs)) {
84
-				$sectionName = str_replace('<h2' . $regs['class'] . '>', '', $regs[0]);
84
+				$sectionName = str_replace('<h2'.$regs['class'].'>', '', $regs[0]);
85 85
 				$sectionName = str_replace('</h2>', '', $sectionName);
86 86
 				$anchor = strtolower($sectionName);
87 87
 				$anchor = str_replace(' ', '-', $anchor);
Please login to merge, or discard this patch.
settings/Controller/AdminSettingsController.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -77,7 +77,7 @@  discard block
 block discarded – undo
77 77
 	protected function getSettings($section) {
78 78
 		$settings = $this->settingsManager->getAdminSettings($section);
79 79
 		$formatted = $this->formatSettings($settings);
80
-		if($section === 'additional') {
80
+		if ($section === 'additional') {
81 81
 			$formatted['content'] .= $this->getLegacyForms();
82 82
 		}
83 83
 		return $formatted;
@@ -89,9 +89,9 @@  discard block
 block discarded – undo
89 89
 	private function getLegacyForms() {
90 90
 		$forms = \OC_App::getForms('admin');
91 91
 
92
-		$forms = array_map(function ($form) {
92
+		$forms = array_map(function($form) {
93 93
 			if (preg_match('%(<h2(?P<class>[^>]*)>.*?</h2>)%i', $form, $regs)) {
94
-				$sectionName = str_replace('<h2' . $regs['class'] . '>', '', $regs[0]);
94
+				$sectionName = str_replace('<h2'.$regs['class'].'>', '', $regs[0]);
95 95
 				$sectionName = str_replace('</h2>', '', $sectionName);
96 96
 				$anchor = strtolower($sectionName);
97 97
 				$anchor = str_replace(' ', '-', $anchor);
Please login to merge, or discard this patch.
lib/private/User/User.php 1 patch
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -84,7 +84,7 @@  discard block
 block discarded – undo
84 84
 		$this->uid = $uid;
85 85
 		$this->backend = $backend;
86 86
 		$this->emitter = $emitter;
87
-		if(is_null($config)) {
87
+		if (is_null($config)) {
88 88
 			$config = \OC::$server->getConfig();
89 89
 		}
90 90
 		$this->config = $config;
@@ -160,12 +160,12 @@  discard block
 block discarded – undo
160 160
 	 */
161 161
 	public function setEMailAddress($mailAddress) {
162 162
 		$oldMailAddress = $this->getEMailAddress();
163
-		if($mailAddress === '') {
163
+		if ($mailAddress === '') {
164 164
 			$this->config->deleteUserValue($this->uid, 'settings', 'email');
165 165
 		} else {
166 166
 			$this->config->setUserValue($this->uid, 'settings', 'email', $mailAddress);
167 167
 		}
168
-		if($oldMailAddress !== $mailAddress) {
168
+		if ($oldMailAddress !== $mailAddress) {
169 169
 			$this->triggerChange('eMailAddress', $mailAddress, $oldMailAddress);
170 170
 		}
171 171
 	}
@@ -229,7 +229,7 @@  discard block
 block discarded – undo
229 229
 			}
230 230
 
231 231
 			// Delete the users entry in the storage table
232
-			Storage::remove('home::' . $this->uid);
232
+			Storage::remove('home::'.$this->uid);
233 233
 
234 234
 			\OC::$server->getCommentsManager()->deleteReferencesOfActor('users', $this->uid);
235 235
 			\OC::$server->getCommentsManager()->deleteReadMarksFromUser($this);
@@ -281,9 +281,9 @@  discard block
 block discarded – undo
281 281
 			if ($this->backend->implementsActions(Backend::GET_HOME) and $home = $this->backend->getHome($this->uid)) {
282 282
 				$this->home = $home;
283 283
 			} elseif ($this->config) {
284
-				$this->home = $this->config->getSystemValue('datadirectory', \OC::$SERVERROOT . '/data') . '/' . $this->uid;
284
+				$this->home = $this->config->getSystemValue('datadirectory', \OC::$SERVERROOT.'/data').'/'.$this->uid;
285 285
 			} else {
286
-				$this->home = \OC::$SERVERROOT . '/data/' . $this->uid;
286
+				$this->home = \OC::$SERVERROOT.'/data/'.$this->uid;
287 287
 			}
288 288
 		}
289 289
 		return $this->home;
@@ -295,7 +295,7 @@  discard block
 block discarded – undo
295 295
 	 * @return string
296 296
 	 */
297 297
 	public function getBackendClassName() {
298
-		if($this->backend instanceof IUserBackend) {
298
+		if ($this->backend instanceof IUserBackend) {
299 299
 			return $this->backend->getBackendName();
300 300
 		}
301 301
 		return get_class($this->backend);
@@ -376,7 +376,7 @@  discard block
 block discarded – undo
376 376
 	 */
377 377
 	public function getQuota() {
378 378
 		$quota = $this->config->getUserValue($this->uid, 'files', 'quota', 'default');
379
-		if($quota === 'default') {
379
+		if ($quota === 'default') {
380 380
 			$quota = $this->config->getAppValue('files', 'default_quota', 'none');
381 381
 		}
382 382
 		return $quota;
@@ -391,12 +391,12 @@  discard block
 block discarded – undo
391 391
 	 */
392 392
 	public function setQuota($quota) {
393 393
 		$oldQuota = $this->config->getUserValue($this->uid, 'files', 'quota', '');
394
-		if($quota !== 'none' and $quota !== 'default') {
394
+		if ($quota !== 'none' and $quota !== 'default') {
395 395
 			$quota = OC_Helper::computerFileSize($quota);
396 396
 			$quota = OC_Helper::humanFileSize($quota);
397 397
 		}
398 398
 		$this->config->setUserValue($this->uid, 'files', 'quota', $quota);
399
-		if($quota !== $oldQuota) {
399
+		if ($quota !== $oldQuota) {
400 400
 			$this->triggerChange('quota', $quota);
401 401
 		}
402 402
 	}
@@ -432,7 +432,7 @@  discard block
 block discarded – undo
432 432
 	public function getCloudId() {
433 433
 		$uid = $this->getUID();
434 434
 		$server = $this->urlGenerator->getAbsoluteURL('/');
435
-		$server =  rtrim( $this->removeProtocolFromUrl($server), '/');
435
+		$server = rtrim($this->removeProtocolFromUrl($server), '/');
436 436
 		return \OC::$server->getCloudIdManager()->getCloudId($uid, $server)->getId();
437 437
 	}
438 438
 
Please login to merge, or discard this patch.
apps/files_external/appinfo/app.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -29,13 +29,13 @@
 block discarded – undo
29 29
 
30 30
 OC::$CLASSPATH['OC_Mount_Config'] = 'files_external/lib/config.php';
31 31
 
32
-require_once __DIR__ . '/../3rdparty/autoload.php';
32
+require_once __DIR__.'/../3rdparty/autoload.php';
33 33
 
34 34
 // register Application object singleton
35 35
 \OC_Mount_Config::$app = new \OCA\Files_External\AppInfo\Application();
36 36
 $appContainer = \OC_Mount_Config::$app->getContainer();
37 37
 
38
-\OCA\Files\App::getNavigationManager()->add(function () {
38
+\OCA\Files\App::getNavigationManager()->add(function() {
39 39
 	$l = \OC::$server->getL10N('files_external');
40 40
 	return [
41 41
 		'id' => 'extstoragemounts',
Please login to merge, or discard this patch.