Passed
Push — master ( 9db321...fec679 )
by Morris
10:50 queued 11s
created
lib/private/DB/MigrationService.php 1 patch
Spacing   +20 added lines, -20 removed lines patch added patch discarded remove patch
@@ -77,7 +77,7 @@  discard block
 block discarded – undo
77 77
 		}
78 78
 
79 79
 		if ($appName === 'core') {
80
-			$this->migrationsPath = \OC::$SERVERROOT . '/core/Migrations';
80
+			$this->migrationsPath = \OC::$SERVERROOT.'/core/Migrations';
81 81
 			$this->migrationsNamespace = 'OC\\Core\\Migrations';
82 82
 			$this->checkOracle = true;
83 83
 		} else {
@@ -87,10 +87,10 @@  discard block
 block discarded – undo
87 87
 			$appPath = $appLocator->getAppPath($appName);
88 88
 			$namespace = App::buildAppNamespace($appName);
89 89
 			$this->migrationsPath = "$appPath/lib/Migration";
90
-			$this->migrationsNamespace = $namespace . '\\Migration';
90
+			$this->migrationsNamespace = $namespace.'\\Migration';
91 91
 
92 92
 			$infoParser = new InfoParser();
93
-			$info = $infoParser->parse($appPath . '/appinfo/info.xml');
93
+			$info = $infoParser->parse($appPath.'/appinfo/info.xml');
94 94
 			if (!isset($info['dependencies']['database'])) {
95 95
 				$this->checkOracle = true;
96 96
 			} else {
@@ -223,7 +223,7 @@  discard block
 block discarded – undo
223 223
 			\RegexIterator::GET_MATCH);
224 224
 
225 225
 		$files = array_keys(iterator_to_array($iterator));
226
-		uasort($files, function ($a, $b) {
226
+		uasort($files, function($a, $b) {
227 227
 			preg_match('/^Version(\d+)Date(\d+)\\.php$/', basename($a), $matchA);
228 228
 			preg_match('/^Version(\d+)Date(\d+)\\.php$/', basename($b), $matchB);
229 229
 			if (!empty($matchA) && !empty($matchB)) {
@@ -301,7 +301,7 @@  discard block
 block discarded – undo
301 301
 	 * @return string
302 302
 	 */
303 303
 	public function getMigrationsTableName() {
304
-		return $this->connection->getPrefix() . 'migrations';
304
+		return $this->connection->getPrefix().'migrations';
305 305
 	}
306 306
 
307 307
 	/**
@@ -468,12 +468,12 @@  discard block
 block discarded – undo
468 468
 		$instance = $this->createInstance($version);
469 469
 
470 470
 		if (!$schemaOnly) {
471
-			$instance->preSchemaChange($this->output, function () {
471
+			$instance->preSchemaChange($this->output, function() {
472 472
 				return new SchemaWrapper($this->connection);
473 473
 			}, ['tablePrefix' => $this->connection->getPrefix()]);
474 474
 		}
475 475
 
476
-		$toSchema = $instance->changeSchema($this->output, function () {
476
+		$toSchema = $instance->changeSchema($this->output, function() {
477 477
 			return new SchemaWrapper($this->connection);
478 478
 		}, ['tablePrefix' => $this->connection->getPrefix()]);
479 479
 
@@ -488,7 +488,7 @@  discard block
 block discarded – undo
488 488
 		}
489 489
 
490 490
 		if (!$schemaOnly) {
491
-			$instance->postSchemaChange($this->output, function () {
491
+			$instance->postSchemaChange($this->output, function() {
492 492
 				return new SchemaWrapper($this->connection);
493 493
 			}, ['tablePrefix' => $this->connection->getPrefix()]);
494 494
 		}
@@ -504,31 +504,31 @@  discard block
 block discarded – undo
504 504
 				$sourceTable = $sourceSchema->getTable($table->getName());
505 505
 			} catch (SchemaException $e) {
506 506
 				if (\strlen($table->getName()) - $prefixLength > 27) {
507
-					throw new \InvalidArgumentException('Table name "'  . $table->getName() . '" is too long.');
507
+					throw new \InvalidArgumentException('Table name "'.$table->getName().'" is too long.');
508 508
 				}
509 509
 				$sourceTable = null;
510 510
 			}
511 511
 
512 512
 			foreach ($table->getColumns() as $thing) {
513 513
 				if ((!$sourceTable instanceof Table || !$sourceTable->hasColumn($thing->getName())) && \strlen($thing->getName()) > 30) {
514
-					throw new \InvalidArgumentException('Column name "'  . $table->getName() . '"."' . $thing->getName() . '" is too long.');
514
+					throw new \InvalidArgumentException('Column name "'.$table->getName().'"."'.$thing->getName().'" is too long.');
515 515
 				}
516 516
 
517 517
 				if ($thing->getNotnull() && $thing->getDefault() === ''
518 518
 					&& $sourceTable instanceof Table && !$sourceTable->hasColumn($thing->getName())) {
519
-					throw new \InvalidArgumentException('Column name "'  . $table->getName() . '"."' . $thing->getName() . '" is NotNull, but has empty string or null as default.');
519
+					throw new \InvalidArgumentException('Column name "'.$table->getName().'"."'.$thing->getName().'" is NotNull, but has empty string or null as default.');
520 520
 				}
521 521
 			}
522 522
 
523 523
 			foreach ($table->getIndexes() as $thing) {
524 524
 				if ((!$sourceTable instanceof Table || !$sourceTable->hasIndex($thing->getName())) && \strlen($thing->getName()) > 30) {
525
-					throw new \InvalidArgumentException('Index name "'  . $table->getName() . '"."' . $thing->getName() . '" is too long.');
525
+					throw new \InvalidArgumentException('Index name "'.$table->getName().'"."'.$thing->getName().'" is too long.');
526 526
 				}
527 527
 			}
528 528
 
529 529
 			foreach ($table->getForeignKeys() as $thing) {
530 530
 				if ((!$sourceTable instanceof Table || !$sourceTable->hasForeignKey($thing->getName())) && \strlen($thing->getName()) > 30) {
531
-					throw new \InvalidArgumentException('Foreign key name "'  . $table->getName() . '"."' . $thing->getName() . '" is too long.');
531
+					throw new \InvalidArgumentException('Foreign key name "'.$table->getName().'"."'.$thing->getName().'" is too long.');
532 532
 				}
533 533
 			}
534 534
 
@@ -538,32 +538,32 @@  discard block
 block discarded – undo
538 538
 				$isUsingDefaultName = $indexName === 'primary';
539 539
 
540 540
 				if ($this->connection->getDatabasePlatform() instanceof PostgreSqlPlatform) {
541
-					$defaultName = $table->getName() . '_pkey';
541
+					$defaultName = $table->getName().'_pkey';
542 542
 					$isUsingDefaultName = strtolower($defaultName) === $indexName;
543 543
 
544 544
 					if ($isUsingDefaultName) {
545
-						$sequenceName = $table->getName() . '_' . implode('_', $primaryKey->getColumns()) . '_seq';
546
-						$sequences = array_filter($sequences, function (Sequence $sequence) use ($sequenceName) {
545
+						$sequenceName = $table->getName().'_'.implode('_', $primaryKey->getColumns()).'_seq';
546
+						$sequences = array_filter($sequences, function(Sequence $sequence) use ($sequenceName) {
547 547
 							return $sequence->getName() !== $sequenceName;
548 548
 						});
549 549
 					}
550 550
 				} elseif ($this->connection->getDatabasePlatform() instanceof OraclePlatform) {
551
-					$defaultName = $table->getName() . '_seq';
551
+					$defaultName = $table->getName().'_seq';
552 552
 					$isUsingDefaultName = strtolower($defaultName) === $indexName;
553 553
 				}
554 554
 
555 555
 				if (!$isUsingDefaultName && \strlen($indexName) > 30) {
556
-					throw new \InvalidArgumentException('Primary index name  on "'  . $table->getName() . '" is too long.');
556
+					throw new \InvalidArgumentException('Primary index name  on "'.$table->getName().'" is too long.');
557 557
 				}
558 558
 				if ($isUsingDefaultName && \strlen($table->getName()) - $prefixLength >= 23) {
559
-					throw new \InvalidArgumentException('Primary index name  on "'  . $table->getName() . '" is too long.');
559
+					throw new \InvalidArgumentException('Primary index name  on "'.$table->getName().'" is too long.');
560 560
 				}
561 561
 			}
562 562
 		}
563 563
 
564 564
 		foreach ($sequences as $sequence) {
565 565
 			if (!$sourceSchema->hasSequence($sequence->getName()) && \strlen($sequence->getName()) > 30) {
566
-				throw new \InvalidArgumentException('Sequence name "'  . $sequence->getName() . '" is too long.');
566
+				throw new \InvalidArgumentException('Sequence name "'.$sequence->getName().'" is too long.');
567 567
 			}
568 568
 		}
569 569
 	}
Please login to merge, or discard this patch.