Passed
Push — master ( 356350...344eac )
by Morris
20:06 queued 02:55
created
lib/private/DB/MDB2SchemaReader.php 1 patch
Spacing   +21 added lines, -21 removed lines patch added patch discarded remove patch
@@ -84,7 +84,7 @@  discard block
 block discarded – undo
84 84
 					$this->loadTable($schema, $child);
85 85
 					break;
86 86
 				default:
87
-					throw new \DomainException('Unknown element: ' . $child->getName());
87
+					throw new \DomainException('Unknown element: '.$child->getName());
88 88
 
89 89
 			}
90 90
 		}
@@ -104,7 +104,7 @@  discard block
 block discarded – undo
104 104
 			 */
105 105
 			switch ($child->getName()) {
106 106
 				case 'name':
107
-					$name = (string)$child;
107
+					$name = (string) $child;
108 108
 					$name = str_replace('*dbprefix*', $this->DBTABLEPREFIX, $name);
109 109
 					$name = $this->platform->quoteIdentifier($name);
110 110
 					$table = $schema->createTable($name);
@@ -120,7 +120,7 @@  discard block
 block discarded – undo
120 120
 					$this->loadDeclaration($table, $child);
121 121
 					break;
122 122
 				default:
123
-					throw new \DomainException('Unknown element: ' . $child->getName());
123
+					throw new \DomainException('Unknown element: '.$child->getName());
124 124
 
125 125
 			}
126 126
 		}
@@ -144,7 +144,7 @@  discard block
 block discarded – undo
144 144
 					$this->loadIndex($table, $child);
145 145
 					break;
146 146
 				default:
147
-					throw new \DomainException('Unknown element: ' . $child->getName());
147
+					throw new \DomainException('Unknown element: '.$child->getName());
148 148
 
149 149
 			}
150 150
 		}
@@ -156,18 +156,18 @@  discard block
 block discarded – undo
156 156
 	 * @throws \DomainException
157 157
 	 */
158 158
 	private function loadField($table, $xml) {
159
-		$options = [ 'notnull' => false ];
159
+		$options = ['notnull' => false];
160 160
 		foreach ($xml->children() as $child) {
161 161
 			/**
162 162
 			 * @var \SimpleXMLElement $child
163 163
 			 */
164 164
 			switch ($child->getName()) {
165 165
 				case 'name':
166
-					$name = (string)$child;
166
+					$name = (string) $child;
167 167
 					$name = $this->platform->quoteIdentifier($name);
168 168
 					break;
169 169
 				case 'type':
170
-					$type = (string)$child;
170
+					$type = (string) $child;
171 171
 					switch ($type) {
172 172
 						case 'text':
173 173
 							$type = 'string';
@@ -184,7 +184,7 @@  discard block
 block discarded – undo
184 184
 					}
185 185
 					break;
186 186
 				case 'length':
187
-					$length = (string)$child;
187
+					$length = (string) $child;
188 188
 					$options['length'] = $length;
189 189
 					break;
190 190
 				case 'unsigned':
@@ -200,11 +200,11 @@  discard block
 block discarded – undo
200 200
 					$options['autoincrement'] = $autoincrement;
201 201
 					break;
202 202
 				case 'default':
203
-					$default = (string)$child;
203
+					$default = (string) $child;
204 204
 					$options['default'] = $default;
205 205
 					break;
206 206
 				case 'comments':
207
-					$comment = (string)$child;
207
+					$comment = (string) $child;
208 208
 					$options['comment'] = $comment;
209 209
 					break;
210 210
 				case 'primary':
@@ -212,15 +212,15 @@  discard block
 block discarded – undo
212 212
 					$options['primary'] = $primary;
213 213
 					break;
214 214
 				case 'precision':
215
-					$precision = (string)$child;
215
+					$precision = (string) $child;
216 216
 					$options['precision'] = $precision;
217 217
 					break;
218 218
 				case 'scale':
219
-					$scale = (string)$child;
219
+					$scale = (string) $child;
220 220
 					$options['scale'] = $scale;
221 221
 					break;
222 222
 				default:
223
-					throw new \DomainException('Unknown element: ' . $child->getName());
223
+					throw new \DomainException('Unknown element: '.$child->getName());
224 224
 
225 225
 			}
226 226
 		}
@@ -242,7 +242,7 @@  discard block
 block discarded – undo
242 242
 				}
243 243
 			}
244 244
 			if ($type === 'integer' && isset($options['default'])) {
245
-				$options['default'] = (int)$options['default'];
245
+				$options['default'] = (int) $options['default'];
246 246
 			}
247 247
 			if ($type === 'integer' && isset($options['length'])) {
248 248
 				$length = $options['length'];
@@ -282,7 +282,7 @@  discard block
 block discarded – undo
282 282
 			 */
283 283
 			switch ($child->getName()) {
284 284
 				case 'name':
285
-					$name = (string)$child;
285
+					$name = (string) $child;
286 286
 					break;
287 287
 				case 'primary':
288 288
 					$primary = $this->asBool($child);
@@ -297,20 +297,20 @@  discard block
 block discarded – undo
297 297
 						 */
298 298
 						switch ($field->getName()) {
299 299
 							case 'name':
300
-								$field_name = (string)$field;
300
+								$field_name = (string) $field;
301 301
 								$field_name = $this->platform->quoteIdentifier($field_name);
302 302
 								$fields[] = $field_name;
303 303
 								break;
304 304
 							case 'sorting':
305 305
 								break;
306 306
 							default:
307
-								throw new \DomainException('Unknown element: ' . $field->getName());
307
+								throw new \DomainException('Unknown element: '.$field->getName());
308 308
 
309 309
 						}
310 310
 					}
311 311
 					break;
312 312
 				default:
313
-					throw new \DomainException('Unknown element: ' . $child->getName());
313
+					throw new \DomainException('Unknown element: '.$child->getName());
314 314
 
315 315
 			}
316 316
 		}
@@ -328,7 +328,7 @@  discard block
 block discarded – undo
328 328
 				}
329 329
 			}
330 330
 		} else {
331
-			throw new \DomainException('Empty index definition: ' . $name . ' options:' . print_r($fields, true));
331
+			throw new \DomainException('Empty index definition: '.$name.' options:'.print_r($fields, true));
332 332
 		}
333 333
 	}
334 334
 
@@ -337,12 +337,12 @@  discard block
 block discarded – undo
337 337
 	 * @return bool
338 338
 	 */
339 339
 	private function asBool($xml) {
340
-		$result = (string)$xml;
340
+		$result = (string) $xml;
341 341
 		if ($result == 'true') {
342 342
 			$result = true;
343 343
 		} elseif ($result == 'false') {
344 344
 			$result = false;
345 345
 		}
346
-		return (bool)$result;
346
+		return (bool) $result;
347 347
 	}
348 348
 }
Please login to merge, or discard this patch.
lib/private/DB/OracleConnection.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -82,7 +82,7 @@  discard block
 block discarded – undo
82 82
 	 * @param string $table table name without the prefix
83 83
 	 */
84 84
 	public function dropTable($table) {
85
-		$table = $this->tablePrefix . trim($table);
85
+		$table = $this->tablePrefix.trim($table);
86 86
 		$table = $this->quoteIdentifier($table);
87 87
 		$schema = $this->getSchemaManager();
88 88
 		if ($schema->tablesExist([$table])) {
@@ -97,7 +97,7 @@  discard block
 block discarded – undo
97 97
 	 * @return bool
98 98
 	 */
99 99
 	public function tableExists($table) {
100
-		$table = $this->tablePrefix . trim($table);
100
+		$table = $this->tablePrefix.trim($table);
101 101
 		$table = $this->quoteIdentifier($table);
102 102
 		$schema = $this->getSchemaManager();
103 103
 		return $schema->tablesExist([$table]);
Please login to merge, or discard this patch.
lib/private/DB/Connection.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -59,7 +59,7 @@  discard block
 block discarded – undo
59 59
 			return parent::connect();
60 60
 		} catch (DBALException $e) {
61 61
 			// throw a new exception to prevent leaking info from the stacktrace
62
-			throw new DBALException('Failed to connect to the database: ' . $e->getMessage(), $e->getCode());
62
+			throw new DBALException('Failed to connect to the database: '.$e->getMessage(), $e->getCode());
63 63
 		}
64 64
 	}
65 65
 
@@ -111,7 +111,7 @@  discard block
 block discarded – undo
111 111
 		// 0 is the method where we use `getCallerBacktrace`
112 112
 		// 1 is the target method which uses the method we want to log
113 113
 		if (isset($traces[1])) {
114
-			return $traces[1]['file'] . ':' . $traces[1]['line'];
114
+			return $traces[1]['file'].':'.$traces[1]['line'];
115 115
 		}
116 116
 
117 117
 		return '';
@@ -280,7 +280,7 @@  discard block
 block discarded – undo
280 280
 			$insertQb = $this->getQueryBuilder();
281 281
 			$insertQb->insert($table)
282 282
 				->values(
283
-					array_map(function ($value) use ($insertQb) {
283
+					array_map(function($value) use ($insertQb) {
284 284
 						return $insertQb->createNamedParameter($value, $this->getType($value));
285 285
 					}, array_merge($keys, $values))
286 286
 				);
@@ -324,7 +324,7 @@  discard block
 block discarded – undo
324 324
 			throw new \BadMethodCallException('Can not lock a new table until the previous lock is released.');
325 325
 		}
326 326
 
327
-		$tableName = $this->tablePrefix . $tableName;
327
+		$tableName = $this->tablePrefix.$tableName;
328 328
 		$this->lockedTable = $tableName;
329 329
 		$this->adapter->lockTable($tableName);
330 330
 	}
@@ -345,11 +345,11 @@  discard block
 block discarded – undo
345 345
 	 * @return string
346 346
 	 */
347 347
 	public function getError() {
348
-		$msg = $this->errorCode() . ': ';
348
+		$msg = $this->errorCode().': ';
349 349
 		$errorInfo = $this->errorInfo();
350 350
 		if (is_array($errorInfo)) {
351
-			$msg .= 'SQLSTATE = '.$errorInfo[0] . ', ';
352
-			$msg .= 'Driver Code = '.$errorInfo[1] . ', ';
351
+			$msg .= 'SQLSTATE = '.$errorInfo[0].', ';
352
+			$msg .= 'Driver Code = '.$errorInfo[1].', ';
353 353
 			$msg .= 'Driver Message = '.$errorInfo[2];
354 354
 		}
355 355
 		return $msg;
@@ -361,7 +361,7 @@  discard block
 block discarded – undo
361 361
 	 * @param string $table table name without the prefix
362 362
 	 */
363 363
 	public function dropTable($table) {
364
-		$table = $this->tablePrefix . trim($table);
364
+		$table = $this->tablePrefix.trim($table);
365 365
 		$schema = $this->getSchemaManager();
366 366
 		if ($schema->tablesExist([$table])) {
367 367
 			$schema->dropTable($table);
@@ -375,7 +375,7 @@  discard block
 block discarded – undo
375 375
 	 * @return bool
376 376
 	 */
377 377
 	public function tableExists($table) {
378
-		$table = $this->tablePrefix . trim($table);
378
+		$table = $this->tablePrefix.trim($table);
379 379
 		$schema = $this->getSchemaManager();
380 380
 		return $schema->tablesExist([$table]);
381 381
 	}
Please login to merge, or discard this patch.
lib/private/DB/Migrator.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -135,7 +135,7 @@  discard block
 block discarded – undo
135 135
 	 * @return string
136 136
 	 */
137 137
 	protected function generateTemporaryTableName($name) {
138
-		return $this->config->getSystemValue('dbtableprefix', 'oc_') . $name . '_' . $this->random->generate(13, ISecureRandom::CHAR_LOWER . ISecureRandom::CHAR_DIGITS);
138
+		return $this->config->getSystemValue('dbtableprefix', 'oc_').$name.'_'.$this->random->generate(13, ISecureRandom::CHAR_LOWER.ISecureRandom::CHAR_DIGITS);
139 139
 	}
140 140
 
141 141
 	/**
@@ -186,7 +186,7 @@  discard block
 block discarded – undo
186 186
 				$indexName = $index->getName();
187 187
 			} else {
188 188
 				// avoid conflicts in index names
189
-				$indexName = $this->config->getSystemValue('dbtableprefix', 'oc_') . $this->random->generate(13, ISecureRandom::CHAR_LOWER);
189
+				$indexName = $this->config->getSystemValue('dbtableprefix', 'oc_').$this->random->generate(13, ISecureRandom::CHAR_LOWER);
190 190
 			}
191 191
 			$newIndexes[] = new Index($indexName, $index->getColumns(), $index->isUnique(), $index->isPrimary());
192 192
 		}
@@ -271,15 +271,15 @@  discard block
 block discarded – undo
271 271
 		$quotedSource = $this->connection->quoteIdentifier($sourceName);
272 272
 		$quotedTarget = $this->connection->quoteIdentifier($targetName);
273 273
 
274
-		$this->connection->exec('CREATE TABLE ' . $quotedTarget . ' (LIKE ' . $quotedSource . ')');
275
-		$this->connection->exec('INSERT INTO ' . $quotedTarget . ' SELECT * FROM ' . $quotedSource);
274
+		$this->connection->exec('CREATE TABLE '.$quotedTarget.' (LIKE '.$quotedSource.')');
275
+		$this->connection->exec('INSERT INTO '.$quotedTarget.' SELECT * FROM '.$quotedSource);
276 276
 	}
277 277
 
278 278
 	/**
279 279
 	 * @param string $name
280 280
 	 */
281 281
 	protected function dropTable($name) {
282
-		$this->connection->exec('DROP TABLE ' . $this->connection->quoteIdentifier($name));
282
+		$this->connection->exec('DROP TABLE '.$this->connection->quoteIdentifier($name));
283 283
 	}
284 284
 
285 285
 	/**
@@ -287,14 +287,14 @@  discard block
 block discarded – undo
287 287
 	 * @return string
288 288
 	 */
289 289
 	protected function convertStatementToScript($statement) {
290
-		$script = $statement . ';';
290
+		$script = $statement.';';
291 291
 		$script .= PHP_EOL;
292 292
 		$script .= PHP_EOL;
293 293
 		return $script;
294 294
 	}
295 295
 
296 296
 	protected function getFilterExpression() {
297
-		return '/^' . preg_quote($this->config->getSystemValue('dbtableprefix', 'oc_')) . '/';
297
+		return '/^'.preg_quote($this->config->getSystemValue('dbtableprefix', 'oc_')).'/';
298 298
 	}
299 299
 
300 300
 	protected function emit($sql, $step, $max) {
Please login to merge, or discard this patch.
lib/private/DB/MDB2SchemaWriter.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -51,9 +51,9 @@
 block discarded – undo
51 51
 
52 52
 		// FIX ME: bloody work around
53 53
 		if ($config->getSystemValue('dbtype', 'sqlite') === 'oci') {
54
-			$filterExpression = '/^"' . preg_quote($conn->getPrefix()) . '/';
54
+			$filterExpression = '/^"'.preg_quote($conn->getPrefix()).'/';
55 55
 		} else {
56
-			$filterExpression = '/^' . preg_quote($conn->getPrefix()) . '/';
56
+			$filterExpression = '/^'.preg_quote($conn->getPrefix()).'/';
57 57
 		}
58 58
 		$conn->getConfiguration()->setFilterSchemaAssetsExpression($filterExpression);
59 59
 
Please login to merge, or discard this patch.
lib/private/PreviewManager.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -333,7 +333,7 @@
 block discarded – undo
333 333
 	 */
334 334
 	protected function registerCoreProvider($class, $mimeType, $options = []) {
335 335
 		if (in_array(trim($class, '\\'), $this->getEnabledDefaultProvider())) {
336
-			$this->registerProvider($mimeType, function () use ($class, $options) {
336
+			$this->registerProvider($mimeType, function() use ($class, $options) {
337 337
 				return new $class($options);
338 338
 			});
339 339
 		}
Please login to merge, or discard this patch.
lib/private/Group/MetaData.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -60,7 +60,7 @@  discard block
 block discarded – undo
60 60
 			IUserSession $userSession
61 61
 			) {
62 62
 		$this->user = $user;
63
-		$this->isAdmin = (bool)$isAdmin;
63
+		$this->isAdmin = (bool) $isAdmin;
64 64
 		$this->groupManager = $groupManager;
65 65
 		$this->userSession = $userSession;
66 66
 	}
@@ -76,7 +76,7 @@  discard block
 block discarded – undo
76 76
 	 * @return array
77 77
 	 */
78 78
 	public function get($groupSearch = '', $userSearch = '') {
79
-		$key = $groupSearch . '::' . $userSearch;
79
+		$key = $groupSearch.'::'.$userSearch;
80 80
 		if (isset($this->metaData[$key])) {
81 81
 			return $this->metaData[$key];
82 82
 		}
Please login to merge, or discard this patch.
lib/private/Group/Backend.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
 	 * compared with \OC\Group\Backend::CREATE_GROUP etc.
68 68
 	 */
69 69
 	public function implementsActions($actions) {
70
-		return (bool)($this->getSupportedActions() & $actions);
70
+		return (bool) ($this->getSupportedActions() & $actions);
71 71
 	}
72 72
 
73 73
 	/**
Please login to merge, or discard this patch.
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
 			} elseif (isset($parameter['name'])) {
Please login to merge, or discard this patch.