@@ -71,7 +71,7 @@ |
||
71 | 71 | { |
72 | 72 | /** @var Connection $connection */ |
73 | 73 | $connection = ($this->connection instanceof ValueHolderInterface) ? $this->connection->getWrappedValueHolderValue() : $this->connection; |
74 | - $cl = \Closure::bind(function () { |
|
74 | + $cl = \Closure::bind(function() { |
|
75 | 75 | $this->transactionNestingLevel = 0; |
76 | 76 | $this->isRollbackOnly = false; |
77 | 77 | }, |
@@ -314,7 +314,7 @@ discard block |
||
314 | 314 | } |
315 | 315 | |
316 | 316 | if ($migrationDefinition->status == MigrationDefinition::STATUS_INVALID) { |
317 | - throw new MigrationBundleException("Can not execute " . $this->getEntityName($migrationDefinition). " '{$migrationDefinition->name}': {$migrationDefinition->parsingError}"); |
|
317 | + throw new MigrationBundleException("Can not execute " . $this->getEntityName($migrationDefinition) . " '{$migrationDefinition->name}': {$migrationDefinition->parsingError}"); |
|
318 | 318 | } |
319 | 319 | |
320 | 320 | // BC: handling of legacy method call signature |
@@ -375,7 +375,7 @@ discard block |
||
375 | 375 | $this->migrationContext[$migration->name] = array('context' => $migrationContext); |
376 | 376 | |
377 | 377 | $steps = array_slice($migrationDefinition->steps->getArrayCopy(), $stepOffset); |
378 | - $i = $stepOffset+1; |
|
378 | + $i = $stepOffset + 1; |
|
379 | 379 | $finalStatus = Migration::STATUS_DONE; |
380 | 380 | $finalMessage = ''; |
381 | 381 | $error = null; |
@@ -583,7 +583,7 @@ discard block |
||
583 | 583 | |
584 | 584 | // save migration status |
585 | 585 | |
586 | - $finalMessage = ($finalMessage != '' && $messageSuffix != '') ? $finalMessage . '. '. $messageSuffix : $finalMessage . $messageSuffix; |
|
586 | + $finalMessage = ($finalMessage != '' && $messageSuffix != '') ? $finalMessage . '. ' . $messageSuffix : $finalMessage . $messageSuffix; |
|
587 | 587 | |
588 | 588 | try { |
589 | 589 | $this->storageHandler->endMigration(new Migration( |
@@ -639,12 +639,12 @@ discard block |
||
639 | 639 | } |
640 | 640 | |
641 | 641 | if ($migration->status != Migration::STATUS_SUSPENDED) { |
642 | - throw new MigrationBundleException("Can not resume ".$this->getEntityName($migration)." '{$migration->name}': it is not in suspended status"); |
|
642 | + throw new MigrationBundleException("Can not resume " . $this->getEntityName($migration) . " '{$migration->name}': it is not in suspended status"); |
|
643 | 643 | } |
644 | 644 | |
645 | 645 | $migrationDefinitions = $this->getMigrationsDefinitions(array($migration->path)); |
646 | 646 | if (!count($migrationDefinitions)) { |
647 | - throw new MigrationBundleException("Can not resume ".$this->getEntityName($migration)." '{$migration->name}': its definition is missing"); |
|
647 | + throw new MigrationBundleException("Can not resume " . $this->getEntityName($migration) . " '{$migration->name}': its definition is missing"); |
|
648 | 648 | } |
649 | 649 | |
650 | 650 | $defs = $migrationDefinitions->getArrayCopy(); |
@@ -652,17 +652,17 @@ discard block |
||
652 | 652 | |
653 | 653 | $migrationDefinition = $this->parseMigrationDefinition($migrationDefinition); |
654 | 654 | if ($migrationDefinition->status == MigrationDefinition::STATUS_INVALID) { |
655 | - throw new MigrationBundleException("Can not resume ".$this->getEntityName($migration)." '{$migration->name}': {$migrationDefinition->parsingError}"); |
|
655 | + throw new MigrationBundleException("Can not resume " . $this->getEntityName($migration) . " '{$migration->name}': {$migrationDefinition->parsingError}"); |
|
656 | 656 | } |
657 | 657 | |
658 | 658 | // restore context |
659 | 659 | $this->contextHandler->restoreCurrentContext($migration->name); |
660 | 660 | if (!isset($this->migrationContext[$migration->name])) { |
661 | - throw new MigrationBundleException("Can not resume ".$this->getEntityName($migration)." '{$migration->name}': the stored context is missing"); |
|
661 | + throw new MigrationBundleException("Can not resume " . $this->getEntityName($migration) . " '{$migration->name}': the stored context is missing"); |
|
662 | 662 | } |
663 | 663 | $restoredContext = $this->migrationContext[$migration->name]; |
664 | 664 | if (!is_array($restoredContext) || !isset($restoredContext['context']) || !isset($restoredContext['step'])) { |
665 | - throw new MigrationBundleException("Can not resume ".$this->getEntityName($migration)." '{$migration->name}': the stored context is invalid"); |
|
665 | + throw new MigrationBundleException("Can not resume " . $this->getEntityName($migration) . " '{$migration->name}': the stored context is invalid"); |
|
666 | 666 | } |
667 | 667 | |
668 | 668 | // update migration status |
@@ -165,7 +165,7 @@ discard block |
||
165 | 165 | |
166 | 166 | // sort tags by depth so that there will be no errors in case we are deleting parent and child |
167 | 167 | $tagsCollection = $tagsCollection->getArrayCopy(); |
168 | - uasort($tagsCollection, function ($t1, $t2) { |
|
168 | + uasort($tagsCollection, function($t1, $t2) { |
|
169 | 169 | if ($t1->depth == $t2->depth) return 0; |
170 | 170 | return ($t1->depth > $t2->depth) ? -1 : 1; |
171 | 171 | }); |
@@ -272,7 +272,7 @@ discard block |
||
272 | 272 | case 'create': |
273 | 273 | // sort top to bottom |
274 | 274 | $tagCollection = $tagCollection->getArrayCopy(); |
275 | - uasort($tagCollection, function ($t1, $t2) { |
|
275 | + uasort($tagCollection, function($t1, $t2) { |
|
276 | 276 | if ($t1->depth == $t2->depth) return 0; |
277 | 277 | return ($t1->depth > $t2->depth) ? 1 : -1; |
278 | 278 | }); |
@@ -280,7 +280,7 @@ discard block |
||
280 | 280 | case 'delete': |
281 | 281 | // sort bottom to top |
282 | 282 | $tagCollection = $tagCollection->getArrayCopy(); |
283 | - uasort($tagCollection, function ($t1, $t2) { |
|
283 | + uasort($tagCollection, function($t1, $t2) { |
|
284 | 284 | if ($t1->depth == $t2->depth) return 0; |
285 | 285 | return ($t1->depth > $t2->depth) ? -1 : 1; |
286 | 286 | }); |
@@ -166,7 +166,9 @@ discard block |
||
166 | 166 | // sort tags by depth so that there will be no errors in case we are deleting parent and child |
167 | 167 | $tagsCollection = $tagsCollection->getArrayCopy(); |
168 | 168 | uasort($tagsCollection, function ($t1, $t2) { |
169 | - if ($t1->depth == $t2->depth) return 0; |
|
169 | + if ($t1->depth == $t2->depth) { |
|
170 | + return 0; |
|
171 | + } |
|
170 | 172 | return ($t1->depth > $t2->depth) ? -1 : 1; |
171 | 173 | }); |
172 | 174 | |
@@ -273,7 +275,9 @@ discard block |
||
273 | 275 | // sort top to bottom |
274 | 276 | $tagCollection = $tagCollection->getArrayCopy(); |
275 | 277 | uasort($tagCollection, function ($t1, $t2) { |
276 | - if ($t1->depth == $t2->depth) return 0; |
|
278 | + if ($t1->depth == $t2->depth) { |
|
279 | + return 0; |
|
280 | + } |
|
277 | 281 | return ($t1->depth > $t2->depth) ? 1 : -1; |
278 | 282 | }); |
279 | 283 | break; |
@@ -281,7 +285,9 @@ discard block |
||
281 | 285 | // sort bottom to top |
282 | 286 | $tagCollection = $tagCollection->getArrayCopy(); |
283 | 287 | uasort($tagCollection, function ($t1, $t2) { |
284 | - if ($t1->depth == $t2->depth) return 0; |
|
288 | + if ($t1->depth == $t2->depth) { |
|
289 | + return 0; |
|
290 | + } |
|
285 | 291 | return ($t1->depth > $t2->depth) ? -1 : 1; |
286 | 292 | }); |
287 | 293 | break; |