Completed
Pull Request — master (#8232)
by Joas
25:31 queued 09:08
created
lib/private/Activity/EventMerger.php 1 patch
Spacing   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -133,10 +133,10 @@  discard block
 block discarded – undo
133 133
 
134 134
 		// Check that all parameters from $event exist in $previousEvent
135 135
 		foreach ($params1 as $key => $parameter) {
136
-			if (preg_match('/^' . $mergeParameter . '(\d+)?$/', $key)) {
136
+			if (preg_match('/^'.$mergeParameter.'(\d+)?$/', $key)) {
137 137
 				if (!$this->checkParameterAlreadyExits($params, $mergeParameter, $parameter)) {
138 138
 					$combined++;
139
-					$params[$mergeParameter . $combined] = $parameter;
139
+					$params[$mergeParameter.$combined] = $parameter;
140 140
 				}
141 141
 				continue;
142 142
 			}
@@ -151,10 +151,10 @@  discard block
 block discarded – undo
151 151
 
152 152
 		// Check that all parameters from $previousEvent exist in $event
153 153
 		foreach ($params2 as $key => $parameter) {
154
-			if (preg_match('/^' . $mergeParameter . '(\d+)?$/', $key)) {
154
+			if (preg_match('/^'.$mergeParameter.'(\d+)?$/', $key)) {
155 155
 				if (!$this->checkParameterAlreadyExits($params, $mergeParameter, $parameter)) {
156 156
 					$combined++;
157
-					$params[$mergeParameter . $combined] = $parameter;
157
+					$params[$mergeParameter.$combined] = $parameter;
158 158
 				}
159 159
 				continue;
160 160
 			}
@@ -178,7 +178,7 @@  discard block
 block discarded – undo
178 178
 	 */
179 179
 	protected function checkParameterAlreadyExits($parameters, $mergeParameter, $parameter) {
180 180
 		foreach ($parameters as $key => $param) {
181
-			if (preg_match('/^' . $mergeParameter . '(\d+)?$/', $key)) {
181
+			if (preg_match('/^'.$mergeParameter.'(\d+)?$/', $key)) {
182 182
 				if ($param === $parameter) {
183 183
 					return true;
184 184
 				}
@@ -196,30 +196,30 @@  discard block
 block discarded – undo
196 196
 	protected function getExtendedSubject($subject, $parameter, $counter) {
197 197
 		switch ($counter) {
198 198
 			case 1:
199
-				$replacement = '{' . $parameter . '1}';
199
+				$replacement = '{'.$parameter.'1}';
200 200
 				break;
201 201
 			case 2:
202 202
 				$replacement = $this->l10n->t(
203 203
 					'%1$s and %2$s',
204
-					['{' . $parameter . '2}', '{' . $parameter . '1}']
204
+					['{'.$parameter.'2}', '{'.$parameter.'1}']
205 205
 				);
206 206
 				break;
207 207
 			case 3:
208 208
 				$replacement = $this->l10n->t(
209 209
 					'%1$s, %2$s and %3$s',
210
-					['{' . $parameter . '3}', '{' . $parameter . '2}', '{' . $parameter . '1}']
210
+					['{'.$parameter.'3}', '{'.$parameter.'2}', '{'.$parameter.'1}']
211 211
 				);
212 212
 				break;
213 213
 			case 4:
214 214
 				$replacement = $this->l10n->t(
215 215
 					'%1$s, %2$s, %3$s and %4$s',
216
-					['{' . $parameter . '4}', '{' . $parameter . '3}', '{' . $parameter . '2}', '{' . $parameter . '1}']
216
+					['{'.$parameter.'4}', '{'.$parameter.'3}', '{'.$parameter.'2}', '{'.$parameter.'1}']
217 217
 				);
218 218
 				break;
219 219
 			case 5:
220 220
 				$replacement = $this->l10n->t(
221 221
 					'%1$s, %2$s, %3$s, %4$s and %5$s',
222
-					['{' . $parameter . '5}', '{' . $parameter . '4}', '{' . $parameter . '3}', '{' . $parameter . '2}', '{' . $parameter . '1}']
222
+					['{'.$parameter.'5}', '{'.$parameter.'4}', '{'.$parameter.'3}', '{'.$parameter.'2}', '{'.$parameter.'1}']
223 223
 				);
224 224
 				break;
225 225
 			default:
@@ -227,7 +227,7 @@  discard block
 block discarded – undo
227 227
 		}
228 228
 
229 229
 		return str_replace(
230
-			'{' . $parameter . '}',
230
+			'{'.$parameter.'}',
231 231
 			$replacement,
232 232
 			$subject
233 233
 		);
@@ -241,7 +241,7 @@  discard block
 block discarded – undo
241 241
 	protected function generateParsedSubject($subject, $parameters) {
242 242
 		$placeholders = $replacements = [];
243 243
 		foreach ($parameters as $placeholder => $parameter) {
244
-			$placeholders[] = '{' . $placeholder . '}';
244
+			$placeholders[] = '{'.$placeholder.'}';
245 245
 			if ($parameter['type'] === 'file') {
246 246
 				$replacements[] = trim($parameter['path'], '/');
247 247
 			} else if (isset($parameter['name'])) {
Please login to merge, or discard this patch.
lib/private/Repair/CleanTags.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -171,14 +171,14 @@
 block discarded – undo
171 171
 	protected function deleteOrphanEntries(IOutput $output, $repairInfo, $deleteTable, $deleteId, $sourceTable, $sourceId, $sourceNullColumn) {
172 172
 		$qb = $this->connection->getQueryBuilder();
173 173
 
174
-		$qb->select('d.' . $deleteId)
174
+		$qb->select('d.'.$deleteId)
175 175
 			->from($deleteTable, 'd')
176
-			->leftJoin('d', $sourceTable, 's', $qb->expr()->eq('d.' . $deleteId, 's.' . $sourceId))
176
+			->leftJoin('d', $sourceTable, 's', $qb->expr()->eq('d.'.$deleteId, 's.'.$sourceId))
177 177
 			->where(
178 178
 				$qb->expr()->eq('d.type', $qb->expr()->literal('files'))
179 179
 			)
180 180
 			->andWhere(
181
-				$qb->expr()->isNull('s.' . $sourceNullColumn)
181
+				$qb->expr()->isNull('s.'.$sourceNullColumn)
182 182
 			);
183 183
 		$result = $qb->execute();
184 184
 
Please login to merge, or discard this patch.
apps/user_ldap/lib/Controller/RenewPasswordController.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -85,7 +85,7 @@  discard block
 block discarded – undo
85 85
 	 * @return TemplateResponse|RedirectResponse
86 86
 	 */
87 87
 	public function showRenewPasswordForm($user) {
88
-		if($this->config->getUserValue($user, 'user_ldap', 'needsPasswordReset') !== 'true') {
88
+		if ($this->config->getUserValue($user, 'user_ldap', 'needsPasswordReset') !== 'true') {
89 89
 			return new RedirectResponse($this->urlGenerator->linkToRouteAbsolute('core.login.showLoginForm'));
90 90
 		}
91 91
 		$parameters = [];
@@ -129,7 +129,7 @@  discard block
 block discarded – undo
129 129
 	 * @return RedirectResponse
130 130
 	 */
131 131
 	public function tryRenewPassword($user, $oldPassword, $newPassword) {
132
-		if($this->config->getUserValue($user, 'user_ldap', 'needsPasswordReset') !== 'true') {
132
+		if ($this->config->getUserValue($user, 'user_ldap', 'needsPasswordReset') !== 'true') {
133 133
 			return new RedirectResponse($this->urlGenerator->linkToRouteAbsolute('core.login.showLoginForm'));
134 134
 		}
135 135
 		$args = !is_null($user) ? ['user' => $user] : [];
Please login to merge, or discard this patch.
settings/Mailer/NewUserMailHelper.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -102,13 +102,13 @@
 block discarded – undo
102 102
 		if ($generatePasswordResetToken) {
103 103
 			$token = $this->secureRandom->generate(
104 104
 				21,
105
-				ISecureRandom::CHAR_DIGITS .
106
-				ISecureRandom::CHAR_LOWER .
105
+				ISecureRandom::CHAR_DIGITS.
106
+				ISecureRandom::CHAR_LOWER.
107 107
 				ISecureRandom::CHAR_UPPER
108 108
 			);
109
-			$tokenValue = $this->timeFactory->getTime() . ':' . $token;
109
+			$tokenValue = $this->timeFactory->getTime().':'.$token;
110 110
 			$mailAddress = (null !== $user->getEMailAddress()) ? $user->getEMailAddress() : '';
111
-			$encryptedValue = $this->crypto->encrypt($tokenValue, $mailAddress . $this->config->getSystemValue('secret'));
111
+			$encryptedValue = $this->crypto->encrypt($tokenValue, $mailAddress.$this->config->getSystemValue('secret'));
112 112
 			$this->config->setUserValue($user->getUID(), 'core', 'lostpassword', $encryptedValue);
113 113
 			$link = $this->urlGenerator->linkToRouteAbsolute('core.lost.resetform', ['userId' => $user->getUID(), 'token' => $token]);
114 114
 		} else {
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
 		}
172 172
 
173 173
 		// Include
Please login to merge, or discard this patch.
lib/private/DB/ConnectionFactory.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -133,7 +133,7 @@  discard block
 block discarded – undo
133 133
 				if ($host === '') {
134 134
 					$additionalConnectionParams['dbname'] = $dbName; // use dbname as easy connect name
135 135
 				} else {
136
-					$additionalConnectionParams['dbname'] = '//' . $host . (!empty($port) ? ":{$port}" : "") . '/' . $dbName;
136
+					$additionalConnectionParams['dbname'] = '//'.$host.(!empty($port) ? ":{$port}" : "").'/'.$dbName;
137 137
 				}
138 138
 				unset($additionalConnectionParams['host']);
139 139
 				break;
@@ -187,8 +187,8 @@  discard block
 block discarded – undo
187 187
 		$name = $this->config->getValue('dbname', 'owncloud');
188 188
 
189 189
 		if ($this->normalizeType($type) === 'sqlite3') {
190
-			$dataDir = $this->config->getValue("datadirectory", \OC::$SERVERROOT . '/data');
191
-			$connectionParams['path'] = $dataDir . '/' . $name . '.db';
190
+			$dataDir = $this->config->getValue("datadirectory", \OC::$SERVERROOT.'/data');
191
+			$connectionParams['path'] = $dataDir.'/'.$name.'.db';
192 192
 		} else {
193 193
 			$host = $this->config->getValue('dbhost', '');
194 194
 			if (strpos($host, ':')) {
Please login to merge, or discard this patch.
lib/private/Share20/ShareHelper.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -114,7 +114,7 @@  discard block
 block discarded – undo
114 114
 		}
115 115
 
116 116
 		$item = $node;
117
-		$appendix = '/' . $node->getName();
117
+		$appendix = '/'.$node->getName();
118 118
 		while (!empty($byId)) {
119 119
 			try {
120 120
 				/** @var Node $item */
@@ -122,12 +122,12 @@  discard block
 block discarded – undo
122 122
 
123 123
 				if (!empty($byId[$item->getId()])) {
124 124
 					foreach ($byId[$item->getId()] as $uid => $path) {
125
-						$results[$uid] = $path . $appendix;
125
+						$results[$uid] = $path.$appendix;
126 126
 					}
127 127
 					unset($byId[$item->getId()]);
128 128
 				}
129 129
 
130
-				$appendix = '/' . $item->getName() . $appendix;
130
+				$appendix = '/'.$item->getName().$appendix;
131 131
 			} catch (NotFoundException $e) {
132 132
 				return $results;
133 133
 			} catch (InvalidPathException $e) {
@@ -212,6 +212,6 @@  discard block
 block discarded – undo
212 212
 	protected function getMountedPath(Node $node) {
213 213
 		$path = $node->getPath();
214 214
 		$sections = explode('/', $path, 4);
215
-		return '/' . $sections[3];
215
+		return '/'.$sections[3];
216 216
 	}
217 217
 }
Please login to merge, or discard this patch.
lib/private/legacy/response.php 1 patch
Spacing   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -47,7 +47,7 @@  discard block
 block discarded – undo
47 47
 	*/
48 48
 	static public function enableCaching($cache_time = null) {
49 49
 		if (is_numeric($cache_time)) {
50
-			header('Pragma: public');// enable caching in IE
50
+			header('Pragma: public'); // enable caching in IE
51 51
 			if ($cache_time > 0) {
52 52
 				self::setExpiresHeader('PT'.$cache_time.'S');
53 53
 				header('Cache-Control: max-age='.$cache_time.', must-revalidate');
@@ -78,29 +78,29 @@  discard block
 block discarded – undo
78 78
 	*/
79 79
 	static public function setStatus($status) {
80 80
 		$protocol = \OC::$server->getRequest()->getHttpProtocol();
81
-		switch($status) {
81
+		switch ($status) {
82 82
 			case self::STATUS_NOT_MODIFIED:
83
-				$status = $status . ' Not Modified';
83
+				$status = $status.' Not Modified';
84 84
 				break;
85 85
 			case self::STATUS_TEMPORARY_REDIRECT:
86 86
 				if ($protocol == 'HTTP/1.1') {
87
-					$status = $status . ' Temporary Redirect';
87
+					$status = $status.' Temporary Redirect';
88 88
 					break;
89 89
 				} else {
90 90
 					$status = self::STATUS_FOUND;
91 91
 					// fallthrough
92 92
 				}
93 93
 			case self::STATUS_FOUND;
94
-				$status = $status . ' Found';
94
+				$status = $status.' Found';
95 95
 				break;
96 96
 			case self::STATUS_NOT_FOUND;
97
-				$status = $status . ' Not Found';
97
+				$status = $status.' Not Found';
98 98
 				break;
99 99
 			case self::STATUS_INTERNAL_SERVER_ERROR;
100
-				$status = $status . ' Internal Server Error';
100
+				$status = $status.' Internal Server Error';
101 101
 				break;
102 102
 			case self::STATUS_SERVICE_UNAVAILABLE;
103
-				$status = $status . ' Service Unavailable';
103
+				$status = $status.' Service Unavailable';
104 104
 				break;
105 105
 		}
106 106
 		header($protocol.' '.$status);
@@ -180,17 +180,17 @@  discard block
 block discarded – undo
180 180
 	 * @param string $filename file name
181 181
 	 * @param string $type disposition type, either 'attachment' or 'inline'
182 182
 	 */
183
-	static public function setContentDispositionHeader( $filename, $type = 'attachment' ) {
183
+	static public function setContentDispositionHeader($filename, $type = 'attachment') {
184 184
 		if (\OC::$server->getRequest()->isUserAgent(
185 185
 			[
186 186
 				\OC\AppFramework\Http\Request::USER_AGENT_IE,
187 187
 				\OC\AppFramework\Http\Request::USER_AGENT_ANDROID_MOBILE_CHROME,
188 188
 				\OC\AppFramework\Http\Request::USER_AGENT_FREEBOX,
189 189
 			])) {
190
-			header( 'Content-Disposition: ' . rawurlencode($type) . '; filename="' . rawurlencode( $filename ) . '"' );
190
+			header('Content-Disposition: '.rawurlencode($type).'; filename="'.rawurlencode($filename).'"');
191 191
 		} else {
192
-			header( 'Content-Disposition: ' . rawurlencode($type) . '; filename*=UTF-8\'\'' . rawurlencode( $filename )
193
-												 . '; filename="' . rawurlencode( $filename ) . '"' );
192
+			header('Content-Disposition: '.rawurlencode($type).'; filename*=UTF-8\'\''.rawurlencode($filename)
193
+												 . '; filename="'.rawurlencode($filename).'"');
194 194
 		}
195 195
 	}
196 196
 
@@ -256,12 +256,12 @@  discard block
 block discarded – undo
256 256
 			. 'connect-src *; '
257 257
 			. 'object-src \'none\'; '
258 258
 			. 'base-uri \'self\'; ';
259
-		header('Content-Security-Policy:' . $policy);
259
+		header('Content-Security-Policy:'.$policy);
260 260
 		header('X-Frame-Options: SAMEORIGIN'); // Disallow iFraming from other domains
261 261
 
262 262
 		// Send fallback headers for installations that don't have the possibility to send
263 263
 		// custom headers on the webserver side
264
-		if(getenv('modHeadersAvailable') !== 'true') {
264
+		if (getenv('modHeadersAvailable') !== 'true') {
265 265
 			header('X-XSS-Protection: 1; mode=block'); // Enforce browser based XSS filters
266 266
 			header('X-Content-Type-Options: nosniff'); // Disable sniffing the content type for IE
267 267
 			header('X-Robots-Tag: none'); // https://developers.google.com/webmasters/control-crawl-index/docs/robots_meta_tag
Please login to merge, or discard this patch.
apps/files_sharing/lib/SharedStorage.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -173,7 +173,7 @@  discard block
 block discarded – undo
173 173
 	 * @return string
174 174
 	 */
175 175
 	public function getId() {
176
-		return 'shared::' . $this->getMountPoint();
176
+		return 'shared::'.$this->getMountPoint();
177 177
 	}
178 178
 
179 179
 	/**
@@ -269,7 +269,7 @@  discard block
 block discarded – undo
269 269
 					}
270 270
 			}
271 271
 			$info = array(
272
-				'target' => $this->getMountPoint() . $path,
272
+				'target' => $this->getMountPoint().$path,
273 273
 				'source' => $source,
274 274
 				'mode' => $mode,
275 275
 			);
@@ -478,7 +478,7 @@  discard block
 block discarded – undo
478 478
 
479 479
 	public function file_get_contents($path) {
480 480
 		$info = [
481
-			'target' => $this->getMountPoint() . '/' . $path,
481
+			'target' => $this->getMountPoint().'/'.$path,
482 482
 			'source' => $this->getUnjailedPath($path),
483 483
 		];
484 484
 		\OCP\Util::emitHook('\OC\Files\Storage\Shared', 'file_get_contents', $info);
@@ -487,7 +487,7 @@  discard block
 block discarded – undo
487 487
 
488 488
 	public function file_put_contents($path, $data) {
489 489
 		$info = [
490
-			'target' => $this->getMountPoint() . '/' . $path,
490
+			'target' => $this->getMountPoint().'/'.$path,
491 491
 			'source' => $this->getUnjailedPath($path),
492 492
 		];
493 493
 		\OCP\Util::emitHook('\OC\Files\Storage\Shared', 'file_put_contents', $info);
Please login to merge, or discard this patch.