@@ -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,8 +30,8 @@ |
||
30 | 30 | } |
31 | 31 | } |
32 | 32 | $this->defineParameters($container); |
33 | - if(!$container->hasParameter('dami.migrations_directory')) { |
|
34 | - $container->setParameter('dami.migrations_directory', getcwd() . '/migrations'); |
|
33 | + if (!$container->hasParameter('dami.migrations_directory')) { |
|
34 | + $container->setParameter('dami.migrations_directory', getcwd().'/migrations'); |
|
35 | 35 | } |
36 | 36 | |
37 | 37 | $definition = new Definition('%dami.migration_name_parser.class%'); |
@@ -6,11 +6,11 @@ |
||
6 | 6 | { |
7 | 7 | public function up() |
8 | 8 | { |
9 | - <?php echo $initUp . "\n" ?> |
|
9 | + <?php echo $initUp."\n" ?> |
|
10 | 10 | } |
11 | 11 | |
12 | 12 | public function down() |
13 | 13 | { |
14 | - <?php echo $initDown . "\n" ?> |
|
14 | + <?php echo $initDown."\n" ?> |
|
15 | 15 | } |
16 | 16 | } |
@@ -18,9 +18,9 @@ |
||
18 | 18 | $items = explode('_', $filename); |
19 | 19 | $this->version = $items[0]; |
20 | 20 | |
21 | - $this->name = ltrim($filename, $this->version . '_'); |
|
21 | + $this->name = ltrim($filename, $this->version.'_'); |
|
22 | 22 | $this->name = basename($this->name, '.php'); |
23 | - $this->className = S::upperCamelize($this->name) . 'Migration'; |
|
23 | + $this->className = S::upperCamelize($this->name).'Migration'; |
|
24 | 24 | } |
25 | 25 | |
26 | 26 | /** |
@@ -29,7 +29,7 @@ discard block |
||
29 | 29 | */ |
30 | 30 | public function render($migrationName) |
31 | 31 | { |
32 | - $loader = new FilesystemLoader(__DIR__ . '/views/%name%'); |
|
32 | + $loader = new FilesystemLoader(__DIR__.'/views/%name%'); |
|
33 | 33 | |
34 | 34 | $view = new PhpEngine(new TemplateNameParser(), $loader); |
35 | 35 | |
@@ -49,6 +49,6 @@ discard block |
||
49 | 49 | */ |
50 | 50 | private function getTemplatePath() |
51 | 51 | { |
52 | - return __DIR__ . '/Template.php'; |
|
52 | + return __DIR__.'/Template.php'; |
|
53 | 53 | } |
54 | 54 | } |