Passed
Push — master ( c00d6f...a085a8 )
by Morris
09:54 queued 11s
created
lib/private/DB/PostgreSqlMigrator.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -37,7 +37,7 @@
 block discarded – undo
37 37
 			// fix default value in brackets - pg 9.4 is returning a negative default value in ()
38 38
 			// see https://github.com/doctrine/dbal/issues/2427
39 39
 			foreach ($tableDiff->changedColumns as $column) {
40
-				$column->changedProperties = array_filter($column->changedProperties, function ($changedProperties) use ($column) {
40
+				$column->changedProperties = array_filter($column->changedProperties, function($changedProperties) use ($column) {
41 41
 					if ($changedProperties !== 'default') {
42 42
 						return true;
43 43
 					}
Please login to merge, or discard this patch.
lib/private/DB/AdapterMySQL.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -34,7 +34,7 @@  discard block
 block discarded – undo
34 34
 	 * @param string $tableName
35 35
 	 */
36 36
 	public function lockTable($tableName) {
37
-		$this->conn->executeUpdate('LOCK TABLES `' .$tableName . '` WRITE');
37
+		$this->conn->executeUpdate('LOCK TABLES `'.$tableName.'` WRITE');
38 38
 	}
39 39
 
40 40
 	public function unlockTable() {
@@ -42,7 +42,7 @@  discard block
 block discarded – undo
42 42
 	}
43 43
 
44 44
 	public function fixupStatement($statement) {
45
-		$statement = str_replace(' ILIKE ', ' COLLATE ' . $this->getCharset() . '_general_ci LIKE ', $statement);
45
+		$statement = str_replace(' ILIKE ', ' COLLATE '.$this->getCharset().'_general_ci LIKE ', $statement);
46 46
 		return $statement;
47 47
 	}
48 48
 
Please login to merge, or discard this patch.
lib/private/DB/MDB2SchemaWriter.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -43,7 +43,7 @@  discard block
 block discarded – undo
43 43
 		$xml->addChild('name', $config->getSystemValue('dbname', 'owncloud'));
44 44
 		$xml->addChild('create', 'true');
45 45
 		$xml->addChild('overwrite', 'false');
46
-		if($config->getSystemValue('dbtype', 'sqlite') === 'mysql' && $config->getSystemValue('mysql.utf8mb4', false)) {
46
+		if ($config->getSystemValue('dbtype', 'sqlite') === 'mysql' && $config->getSystemValue('mysql.utf8mb4', false)) {
47 47
 			$xml->addChild('charset', 'utf8mb4');
48 48
 		} else {
49 49
 			$xml->addChild('charset', 'utf8');
@@ -51,9 +51,9 @@  discard block
 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
 
@@ -71,13 +71,13 @@  discard block
 block discarded – undo
71 71
 	private static function saveTable($table, $xml) {
72 72
 		$xml->addChild('name', $table->getName());
73 73
 		$declaration = $xml->addChild('declaration');
74
-		foreach($table->getColumns() as $column) {
74
+		foreach ($table->getColumns() as $column) {
75 75
 			self::saveColumn($column, $declaration->addChild('field'));
76 76
 		}
77
-		foreach($table->getIndexes() as $index) {
77
+		foreach ($table->getIndexes() as $index) {
78 78
 			if ($index->getName() == 'PRIMARY') {
79 79
 				$autoincrement = false;
80
-				foreach($index->getColumns() as $column) {
80
+				foreach ($index->getColumns() as $column) {
81 81
 					if ($table->getColumn($column)->getAutoincrement()) {
82 82
 						$autoincrement = true;
83 83
 					}
@@ -96,7 +96,7 @@  discard block
 block discarded – undo
96 96
 	 */
97 97
 	private static function saveColumn($column, $xml) {
98 98
 		$xml->addChild('name', $column->getName());
99
-		switch($column->getType()) {
99
+		switch ($column->getType()) {
100 100
 			case 'SmallInt':
101 101
 			case 'Integer':
102 102
 			case 'BigInt':
@@ -169,7 +169,7 @@  discard block
 block discarded – undo
169 169
 		elseif ($index->isUnique()) {
170 170
 			$xml->addChild('unique', 'true');
171 171
 		}
172
-		foreach($index->getColumns() as $column) {
172
+		foreach ($index->getColumns() as $column) {
173 173
 			$field = $xml->addChild('field');
174 174
 			$field->addChild('name', $column);
175 175
 			$field->addChild('sorting', 'ascending');
Please login to merge, or discard this patch.
lib/private/DB/Migrator.php 1 patch
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -137,7 +137,7 @@  discard block
 block discarded – undo
137 137
 	 * @return string
138 138
 	 */
139 139
 	protected function generateTemporaryTableName($name) {
140
-		return $this->config->getSystemValue('dbtableprefix', 'oc_') . $name . '_' . $this->random->generate(13, ISecureRandom::CHAR_LOWER . ISecureRandom::CHAR_DIGITS);
140
+		return $this->config->getSystemValue('dbtableprefix', 'oc_').$name.'_'.$this->random->generate(13, ISecureRandom::CHAR_LOWER.ISecureRandom::CHAR_DIGITS);
141 141
 	}
142 142
 
143 143
 	/**
@@ -188,7 +188,7 @@  discard block
 block discarded – undo
188 188
 				$indexName = $index->getName();
189 189
 			} else {
190 190
 				// avoid conflicts in index names
191
-				$indexName = $this->config->getSystemValue('dbtableprefix', 'oc_') . $this->random->generate(13, ISecureRandom::CHAR_LOWER);
191
+				$indexName = $this->config->getSystemValue('dbtableprefix', 'oc_').$this->random->generate(13, ISecureRandom::CHAR_LOWER);
192 192
 			}
193 193
 			$newIndexes[] = new Index($indexName, $index->getColumns(), $index->isUnique(), $index->isPrimary());
194 194
 		}
@@ -268,15 +268,15 @@  discard block
 block discarded – undo
268 268
 		$quotedSource = $this->connection->quoteIdentifier($sourceName);
269 269
 		$quotedTarget = $this->connection->quoteIdentifier($targetName);
270 270
 
271
-		$this->connection->exec('CREATE TABLE ' . $quotedTarget . ' (LIKE ' . $quotedSource . ')');
272
-		$this->connection->exec('INSERT INTO ' . $quotedTarget . ' SELECT * FROM ' . $quotedSource);
271
+		$this->connection->exec('CREATE TABLE '.$quotedTarget.' (LIKE '.$quotedSource.')');
272
+		$this->connection->exec('INSERT INTO '.$quotedTarget.' SELECT * FROM '.$quotedSource);
273 273
 	}
274 274
 
275 275
 	/**
276 276
 	 * @param string $name
277 277
 	 */
278 278
 	protected function dropTable($name) {
279
-		$this->connection->exec('DROP TABLE ' . $this->connection->quoteIdentifier($name));
279
+		$this->connection->exec('DROP TABLE '.$this->connection->quoteIdentifier($name));
280 280
 	}
281 281
 
282 282
 	/**
@@ -284,30 +284,30 @@  discard block
 block discarded – undo
284 284
 	 * @return string
285 285
 	 */
286 286
 	protected function convertStatementToScript($statement) {
287
-		$script = $statement . ';';
287
+		$script = $statement.';';
288 288
 		$script .= PHP_EOL;
289 289
 		$script .= PHP_EOL;
290 290
 		return $script;
291 291
 	}
292 292
 
293 293
 	protected function getFilterExpression() {
294
-		return '/^' . preg_quote($this->config->getSystemValue('dbtableprefix', 'oc_')) . '/';
294
+		return '/^'.preg_quote($this->config->getSystemValue('dbtableprefix', 'oc_')).'/';
295 295
 	}
296 296
 
297 297
 	protected function emit($sql, $step, $max) {
298 298
 		if ($this->noEmit) {
299 299
 			return;
300 300
 		}
301
-		if(is_null($this->dispatcher)) {
301
+		if (is_null($this->dispatcher)) {
302 302
 			return;
303 303
 		}
304
-		$this->dispatcher->dispatch('\OC\DB\Migrator::executeSql', new GenericEvent($sql, [$step+1, $max]));
304
+		$this->dispatcher->dispatch('\OC\DB\Migrator::executeSql', new GenericEvent($sql, [$step + 1, $max]));
305 305
 	}
306 306
 
307 307
 	private function emitCheckStep($tableName, $step, $max) {
308
-		if(is_null($this->dispatcher)) {
308
+		if (is_null($this->dispatcher)) {
309 309
 			return;
310 310
 		}
311
-		$this->dispatcher->dispatch('\OC\DB\Migrator::checkTable', new GenericEvent($tableName, [$step+1, $max]));
311
+		$this->dispatcher->dispatch('\OC\DB\Migrator::checkTable', new GenericEvent($tableName, [$step + 1, $max]));
312 312
 	}
313 313
 }
Please login to merge, or discard this patch.
lib/private/DB/SQLiteMigrator.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -63,7 +63,7 @@
 block discarded – undo
63 63
 	 * @return string
64 64
 	 */
65 65
 	private function buildTempDatabase() {
66
-		$dataDir = $this->config->getSystemValue("datadirectory", \OC::$SERVERROOT . '/data');
66
+		$dataDir = $this->config->getSystemValue("datadirectory", \OC::$SERVERROOT.'/data');
67 67
 		$tmpFile = uniqid("oc_");
68 68
 		return "$dataDir/$tmpFile.db";
69 69
 	}
Please login to merge, or discard this patch.
lib/private/App/CodeChecker/NodeVisitor.php 1 patch
Spacing   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -102,7 +102,7 @@  discard block
 block discarded – undo
102 102
 
103 103
 	public function enterNode(Node $node) {
104 104
 		if ($this->checkEqualOperatorUsage && $node instanceof Node\Expr\BinaryOp\Equal) {
105
-			$this->errors[]= [
105
+			$this->errors[] = [
106 106
 				'disallowedToken' => '==',
107 107
 				'errorCode' => CodeChecker::OP_OPERATOR_USAGE_DISCOURAGED,
108 108
 				'line' => $node->getLine(),
@@ -110,7 +110,7 @@  discard block
 block discarded – undo
110 110
 			];
111 111
 		}
112 112
 		if ($this->checkEqualOperatorUsage && $node instanceof Node\Expr\BinaryOp\NotEqual) {
113
-			$this->errors[]= [
113
+			$this->errors[] = [
114 114
 				'disallowedToken' => '!=',
115 115
 				'errorCode' => CodeChecker::OP_OPERATOR_USAGE_DISCOURAGED,
116 116
 				'line' => $node->getLine(),
@@ -214,28 +214,28 @@  discard block
 block discarded – undo
214 214
 		$alias = strtolower($alias);
215 215
 
216 216
 		foreach ($this->blackListedClassNames as $blackListedAlias => $blackListedClassName) {
217
-			if (strpos($blackListedClassName, $name . '\\') === 0) {
217
+			if (strpos($blackListedClassName, $name.'\\') === 0) {
218 218
 				$aliasedClassName = str_replace($name, $alias, $blackListedClassName);
219 219
 				$this->blackListedClassNames[$aliasedClassName] = $blackListedClassName;
220 220
 			}
221 221
 		}
222 222
 
223 223
 		foreach ($this->blackListedConstants as $blackListedAlias => $blackListedConstant) {
224
-			if (strpos($blackListedConstant, $name . '\\') === 0 || strpos($blackListedConstant, $name . '::') === 0) {
224
+			if (strpos($blackListedConstant, $name.'\\') === 0 || strpos($blackListedConstant, $name.'::') === 0) {
225 225
 				$aliasedConstantName = str_replace($name, $alias, $blackListedConstant);
226 226
 				$this->blackListedConstants[$aliasedConstantName] = $blackListedConstant;
227 227
 			}
228 228
 		}
229 229
 
230 230
 		foreach ($this->blackListedFunctions as $blackListedAlias => $blackListedFunction) {
231
-			if (strpos($blackListedFunction, $name . '\\') === 0 || strpos($blackListedFunction, $name . '::') === 0) {
231
+			if (strpos($blackListedFunction, $name.'\\') === 0 || strpos($blackListedFunction, $name.'::') === 0) {
232 232
 				$aliasedFunctionName = str_replace($name, $alias, $blackListedFunction);
233 233
 				$this->blackListedFunctions[$aliasedFunctionName] = $blackListedFunction;
234 234
 			}
235 235
 		}
236 236
 
237 237
 		foreach ($this->blackListedMethods as $blackListedAlias => $blackListedMethod) {
238
-			if (strpos($blackListedMethod, $name . '\\') === 0 || strpos($blackListedMethod, $name . '::') === 0) {
238
+			if (strpos($blackListedMethod, $name.'\\') === 0 || strpos($blackListedMethod, $name.'::') === 0) {
239 239
 				$aliasedMethodName = str_replace($name, $alias, $blackListedMethod);
240 240
 				$this->blackListedMethods[$aliasedMethodName] = $blackListedMethod;
241 241
 			}
@@ -246,7 +246,7 @@  discard block
 block discarded – undo
246 246
 		$lowerName = strtolower($name);
247 247
 
248 248
 		if (isset($this->blackListedClassNames[$lowerName])) {
249
-			$this->errors[]= [
249
+			$this->errors[] = [
250 250
 				'disallowedToken' => $name,
251 251
 				'errorCode' => $errorCode,
252 252
 				'line' => $node->getLine(),
@@ -256,11 +256,11 @@  discard block
 block discarded – undo
256 256
 	}
257 257
 
258 258
 	private function checkBlackListConstant($class, $constantName, Node $node) {
259
-		$name = $class . '::' . $constantName;
259
+		$name = $class.'::'.$constantName;
260 260
 		$lowerName = strtolower($name);
261 261
 
262 262
 		if (isset($this->blackListedConstants[$lowerName])) {
263
-			$this->errors[]= [
263
+			$this->errors[] = [
264 264
 				'disallowedToken' => $name,
265 265
 				'errorCode' => CodeChecker::CLASS_CONST_FETCH_NOT_ALLOWED,
266 266
 				'line' => $node->getLine(),
@@ -270,11 +270,11 @@  discard block
 block discarded – undo
270 270
 	}
271 271
 
272 272
 	private function checkBlackListFunction($class, $functionName, Node $node) {
273
-		$name = $class . '::' . $functionName;
273
+		$name = $class.'::'.$functionName;
274 274
 		$lowerName = strtolower($name);
275 275
 
276 276
 		if (isset($this->blackListedFunctions[$lowerName])) {
277
-			$this->errors[]= [
277
+			$this->errors[] = [
278 278
 				'disallowedToken' => $name,
279 279
 				'errorCode' => CodeChecker::STATIC_CALL_NOT_ALLOWED,
280 280
 				'line' => $node->getLine(),
@@ -284,11 +284,11 @@  discard block
 block discarded – undo
284 284
 	}
285 285
 
286 286
 	private function checkBlackListMethod($class, $functionName, Node $node) {
287
-		$name = $class . '::' . $functionName;
287
+		$name = $class.'::'.$functionName;
288 288
 		$lowerName = strtolower($name);
289 289
 
290 290
 		if (isset($this->blackListedMethods[$lowerName])) {
291
-			$this->errors[]= [
291
+			$this->errors[] = [
292 292
 				'disallowedToken' => $name,
293 293
 				'errorCode' => CodeChecker::CLASS_METHOD_CALL_NOT_ALLOWED,
294 294
 				'line' => $node->getLine(),
Please login to merge, or discard this patch.
lib/private/App/CodeChecker/CodeChecker.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -42,10 +42,10 @@  discard block
 block discarded – undo
42 42
 	const CLASS_IMPLEMENTS_NOT_ALLOWED = 1001;
43 43
 	const STATIC_CALL_NOT_ALLOWED = 1002;
44 44
 	const CLASS_CONST_FETCH_NOT_ALLOWED = 1003;
45
-	const CLASS_NEW_NOT_ALLOWED =  1004;
46
-	const OP_OPERATOR_USAGE_DISCOURAGED =  1005;
47
-	const CLASS_USE_NOT_ALLOWED =  1006;
48
-	const CLASS_METHOD_CALL_NOT_ALLOWED =  1007;
45
+	const CLASS_NEW_NOT_ALLOWED = 1004;
46
+	const OP_OPERATOR_USAGE_DISCOURAGED = 1005;
47
+	const CLASS_USE_NOT_ALLOWED = 1006;
48
+	const CLASS_METHOD_CALL_NOT_ALLOWED = 1007;
49 49
 
50 50
 	/** @var Parser */
51 51
 	private $parser;
@@ -85,13 +85,13 @@  discard block
 block discarded – undo
85 85
 		}
86 86
 
87 87
 		$excludes = array_map(function($item) use ($folder) {
88
-			return $folder . '/' . $item;
88
+			return $folder.'/'.$item;
89 89
 		}, $excludedDirectories);
90 90
 
91 91
 		$iterator = new RecursiveDirectoryIterator($folder, RecursiveDirectoryIterator::SKIP_DOTS);
92 92
 		$iterator = new RecursiveCallbackFilterIterator($iterator, function($item) use ($folder, $excludes){
93 93
 			/** @var SplFileInfo $item */
94
-			foreach($excludes as $exclude) {
94
+			foreach ($excludes as $exclude) {
95 95
 				if (substr($item->getPath(), 0, strlen($exclude)) === $exclude) {
96 96
 					return false;
97 97
 				}
Please login to merge, or discard this patch.
lib/private/App/PlatformRepository.php 1 patch
Spacing   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -90,8 +90,8 @@  discard block
 block discarded – undo
90 90
 					break;
91 91
 
92 92
 				case 'openssl':
93
-					$prettyVersion = preg_replace_callback('{^(?:OpenSSL\s*)?([0-9.]+)([a-z]?).*}', function ($match) {
94
-						return $match[1] . (empty($match[2]) ? '' : '.' . (ord($match[2]) - 96));
93
+					$prettyVersion = preg_replace_callback('{^(?:OpenSSL\s*)?([0-9.]+)([a-z]?).*}', function($match) {
94
+						return $match[1].(empty($match[2]) ? '' : '.'.(ord($match[2]) - 96));
95 95
 					}, OPENSSL_VERSION_TEXT);
96 96
 					break;
97 97
 
@@ -166,19 +166,19 @@  discard block
 block discarded – undo
166 166
 			return '9999999-dev';
167 167
 		}
168 168
 		if ('dev-' === strtolower(substr($version, 0, 4))) {
169
-			return 'dev-' . substr($version, 4);
169
+			return 'dev-'.substr($version, 4);
170 170
 		}
171 171
 		// match classical versioning
172
-		if (preg_match('{^v?(\d{1,3})(\.\d+)?(\.\d+)?(\.\d+)?' . self::$modifierRegex . '$}i', $version, $matches)) {
172
+		if (preg_match('{^v?(\d{1,3})(\.\d+)?(\.\d+)?(\.\d+)?'.self::$modifierRegex.'$}i', $version, $matches)) {
173 173
 			$version = $matches[1]
174 174
 				. (!empty($matches[2]) ? $matches[2] : '.0')
175 175
 				. (!empty($matches[3]) ? $matches[3] : '.0')
176 176
 				. (!empty($matches[4]) ? $matches[4] : '.0');
177 177
 			$index = 5;
178
-		} elseif (preg_match('{^v?(\d{4}(?:[.:-]?\d{2}){1,6}(?:[.:-]?\d{1,3})?)' . self::$modifierRegex . '$}i', $version, $matches)) { // match date-based versioning
178
+		} elseif (preg_match('{^v?(\d{4}(?:[.:-]?\d{2}){1,6}(?:[.:-]?\d{1,3})?)'.self::$modifierRegex.'$}i', $version, $matches)) { // match date-based versioning
179 179
 			$version = preg_replace('{\D}', '-', $matches[1]);
180 180
 			$index = 2;
181
-		} elseif (preg_match('{^v?(\d{4,})(\.\d+)?(\.\d+)?(\.\d+)?' . self::$modifierRegex . '$}i', $version, $matches)) {
181
+		} elseif (preg_match('{^v?(\d{4,})(\.\d+)?(\.\d+)?(\.\d+)?'.self::$modifierRegex.'$}i', $version, $matches)) {
182 182
 			$version = $matches[1]
183 183
 				. (!empty($matches[2]) ? $matches[2] : '.0')
184 184
 				. (!empty($matches[3]) ? $matches[3] : '.0')
@@ -191,7 +191,7 @@  discard block
 block discarded – undo
191 191
 				if ('stable' === $matches[$index]) {
192 192
 					return $version;
193 193
 				}
194
-				$version .= '-' . $this->expandStability($matches[$index]) . (!empty($matches[$index + 1]) ? $matches[$index + 1] : '');
194
+				$version .= '-'.$this->expandStability($matches[$index]).(!empty($matches[$index + 1]) ? $matches[$index + 1] : '');
195 195
 			}
196 196
 			if (!empty($matches[$index + 2])) {
197 197
 				$version .= '-dev';
@@ -199,12 +199,12 @@  discard block
 block discarded – undo
199 199
 			return $version;
200 200
 		}
201 201
 		$extraMessage = '';
202
-		if (preg_match('{ +as +' . preg_quote($version) . '$}', $fullVersion)) {
203
-			$extraMessage = ' in "' . $fullVersion . '", the alias must be an exact version';
204
-		} elseif (preg_match('{^' . preg_quote($version) . ' +as +}', $fullVersion)) {
205
-			$extraMessage = ' in "' . $fullVersion . '", the alias source must be an exact version, if it is a branch name you should prefix it with dev-';
202
+		if (preg_match('{ +as +'.preg_quote($version).'$}', $fullVersion)) {
203
+			$extraMessage = ' in "'.$fullVersion.'", the alias must be an exact version';
204
+		} elseif (preg_match('{^'.preg_quote($version).' +as +}', $fullVersion)) {
205
+			$extraMessage = ' in "'.$fullVersion.'", the alias source must be an exact version, if it is a branch name you should prefix it with dev-';
206 206
 		}
207
-		throw new \UnexpectedValueException('Invalid version string "' . $version . '"' . $extraMessage);
207
+		throw new \UnexpectedValueException('Invalid version string "'.$version.'"'.$extraMessage);
208 208
 	}
209 209
 
210 210
 	/**
Please login to merge, or discard this patch.
lib/private/DateTimeFormatter.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -237,7 +237,7 @@  discard block
 block discarded – undo
237 237
 	 * @return string Formatted date and time string
238 238
 	 */
239 239
 	public function formatDateTime($timestamp, $formatDate = 'long', $formatTime = 'medium', \DateTimeZone $timeZone = null, \OCP\IL10N $l = null) {
240
-		return $this->format($timestamp, 'datetime', $formatDate . '|' . $formatTime, $timeZone, $l);
240
+		return $this->format($timestamp, 'datetime', $formatDate.'|'.$formatTime, $timeZone, $l);
241 241
 	}
242 242
 
243 243
 	/**
@@ -256,7 +256,7 @@  discard block
 block discarded – undo
256 256
 			$formatDate .= '^';
257 257
 		}
258 258
 
259
-		return $this->format($timestamp, 'datetime', $formatDate . '|' . $formatTime, $timeZone, $l);
259
+		return $this->format($timestamp, 'datetime', $formatDate.'|'.$formatTime, $timeZone, $l);
260 260
 	}
261 261
 
262 262
 	/**
Please login to merge, or discard this patch.