Completed
Push — master ( 126a82...e45248 )
by Morris
11:37
created
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.
core/Command/Integrity/CheckApp.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -63,10 +63,10 @@
 block discarded – undo
63 63
 	 */
64 64
 	protected function execute(InputInterface $input, OutputInterface $output) {
65 65
 		$appid = $input->getArgument('appid');
66
-		$path = (string)$input->getOption('path');
66
+		$path = (string) $input->getOption('path');
67 67
 		$result = $this->checker->verifyAppSignature($appid, $path);
68 68
 		$this->writeArrayInOutputFormat($input, $output, $result);
69
-		if (count($result)>0){
69
+		if (count($result) > 0) {
70 70
 			return 1;
71 71
 		}
72 72
 	}
Please login to merge, or discard this patch.
lib/public/Collaboration/Collaborators/SearchResultType.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -58,13 +58,13 @@
 block discarded – undo
58 58
 	 * @since 13.0.0
59 59
 	 */
60 60
 	protected function getValidatedType($type) {
61
-		$type = trim((string)$type);
61
+		$type = trim((string) $type);
62 62
 
63
-		if($type === '') {
63
+		if ($type === '') {
64 64
 			throw new \InvalidArgumentException('Type must not be empty');
65 65
 		}
66 66
 
67
-		if($type === 'exact') {
67
+		if ($type === 'exact') {
68 68
 			throw new \InvalidArgumentException('Provided type is a reserved word');
69 69
 		}
70 70
 
Please login to merge, or discard this patch.
lib/private/Route/CachingRouter.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
 	 */
53 53
 	public function generate($name, $parameters = array(), $absolute = false) {
54 54
 		asort($parameters);
55
-		$key = $this->context->getHost() . '#' . $this->context->getBaseUrl() . $name . sha1(json_encode($parameters)) . (int)$absolute;
55
+		$key = $this->context->getHost().'#'.$this->context->getBaseUrl().$name.sha1(json_encode($parameters)).(int) $absolute;
56 56
 		$cachedKey = $this->cache->get($key);
57 57
 		if ($cachedKey) {
58 58
 			return $cachedKey;
Please login to merge, or discard this patch.
apps/dav/lib/SystemTag/SystemTagsRelationsCollection.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
 				$userSession,
61 61
 				$groupManager,
62 62
 				function($name) {
63
-					$nodes = \OC::$server->getUserFolder()->getById((int)$name);
63
+					$nodes = \OC::$server->getUserFolder()->getById((int) $name);
64 64
 					return !empty($nodes);
65 65
 				}
66 66
 			),
Please login to merge, or discard this patch.
apps/dav/lib/Connector/Sabre/CommentPropertiesPlugin.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -97,7 +97,7 @@  discard block
 block discarded – undo
97 97
 		}
98 98
 
99 99
 		$propFind->handle(self::PROPERTY_NAME_COUNT, function() use ($node) {
100
-			return $this->commentsManager->getNumberOfCommentsForObject('files', (string)$node->getId());
100
+			return $this->commentsManager->getNumberOfCommentsForObject('files', (string) $node->getId());
101 101
 		});
102 102
 
103 103
 		$propFind->handle(self::PROPERTY_NAME_HREF, function() use ($node) {
@@ -129,13 +129,13 @@  discard block
 block discarded – undo
129 129
 	 * @return mixed|string
130 130
 	 */
131 131
 	public function getCommentsLink(Node $node) {
132
-		$href =  $this->server->getBaseUri();
132
+		$href = $this->server->getBaseUri();
133 133
 		$entryPoint = strpos($href, '/remote.php/');
134
-		if($entryPoint === false) {
134
+		if ($entryPoint === false) {
135 135
 			// in case we end up somewhere else, unexpectedly.
136 136
 			return null;
137 137
 		}
138
-		$commentsPart = 'dav/comments/files/' . rawurldecode($node->getId());
138
+		$commentsPart = 'dav/comments/files/'.rawurldecode($node->getId());
139 139
 		$href = substr_replace($href, $commentsPart, $entryPoint + strlen('/remote.php/'));
140 140
 		return $href;
141 141
 	}
@@ -149,13 +149,13 @@  discard block
 block discarded – undo
149 149
 	 */
150 150
 	public function getUnreadCount(Node $node) {
151 151
 		$user = $this->userSession->getUser();
152
-		if(is_null($user)) {
152
+		if (is_null($user)) {
153 153
 			return null;
154 154
 		}
155 155
 
156
-		$lastRead = $this->commentsManager->getReadMark('files', (string)$node->getId(), $user);
156
+		$lastRead = $this->commentsManager->getReadMark('files', (string) $node->getId(), $user);
157 157
 
158
-		return $this->commentsManager->getNumberOfCommentsForObject('files', (string)$node->getId(), $lastRead);
158
+		return $this->commentsManager->getNumberOfCommentsForObject('files', (string) $node->getId(), $lastRead);
159 159
 	}
160 160
 
161 161
 }
Please login to merge, or discard this patch.
apps/dav/lib/CalDAV/Search/Xml/Filter/OffsetFilter.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -37,9 +37,9 @@
 block discarded – undo
37 37
 	static function xmlDeserialize(Reader $reader) {
38 38
 		$value = $reader->parseInnerTree();
39 39
 		if (!is_int($value) && !is_string($value)) {
40
-			throw new BadRequest('The {' . SearchPlugin::NS_Nextcloud . '}offset has illegal value');
40
+			throw new BadRequest('The {'.SearchPlugin::NS_Nextcloud.'}offset has illegal value');
41 41
 		}
42 42
 
43
-		return (int)$value;
43
+		return (int) $value;
44 44
 	}
45 45
 }
46 46
\ No newline at end of file
Please login to merge, or discard this patch.