@@ -123,26 +123,26 @@ discard block |
||
| 123 | 123 | |
| 124 | 124 | $migration = new Migration(new Uri($dbConnection), $this->workdir . "/db"); |
| 125 | 125 | $migration->registerDatabase("mysql", MySqlDatabase::class); |
| 126 | - $migration->addCallbackProgress(function ($cmd, $version) { |
|
| 126 | + $migration->addCallbackProgress(function($cmd, $version) { |
|
| 127 | 127 | echo "Doing $cmd, $version\n"; |
| 128 | 128 | }); |
| 129 | 129 | |
| 130 | 130 | $argumentList = $this->extractArguments($arguments); |
| 131 | 131 | |
| 132 | - $exec['reset'] = function () use ($migration, $argumentList) { |
|
| 133 | - if (!$argumentList["--yes"]) { |
|
| 132 | + $exec[ 'reset' ] = function() use ($migration, $argumentList) { |
|
| 133 | + if (!$argumentList[ "--yes" ]) { |
|
| 134 | 134 | throw new \Exception("Reset require the argument --yes"); |
| 135 | 135 | } |
| 136 | 136 | $migration->reset(); |
| 137 | 137 | }; |
| 138 | 138 | |
| 139 | 139 | |
| 140 | - $exec["update"] = function () use ($migration, $argumentList) { |
|
| 141 | - $migration->update($argumentList["--up-to"], $argumentList["--force"]); |
|
| 140 | + $exec[ "update" ] = function() use ($migration, $argumentList) { |
|
| 141 | + $migration->update($argumentList[ "--up-to" ], $argumentList[ "--force" ]); |
|
| 142 | 142 | }; |
| 143 | 143 | |
| 144 | - if (isset($exec[$argumentList['command']])) { |
|
| 145 | - $exec[$argumentList['command']](); |
|
| 144 | + if (isset($exec[ $argumentList[ 'command' ] ])) { |
|
| 145 | + $exec[ $argumentList[ 'command' ] ](); |
|
| 146 | 146 | } |
| 147 | 147 | } |
| 148 | 148 | |
@@ -157,11 +157,11 @@ discard block |
||
| 157 | 157 | '--force' => false, |
| 158 | 158 | ]; |
| 159 | 159 | |
| 160 | - $ret['command'] = isset($arguments[0]) ? $arguments[0] : null; |
|
| 160 | + $ret[ 'command' ] = isset($arguments[ 0 ]) ? $arguments[ 0 ] : null; |
|
| 161 | 161 | |
| 162 | - for ($i=1; $i < count($arguments); $i++) { |
|
| 163 | - $args = explode("=", $arguments[$i]); |
|
| 164 | - $ret[$args[0]] = isset($args[1]) ? $args[1] : true; |
|
| 162 | + for ($i = 1; $i < count($arguments); $i++) { |
|
| 163 | + $args = explode("=", $arguments[ $i ]); |
|
| 164 | + $ret[ $args[ 0 ] ] = isset($args[ 1 ]) ? $args[ 1 ] : true; |
|
| 165 | 165 | } |
| 166 | 166 | |
| 167 | 167 | return $ret; |