@@ -77,7 +77,7 @@ discard block |
||
| 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 |
||
| 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 { |
@@ -228,7 +228,7 @@ discard block |
||
| 228 | 228 | \RegexIterator::GET_MATCH); |
| 229 | 229 | |
| 230 | 230 | $files = array_keys(iterator_to_array($iterator)); |
| 231 | - uasort($files, function ($a, $b) { |
|
| 231 | + uasort($files, function($a, $b) { |
|
| 232 | 232 | preg_match('/^Version(\d+)Date(\d+)\\.php$/', basename($a), $matchA); |
| 233 | 233 | preg_match('/^Version(\d+)Date(\d+)\\.php$/', basename($b), $matchB); |
| 234 | 234 | if (!empty($matchA) && !empty($matchB)) { |
@@ -306,7 +306,7 @@ discard block |
||
| 306 | 306 | * @return string |
| 307 | 307 | */ |
| 308 | 308 | public function getMigrationsTableName() { |
| 309 | - return $this->connection->getPrefix() . 'migrations'; |
|
| 309 | + return $this->connection->getPrefix().'migrations'; |
|
| 310 | 310 | } |
| 311 | 311 | |
| 312 | 312 | /** |
@@ -443,7 +443,7 @@ discard block |
||
| 443 | 443 | foreach ($toBeExecuted as $version) { |
| 444 | 444 | $instance = $this->createInstance($version); |
| 445 | 445 | |
| 446 | - $toSchema = $instance->changeSchema($this->output, function () use ($toSchema) { |
|
| 446 | + $toSchema = $instance->changeSchema($this->output, function() use ($toSchema) { |
|
| 447 | 447 | return $toSchema ?: new SchemaWrapper($this->connection); |
| 448 | 448 | }, ['tablePrefix' => $this->connection->getPrefix()]) ?: $toSchema; |
| 449 | 449 | |
@@ -514,12 +514,12 @@ discard block |
||
| 514 | 514 | $instance = $this->createInstance($version); |
| 515 | 515 | |
| 516 | 516 | if (!$schemaOnly) { |
| 517 | - $instance->preSchemaChange($this->output, function () { |
|
| 517 | + $instance->preSchemaChange($this->output, function() { |
|
| 518 | 518 | return new SchemaWrapper($this->connection); |
| 519 | 519 | }, ['tablePrefix' => $this->connection->getPrefix()]); |
| 520 | 520 | } |
| 521 | 521 | |
| 522 | - $toSchema = $instance->changeSchema($this->output, function () { |
|
| 522 | + $toSchema = $instance->changeSchema($this->output, function() { |
|
| 523 | 523 | return new SchemaWrapper($this->connection); |
| 524 | 524 | }, ['tablePrefix' => $this->connection->getPrefix()]); |
| 525 | 525 | |
@@ -534,7 +534,7 @@ discard block |
||
| 534 | 534 | } |
| 535 | 535 | |
| 536 | 536 | if (!$schemaOnly) { |
| 537 | - $instance->postSchemaChange($this->output, function () { |
|
| 537 | + $instance->postSchemaChange($this->output, function() { |
|
| 538 | 538 | return new SchemaWrapper($this->connection); |
| 539 | 539 | }, ['tablePrefix' => $this->connection->getPrefix()]); |
| 540 | 540 | } |
@@ -550,31 +550,31 @@ discard block |
||
| 550 | 550 | $sourceTable = $sourceSchema->getTable($table->getName()); |
| 551 | 551 | } catch (SchemaException $e) { |
| 552 | 552 | if (\strlen($table->getName()) - $prefixLength > 27) { |
| 553 | - throw new \InvalidArgumentException('Table name "' . $table->getName() . '" is too long.'); |
|
| 553 | + throw new \InvalidArgumentException('Table name "'.$table->getName().'" is too long.'); |
|
| 554 | 554 | } |
| 555 | 555 | $sourceTable = null; |
| 556 | 556 | } |
| 557 | 557 | |
| 558 | 558 | foreach ($table->getColumns() as $thing) { |
| 559 | 559 | if ((!$sourceTable instanceof Table || !$sourceTable->hasColumn($thing->getName())) && \strlen($thing->getName()) > 30) { |
| 560 | - throw new \InvalidArgumentException('Column name "' . $table->getName() . '"."' . $thing->getName() . '" is too long.'); |
|
| 560 | + throw new \InvalidArgumentException('Column name "'.$table->getName().'"."'.$thing->getName().'" is too long.'); |
|
| 561 | 561 | } |
| 562 | 562 | |
| 563 | 563 | if ($thing->getNotnull() && $thing->getDefault() === '' |
| 564 | 564 | && $sourceTable instanceof Table && !$sourceTable->hasColumn($thing->getName())) { |
| 565 | - throw new \InvalidArgumentException('Column name "' . $table->getName() . '"."' . $thing->getName() . '" is NotNull, but has empty string or null as default.'); |
|
| 565 | + throw new \InvalidArgumentException('Column name "'.$table->getName().'"."'.$thing->getName().'" is NotNull, but has empty string or null as default.'); |
|
| 566 | 566 | } |
| 567 | 567 | } |
| 568 | 568 | |
| 569 | 569 | foreach ($table->getIndexes() as $thing) { |
| 570 | 570 | if ((!$sourceTable instanceof Table || !$sourceTable->hasIndex($thing->getName())) && \strlen($thing->getName()) > 30) { |
| 571 | - throw new \InvalidArgumentException('Index name "' . $table->getName() . '"."' . $thing->getName() . '" is too long.'); |
|
| 571 | + throw new \InvalidArgumentException('Index name "'.$table->getName().'"."'.$thing->getName().'" is too long.'); |
|
| 572 | 572 | } |
| 573 | 573 | } |
| 574 | 574 | |
| 575 | 575 | foreach ($table->getForeignKeys() as $thing) { |
| 576 | 576 | if ((!$sourceTable instanceof Table || !$sourceTable->hasForeignKey($thing->getName())) && \strlen($thing->getName()) > 30) { |
| 577 | - throw new \InvalidArgumentException('Foreign key name "' . $table->getName() . '"."' . $thing->getName() . '" is too long.'); |
|
| 577 | + throw new \InvalidArgumentException('Foreign key name "'.$table->getName().'"."'.$thing->getName().'" is too long.'); |
|
| 578 | 578 | } |
| 579 | 579 | } |
| 580 | 580 | |
@@ -584,32 +584,32 @@ discard block |
||
| 584 | 584 | $isUsingDefaultName = $indexName === 'primary'; |
| 585 | 585 | |
| 586 | 586 | if ($this->connection->getDatabasePlatform() instanceof PostgreSqlPlatform) { |
| 587 | - $defaultName = $table->getName() . '_pkey'; |
|
| 587 | + $defaultName = $table->getName().'_pkey'; |
|
| 588 | 588 | $isUsingDefaultName = strtolower($defaultName) === $indexName; |
| 589 | 589 | |
| 590 | 590 | if ($isUsingDefaultName) { |
| 591 | - $sequenceName = $table->getName() . '_' . implode('_', $primaryKey->getColumns()) . '_seq'; |
|
| 592 | - $sequences = array_filter($sequences, function (Sequence $sequence) use ($sequenceName) { |
|
| 591 | + $sequenceName = $table->getName().'_'.implode('_', $primaryKey->getColumns()).'_seq'; |
|
| 592 | + $sequences = array_filter($sequences, function(Sequence $sequence) use ($sequenceName) { |
|
| 593 | 593 | return $sequence->getName() !== $sequenceName; |
| 594 | 594 | }); |
| 595 | 595 | } |
| 596 | 596 | } elseif ($this->connection->getDatabasePlatform() instanceof OraclePlatform) { |
| 597 | - $defaultName = $table->getName() . '_seq'; |
|
| 597 | + $defaultName = $table->getName().'_seq'; |
|
| 598 | 598 | $isUsingDefaultName = strtolower($defaultName) === $indexName; |
| 599 | 599 | } |
| 600 | 600 | |
| 601 | 601 | if (!$isUsingDefaultName && \strlen($indexName) > 30) { |
| 602 | - throw new \InvalidArgumentException('Primary index name on "' . $table->getName() . '" is too long.'); |
|
| 602 | + throw new \InvalidArgumentException('Primary index name on "'.$table->getName().'" is too long.'); |
|
| 603 | 603 | } |
| 604 | 604 | if ($isUsingDefaultName && \strlen($table->getName()) - $prefixLength >= 23) { |
| 605 | - throw new \InvalidArgumentException('Primary index name on "' . $table->getName() . '" is too long.'); |
|
| 605 | + throw new \InvalidArgumentException('Primary index name on "'.$table->getName().'" is too long.'); |
|
| 606 | 606 | } |
| 607 | 607 | } |
| 608 | 608 | } |
| 609 | 609 | |
| 610 | 610 | foreach ($sequences as $sequence) { |
| 611 | 611 | if (!$sourceSchema->hasSequence($sequence->getName()) && \strlen($sequence->getName()) > 30) { |
| 612 | - throw new \InvalidArgumentException('Sequence name "' . $sequence->getName() . '" is too long.'); |
|
| 612 | + throw new \InvalidArgumentException('Sequence name "'.$sequence->getName().'" is too long.'); |
|
| 613 | 613 | } |
| 614 | 614 | } |
| 615 | 615 | } |
@@ -65,7 +65,7 @@ discard block |
||
| 65 | 65 | */ |
| 66 | 66 | public function getTableNamesWithoutPrefix() { |
| 67 | 67 | $tableNames = $this->schema->getTableNames(); |
| 68 | - return array_map(function ($tableName) { |
|
| 68 | + return array_map(function($tableName) { |
|
| 69 | 69 | if (strpos($tableName, $this->connection->getPrefix()) === 0) { |
| 70 | 70 | return substr($tableName, strlen($this->connection->getPrefix())); |
| 71 | 71 | } |
@@ -90,7 +90,7 @@ discard block |
||
| 90 | 90 | * @throws \Doctrine\DBAL\Schema\SchemaException |
| 91 | 91 | */ |
| 92 | 92 | public function getTable($tableName) { |
| 93 | - return $this->schema->getTable($this->connection->getPrefix() . $tableName); |
|
| 93 | + return $this->schema->getTable($this->connection->getPrefix().$tableName); |
|
| 94 | 94 | } |
| 95 | 95 | |
| 96 | 96 | /** |
@@ -101,7 +101,7 @@ discard block |
||
| 101 | 101 | * @return boolean |
| 102 | 102 | */ |
| 103 | 103 | public function hasTable($tableName) { |
| 104 | - return $this->schema->hasTable($this->connection->getPrefix() . $tableName); |
|
| 104 | + return $this->schema->hasTable($this->connection->getPrefix().$tableName); |
|
| 105 | 105 | } |
| 106 | 106 | |
| 107 | 107 | /** |
@@ -112,7 +112,7 @@ discard block |
||
| 112 | 112 | */ |
| 113 | 113 | public function createTable($tableName) { |
| 114 | 114 | unset($this->tablesToDelete[$tableName]); |
| 115 | - return $this->schema->createTable($this->connection->getPrefix() . $tableName); |
|
| 115 | + return $this->schema->createTable($this->connection->getPrefix().$tableName); |
|
| 116 | 116 | } |
| 117 | 117 | |
| 118 | 118 | /** |
@@ -123,7 +123,7 @@ discard block |
||
| 123 | 123 | */ |
| 124 | 124 | public function dropTable($tableName) { |
| 125 | 125 | $this->tablesToDelete[$tableName] = true; |
| 126 | - return $this->schema->dropTable($this->connection->getPrefix() . $tableName); |
|
| 126 | + return $this->schema->dropTable($this->connection->getPrefix().$tableName); |
|
| 127 | 127 | } |
| 128 | 128 | |
| 129 | 129 | /** |