@@ -73,7 +73,7 @@ discard block |
||
73 | 73 | } |
74 | 74 | |
75 | 75 | if ($appName === 'core') { |
76 | - $this->migrationsPath = \OC::$SERVERROOT . '/core/Migrations'; |
|
76 | + $this->migrationsPath = \OC::$SERVERROOT.'/core/Migrations'; |
|
77 | 77 | $this->migrationsNamespace = 'OC\\Core\\Migrations'; |
78 | 78 | $this->checkOracle = true; |
79 | 79 | } else { |
@@ -83,10 +83,10 @@ discard block |
||
83 | 83 | $appPath = $appLocator->getAppPath($appName); |
84 | 84 | $namespace = App::buildAppNamespace($appName); |
85 | 85 | $this->migrationsPath = "$appPath/lib/Migration"; |
86 | - $this->migrationsNamespace = $namespace . '\\Migration'; |
|
86 | + $this->migrationsNamespace = $namespace.'\\Migration'; |
|
87 | 87 | |
88 | 88 | $infoParser = new InfoParser(); |
89 | - $info = $infoParser->parse($appPath . '/appinfo/info.xml'); |
|
89 | + $info = $infoParser->parse($appPath.'/appinfo/info.xml'); |
|
90 | 90 | if (!isset($info['dependencies']['database'])) { |
91 | 91 | $this->checkOracle = true; |
92 | 92 | } else { |
@@ -220,7 +220,7 @@ discard block |
||
220 | 220 | \RegexIterator::GET_MATCH); |
221 | 221 | |
222 | 222 | $files = array_keys(iterator_to_array($iterator)); |
223 | - uasort($files, function ($a, $b) { |
|
223 | + uasort($files, function($a, $b) { |
|
224 | 224 | preg_match('/^Version(\d+)Date(\d+)\\.php$/', basename($a), $matchA); |
225 | 225 | preg_match('/^Version(\d+)Date(\d+)\\.php$/', basename($b), $matchB); |
226 | 226 | if (!empty($matchA) && !empty($matchB)) { |
@@ -298,7 +298,7 @@ discard block |
||
298 | 298 | * @return string |
299 | 299 | */ |
300 | 300 | public function getMigrationsTableName() { |
301 | - return $this->connection->getPrefix() . 'migrations'; |
|
301 | + return $this->connection->getPrefix().'migrations'; |
|
302 | 302 | } |
303 | 303 | |
304 | 304 | /** |
@@ -326,7 +326,7 @@ discard block |
||
326 | 326 | * @return mixed|null|string |
327 | 327 | */ |
328 | 328 | public function getMigration($alias) { |
329 | - switch($alias) { |
|
329 | + switch ($alias) { |
|
330 | 330 | case 'current': |
331 | 331 | return $this->getCurrentVersion(); |
332 | 332 | case 'next': |
@@ -501,26 +501,26 @@ discard block |
||
501 | 501 | $sourceTable = $sourceSchema->getTable($table->getName()); |
502 | 502 | } catch (SchemaException $e) { |
503 | 503 | if (\strlen($table->getName()) - $prefixLength > 27) { |
504 | - throw new \InvalidArgumentException('Table name "' . $table->getName() . '" is too long.'); |
|
504 | + throw new \InvalidArgumentException('Table name "'.$table->getName().'" is too long.'); |
|
505 | 505 | } |
506 | 506 | $sourceTable = null; |
507 | 507 | } |
508 | 508 | |
509 | 509 | foreach ($table->getColumns() as $thing) { |
510 | 510 | if ((!$sourceTable instanceof Table || !$sourceTable->hasColumn($thing->getName())) && \strlen($thing->getName()) - $prefixLength > 27) { |
511 | - throw new \InvalidArgumentException('Column name "' . $table->getName() . '"."' . $thing->getName() . '" is too long.'); |
|
511 | + throw new \InvalidArgumentException('Column name "'.$table->getName().'"."'.$thing->getName().'" is too long.'); |
|
512 | 512 | } |
513 | 513 | } |
514 | 514 | |
515 | 515 | foreach ($table->getIndexes() as $thing) { |
516 | 516 | if ((!$sourceTable instanceof Table || !$sourceTable->hasIndex($thing->getName())) && \strlen($thing->getName()) - $prefixLength > 27) { |
517 | - throw new \InvalidArgumentException('Index name "' . $table->getName() . '"."' . $thing->getName() . '" is too long.'); |
|
517 | + throw new \InvalidArgumentException('Index name "'.$table->getName().'"."'.$thing->getName().'" is too long.'); |
|
518 | 518 | } |
519 | 519 | } |
520 | 520 | |
521 | 521 | foreach ($table->getForeignKeys() as $thing) { |
522 | 522 | if ((!$sourceTable instanceof Table || !$sourceTable->hasForeignKey($thing->getName())) && \strlen($thing->getName()) - $prefixLength > 27) { |
523 | - throw new \InvalidArgumentException('Foreign key name "' . $table->getName() . '"."' . $thing->getName() . '" is too long.'); |
|
523 | + throw new \InvalidArgumentException('Foreign key name "'.$table->getName().'"."'.$thing->getName().'" is too long.'); |
|
524 | 524 | } |
525 | 525 | } |
526 | 526 | |
@@ -530,32 +530,32 @@ discard block |
||
530 | 530 | $isUsingDefaultName = $indexName === 'primary'; |
531 | 531 | |
532 | 532 | if ($this->connection->getDatabasePlatform() instanceof PostgreSqlPlatform) { |
533 | - $defaultName = $table->getName() . '_pkey'; |
|
533 | + $defaultName = $table->getName().'_pkey'; |
|
534 | 534 | $isUsingDefaultName = strtolower($defaultName) === $indexName; |
535 | 535 | |
536 | 536 | if ($isUsingDefaultName) { |
537 | - $sequenceName = $table->getName() . '_' . implode('_', $primaryKey->getColumns()) . '_seq'; |
|
537 | + $sequenceName = $table->getName().'_'.implode('_', $primaryKey->getColumns()).'_seq'; |
|
538 | 538 | $sequences = array_filter($sequences, function(Sequence $sequence) use ($sequenceName) { |
539 | 539 | return $sequence->getName() !== $sequenceName; |
540 | 540 | }); |
541 | 541 | } |
542 | 542 | } else if ($this->connection->getDatabasePlatform() instanceof OraclePlatform) { |
543 | - $defaultName = $table->getName() . '_seq'; |
|
543 | + $defaultName = $table->getName().'_seq'; |
|
544 | 544 | $isUsingDefaultName = strtolower($defaultName) === $indexName; |
545 | 545 | } |
546 | 546 | |
547 | 547 | if (!$isUsingDefaultName && \strlen($indexName) - $prefixLength > 27) { |
548 | - throw new \InvalidArgumentException('Primary index name on "' . $table->getName() . '" is too long.'); |
|
548 | + throw new \InvalidArgumentException('Primary index name on "'.$table->getName().'" is too long.'); |
|
549 | 549 | } |
550 | 550 | if ($isUsingDefaultName && \strlen($table->getName()) - $prefixLength > 23) { |
551 | - throw new \InvalidArgumentException('Primary index name on "' . $table->getName() . '" is too long.'); |
|
551 | + throw new \InvalidArgumentException('Primary index name on "'.$table->getName().'" is too long.'); |
|
552 | 552 | } |
553 | 553 | } |
554 | 554 | } |
555 | 555 | |
556 | 556 | foreach ($sequences as $sequence) { |
557 | 557 | if (!$sourceSchema->hasSequence($sequence->getName()) && \strlen($sequence->getName()) - $prefixLength > 27) { |
558 | - throw new \InvalidArgumentException('Sequence name "' . $sequence->getName() . '" is too long.'); |
|
558 | + throw new \InvalidArgumentException('Sequence name "'.$sequence->getName().'" is too long.'); |
|
559 | 559 | } |
560 | 560 | } |
561 | 561 | } |