@@ -87,7 +87,7 @@ |
||
| 87 | 87 | return $finder |
| 88 | 88 | ->files() |
| 89 | 89 | ->in($this->path) |
| 90 | - ->sort(function (\SplFileInfo $a, \SplFileInfo $b) use ($migrateUp) { |
|
| 90 | + ->sort(function(\SplFileInfo $a, \SplFileInfo $b) use ($migrateUp) { |
|
| 91 | 91 | return $migrateUp |
| 92 | 92 | ? $a->getRealpath() > $b->getRealpath() |
| 93 | 93 | : $a->getRealpath() < $b->getRealpath(); |
@@ -4,6 +4,6 @@ |
||
| 4 | 4 | |
| 5 | 5 | abstract class Direction |
| 6 | 6 | { |
| 7 | - const UP = 'up'; |
|
| 8 | - const DOWN = 'down'; |
|
| 7 | + const UP = 'up'; |
|
| 8 | + const DOWN = 'down'; |
|
| 9 | 9 | } |
@@ -52,7 +52,7 @@ discard block |
||
| 52 | 52 | if (isset($options['comment'])) { |
| 53 | 53 | $table->setDescription($options['comment']); |
| 54 | 54 | } |
| 55 | - $this->actions[] = function () use ($table) { |
|
| 55 | + $this->actions[] = function() use ($table) { |
|
| 56 | 56 | return $this->manipulation->create($table); |
| 57 | 57 | }; |
| 58 | 58 | |
@@ -73,7 +73,7 @@ discard block |
||
| 73 | 73 | $table = new Table($name, $schema); |
| 74 | 74 | |
| 75 | 75 | $cascade = isset($options['cascade']) ? $options['cascade'] : true; |
| 76 | - $this->actions[] = function () use ($table, $cascade) { |
|
| 76 | + $this->actions[] = function() use ($table, $cascade) { |
|
| 77 | 77 | return $this->manipulation->drop($table, $cascade); |
| 78 | 78 | }; |
| 79 | 79 | } |
@@ -103,7 +103,7 @@ discard block |
||
| 103 | 103 | public function createSchema($name) |
| 104 | 104 | { |
| 105 | 105 | $schema = new Schema($name); |
| 106 | - $this->actions[] = function () use ($schema) { |
|
| 106 | + $this->actions[] = function() use ($schema) { |
|
| 107 | 107 | return $this->manipulation->create($schema); |
| 108 | 108 | }; |
| 109 | 109 | } |
@@ -118,7 +118,7 @@ discard block |
||
| 118 | 118 | public function dropSchema($name) |
| 119 | 119 | { |
| 120 | 120 | $schema = new Schema($name); |
| 121 | - $this->actions[] = function () use ($schema) { |
|
| 121 | + $this->actions[] = function() use ($schema) { |
|
| 122 | 122 | return $this->manipulation->drop($schema); |
| 123 | 123 | }; |
| 124 | 124 | } |
@@ -60,7 +60,7 @@ discard block |
||
| 60 | 60 | $column = new TextColumn($name); |
| 61 | 61 | $column->setTable($this); |
| 62 | 62 | |
| 63 | - $this->actions[] = function () use ($column) { |
|
| 63 | + $this->actions[] = function() use ($column) { |
|
| 64 | 64 | return $this->manipulation->drop($column); |
| 65 | 65 | }; |
| 66 | 66 | |
@@ -94,7 +94,7 @@ discard block |
||
| 94 | 94 | if (isset($options['delete'])) { |
| 95 | 95 | $foreignKey->setDeleteAction($options['delete']); |
| 96 | 96 | } |
| 97 | - $this->actions[] = function () use ($foreignKey) { |
|
| 97 | + $this->actions[] = function() use ($foreignKey) { |
|
| 98 | 98 | return $this->manipulation->create($foreignKey); |
| 99 | 99 | }; |
| 100 | 100 | |
@@ -118,7 +118,7 @@ discard block |
||
| 118 | 118 | $foreignKey->setColumns($referenceColumns); |
| 119 | 119 | $foreignKey->setReferencedColumns($referenceColumns); |
| 120 | 120 | |
| 121 | - $this->actions[] = function () use ($foreignKey) { |
|
| 121 | + $this->actions[] = function() use ($foreignKey) { |
|
| 122 | 122 | return $this->manipulation->drop($foreignKey); |
| 123 | 123 | }; |
| 124 | 124 | |
@@ -136,7 +136,7 @@ discard block |
||
| 136 | 136 | { |
| 137 | 137 | $unique = new Unique($columns, $this); |
| 138 | 138 | |
| 139 | - $this->actions[] = function () use ($unique) { |
|
| 139 | + $this->actions[] = function() use ($unique) { |
|
| 140 | 140 | return $this->manipulation->create($unique); |
| 141 | 141 | }; |
| 142 | 142 | |
@@ -154,7 +154,7 @@ discard block |
||
| 154 | 154 | { |
| 155 | 155 | $unique = new Unique($columns, $this); |
| 156 | 156 | |
| 157 | - $this->actions[] = function () use ($unique) { |
|
| 157 | + $this->actions[] = function() use ($unique) { |
|
| 158 | 158 | return $this->manipulation->drop($unique); |
| 159 | 159 | }; |
| 160 | 160 | |
@@ -172,7 +172,7 @@ discard block |
||
| 172 | 172 | { |
| 173 | 173 | $index = new Index($columns, $this); |
| 174 | 174 | |
| 175 | - $this->actions[] = function () use ($index) { |
|
| 175 | + $this->actions[] = function() use ($index) { |
|
| 176 | 176 | return $this->manipulation->create($index); |
| 177 | 177 | }; |
| 178 | 178 | |
@@ -190,7 +190,7 @@ discard block |
||
| 190 | 190 | { |
| 191 | 191 | $index = new Index($columns, $this); |
| 192 | 192 | |
| 193 | - $this->actions[] = function () use ($index) { |
|
| 193 | + $this->actions[] = function() use ($index) { |
|
| 194 | 194 | return $this->manipulation->drop($index); |
| 195 | 195 | }; |
| 196 | 196 | |
@@ -40,7 +40,7 @@ |
||
| 40 | 40 | } else { |
| 41 | 41 | $output->writeln(sprintf('<comment>No migrations detected.</comment>')); |
| 42 | 42 | } |
| 43 | - } catch(\PDOException $e) { |
|
| 43 | + } catch (\PDOException $e) { |
|
| 44 | 44 | $output->writeln("\n<error>There was something wrong during migration. Database schema has not been changed.</error>"); |
| 45 | 45 | if (OutputInterface::VERBOSITY_VERBOSE <= $output->getVerbosity()) { |
| 46 | 46 | $output->writeln(sprintf("\n<error>%s</error>", $e->getMessage())); |
@@ -30,7 +30,7 @@ |
||
| 30 | 30 | } |
| 31 | 31 | } |
| 32 | 32 | $this->defineParameters($container); |
| 33 | - if(!$container->hasParameter('dami.migrations_directory')) { |
|
| 33 | + if (!$container->hasParameter('dami.migrations_directory')) { |
|
| 34 | 34 | $container->setParameter('dami.migrations_directory', getcwd() . '/migrations'); |
| 35 | 35 | } |
| 36 | 36 | |
@@ -60,7 +60,7 @@ discard block |
||
| 60 | 60 | public function iSeeTheFileWitchNameContains($fileName) |
| 61 | 61 | { |
| 62 | 62 | $this->fileName = $fileName; |
| 63 | - $pattern = getcwd() . '/' . $this->dir; |
|
| 63 | + $pattern = getcwd() . '/' . $this->dir; |
|
| 64 | 64 | if (count((new Finder())->files()->in($pattern)->name('*' . $fileName)) === 0) { |
| 65 | 65 | throw new \Exception('File does not exist'); |
| 66 | 66 | } |
@@ -71,7 +71,7 @@ discard block |
||
| 71 | 71 | */ |
| 72 | 72 | public function thisFileBodyContains(PyStringNode $string) |
| 73 | 73 | { |
| 74 | - $pattern = getcwd() . '/' . $this->dir; |
|
| 74 | + $pattern = getcwd() . '/' . $this->dir; |
|
| 75 | 75 | $content = ''; |
| 76 | 76 | foreach ((new Finder())->files()->in($pattern)->name('*' . $this->fileName) as $file) { |
| 77 | 77 | $content = $file->getContents(); |
@@ -86,7 +86,7 @@ discard block |
||
| 86 | 86 | */ |
| 87 | 87 | public function deleteMigrations(AfterScenarioScope $scope) |
| 88 | 88 | { |
| 89 | - $pattern = getcwd() . '/' . $this->dir . '/*.php'; |
|
| 89 | + $pattern = getcwd() . '/' . $this->dir . '/*.php'; |
|
| 90 | 90 | array_map('unlink', glob($pattern)); |
| 91 | 91 | } |
| 92 | 92 | } |