Passed
Push — master ( 5f194d...d79cc8 )
by Roeland
23:02 queued 11s
created
lib/private/DB/MigrationService.php 1 patch
Spacing   +22 added lines, -22 removed lines patch added patch discarded remove patch
@@ -78,7 +78,7 @@  discard block
 block discarded – undo
78 78
 		}
79 79
 
80 80
 		if ($appName === 'core') {
81
-			$this->migrationsPath = \OC::$SERVERROOT . '/core/Migrations';
81
+			$this->migrationsPath = \OC::$SERVERROOT.'/core/Migrations';
82 82
 			$this->migrationsNamespace = 'OC\\Core\\Migrations';
83 83
 			$this->checkOracle = true;
84 84
 		} else {
@@ -88,10 +88,10 @@  discard block
 block discarded – undo
88 88
 			$appPath = $appLocator->getAppPath($appName);
89 89
 			$namespace = App::buildAppNamespace($appName);
90 90
 			$this->migrationsPath = "$appPath/lib/Migration";
91
-			$this->migrationsNamespace = $namespace . '\\Migration';
91
+			$this->migrationsNamespace = $namespace.'\\Migration';
92 92
 
93 93
 			$infoParser = new InfoParser();
94
-			$info = $infoParser->parse($appPath . '/appinfo/info.xml');
94
+			$info = $infoParser->parse($appPath.'/appinfo/info.xml');
95 95
 			if (!isset($info['dependencies']['database'])) {
96 96
 				$this->checkOracle = true;
97 97
 			} else {
@@ -229,7 +229,7 @@  discard block
 block discarded – undo
229 229
 			\RegexIterator::GET_MATCH);
230 230
 
231 231
 		$files = array_keys(iterator_to_array($iterator));
232
-		uasort($files, function ($a, $b) {
232
+		uasort($files, function($a, $b) {
233 233
 			preg_match('/^Version(\d+)Date(\d+)\\.php$/', basename($a), $matchA);
234 234
 			preg_match('/^Version(\d+)Date(\d+)\\.php$/', basename($b), $matchB);
235 235
 			if (!empty($matchA) && !empty($matchB)) {
@@ -307,7 +307,7 @@  discard block
 block discarded – undo
307 307
 	 * @return string
308 308
 	 */
309 309
 	public function getMigrationsTableName() {
310
-		return $this->connection->getPrefix() . 'migrations';
310
+		return $this->connection->getPrefix().'migrations';
311 311
 	}
312 312
 
313 313
 	/**
@@ -427,7 +427,7 @@  discard block
 block discarded – undo
427 427
 			} catch (DriverException $e) {
428 428
 				// The exception itself does not contain the name of the migration,
429 429
 				// so we wrap it here, to make debugging easier.
430
-				throw new \Exception('Database error when running migration ' . $to . ' for app ' . $this->getApp(), 0, $e);
430
+				throw new \Exception('Database error when running migration '.$to.' for app '.$this->getApp(), 0, $e);
431 431
 			}
432 432
 		}
433 433
 	}
@@ -450,7 +450,7 @@  discard block
 block discarded – undo
450 450
 		foreach ($toBeExecuted as $version) {
451 451
 			$instance = $this->createInstance($version);
452 452
 
453
-			$toSchema = $instance->changeSchema($this->output, function () use ($toSchema) {
453
+			$toSchema = $instance->changeSchema($this->output, function() use ($toSchema) {
454 454
 				return $toSchema ?: new SchemaWrapper($this->connection);
455 455
 			}, ['tablePrefix' => $this->connection->getPrefix()]) ?: $toSchema;
456 456
 
@@ -521,12 +521,12 @@  discard block
 block discarded – undo
521 521
 		$instance = $this->createInstance($version);
522 522
 
523 523
 		if (!$schemaOnly) {
524
-			$instance->preSchemaChange($this->output, function () {
524
+			$instance->preSchemaChange($this->output, function() {
525 525
 				return new SchemaWrapper($this->connection);
526 526
 			}, ['tablePrefix' => $this->connection->getPrefix()]);
527 527
 		}
528 528
 
529
-		$toSchema = $instance->changeSchema($this->output, function () {
529
+		$toSchema = $instance->changeSchema($this->output, function() {
530 530
 			return new SchemaWrapper($this->connection);
531 531
 		}, ['tablePrefix' => $this->connection->getPrefix()]);
532 532
 
@@ -541,7 +541,7 @@  discard block
 block discarded – undo
541 541
 		}
542 542
 
543 543
 		if (!$schemaOnly) {
544
-			$instance->postSchemaChange($this->output, function () {
544
+			$instance->postSchemaChange($this->output, function() {
545 545
 				return new SchemaWrapper($this->connection);
546 546
 			}, ['tablePrefix' => $this->connection->getPrefix()]);
547 547
 		}
@@ -557,31 +557,31 @@  discard block
 block discarded – undo
557 557
 				$sourceTable = $sourceSchema->getTable($table->getName());
558 558
 			} catch (SchemaException $e) {
559 559
 				if (\strlen($table->getName()) - $prefixLength > 27) {
560
-					throw new \InvalidArgumentException('Table name "' . $table->getName() . '" is too long.');
560
+					throw new \InvalidArgumentException('Table name "'.$table->getName().'" is too long.');
561 561
 				}
562 562
 				$sourceTable = null;
563 563
 			}
564 564
 
565 565
 			foreach ($table->getColumns() as $thing) {
566 566
 				if ((!$sourceTable instanceof Table || !$sourceTable->hasColumn($thing->getName())) && \strlen($thing->getName()) > 30) {
567
-					throw new \InvalidArgumentException('Column name "' . $table->getName() . '"."' . $thing->getName() . '" is too long.');
567
+					throw new \InvalidArgumentException('Column name "'.$table->getName().'"."'.$thing->getName().'" is too long.');
568 568
 				}
569 569
 
570 570
 				if ($thing->getNotnull() && $thing->getDefault() === ''
571 571
 					&& $sourceTable instanceof Table && !$sourceTable->hasColumn($thing->getName())) {
572
-					throw new \InvalidArgumentException('Column name "' . $table->getName() . '"."' . $thing->getName() . '" is NotNull, but has empty string or null as default.');
572
+					throw new \InvalidArgumentException('Column name "'.$table->getName().'"."'.$thing->getName().'" is NotNull, but has empty string or null as default.');
573 573
 				}
574 574
 			}
575 575
 
576 576
 			foreach ($table->getIndexes() as $thing) {
577 577
 				if ((!$sourceTable instanceof Table || !$sourceTable->hasIndex($thing->getName())) && \strlen($thing->getName()) > 30) {
578
-					throw new \InvalidArgumentException('Index name "' . $table->getName() . '"."' . $thing->getName() . '" is too long.');
578
+					throw new \InvalidArgumentException('Index name "'.$table->getName().'"."'.$thing->getName().'" is too long.');
579 579
 				}
580 580
 			}
581 581
 
582 582
 			foreach ($table->getForeignKeys() as $thing) {
583 583
 				if ((!$sourceTable instanceof Table || !$sourceTable->hasForeignKey($thing->getName())) && \strlen($thing->getName()) > 30) {
584
-					throw new \InvalidArgumentException('Foreign key name "'  . $table->getName() . '"."' . $thing->getName() . '" is too long.');
584
+					throw new \InvalidArgumentException('Foreign key name "'.$table->getName().'"."'.$thing->getName().'" is too long.');
585 585
 				}
586 586
 			}
587 587
 
@@ -591,32 +591,32 @@  discard block
 block discarded – undo
591 591
 				$isUsingDefaultName = $indexName === 'primary';
592 592
 
593 593
 				if ($this->connection->getDatabasePlatform() instanceof PostgreSQL94Platform) {
594
-					$defaultName = $table->getName() . '_pkey';
594
+					$defaultName = $table->getName().'_pkey';
595 595
 					$isUsingDefaultName = strtolower($defaultName) === $indexName;
596 596
 
597 597
 					if ($isUsingDefaultName) {
598
-						$sequenceName = $table->getName() . '_' . implode('_', $primaryKey->getColumns()) . '_seq';
599
-						$sequences = array_filter($sequences, function (Sequence $sequence) use ($sequenceName) {
598
+						$sequenceName = $table->getName().'_'.implode('_', $primaryKey->getColumns()).'_seq';
599
+						$sequences = array_filter($sequences, function(Sequence $sequence) use ($sequenceName) {
600 600
 							return $sequence->getName() !== $sequenceName;
601 601
 						});
602 602
 					}
603 603
 				} elseif ($this->connection->getDatabasePlatform() instanceof OraclePlatform) {
604
-					$defaultName = $table->getName() . '_seq';
604
+					$defaultName = $table->getName().'_seq';
605 605
 					$isUsingDefaultName = strtolower($defaultName) === $indexName;
606 606
 				}
607 607
 
608 608
 				if (!$isUsingDefaultName && \strlen($indexName) > 30) {
609
-					throw new \InvalidArgumentException('Primary index name on "' . $table->getName() . '" is too long.');
609
+					throw new \InvalidArgumentException('Primary index name on "'.$table->getName().'" is too long.');
610 610
 				}
611 611
 				if ($isUsingDefaultName && \strlen($table->getName()) - $prefixLength >= 23) {
612
-					throw new \InvalidArgumentException('Primary index name on "' . $table->getName() . '" is too long.');
612
+					throw new \InvalidArgumentException('Primary index name on "'.$table->getName().'" is too long.');
613 613
 				}
614 614
 			}
615 615
 		}
616 616
 
617 617
 		foreach ($sequences as $sequence) {
618 618
 			if (!$sourceSchema->hasSequence($sequence->getName()) && \strlen($sequence->getName()) > 30) {
619
-				throw new \InvalidArgumentException('Sequence name "' . $sequence->getName() . '" is too long.');
619
+				throw new \InvalidArgumentException('Sequence name "'.$sequence->getName().'" is too long.');
620 620
 			}
621 621
 		}
622 622
 	}
Please login to merge, or discard this patch.