@@ -78,8 +78,7 @@ |
||
| 78 | 78 | $this->errOutput->setVerbosity(OutputInterface::VERBOSITY_NORMAL); |
| 79 | 79 | $this->errOutput->writeln($message, $type); |
| 80 | 80 | $this->errOutput->setVerbosity(OutputInterface::VERBOSITY_QUIET); |
| 81 | - } |
|
| 82 | - else |
|
| 81 | + } else |
|
| 83 | 82 | { |
| 84 | 83 | $this->errOutput->writeln($message, $type); |
| 85 | 84 | } |
@@ -132,7 +132,7 @@ discard block |
||
| 132 | 132 | |
| 133 | 133 | $processes = array(); |
| 134 | 134 | /** @var MigrationDefinition $migrationDefinition */ |
| 135 | - foreach($paths as $path => $count) { |
|
| 135 | + foreach ($paths as $path => $count) { |
|
| 136 | 136 | $this->writeln("<info>Queueing processing of: $path ($count migrations)</info>", OutputInterface::VERBOSITY_VERBOSE); |
| 137 | 137 | |
| 138 | 138 | $process = $builder |
@@ -179,14 +179,14 @@ discard block |
||
| 179 | 179 | } |
| 180 | 180 | |
| 181 | 181 | $missed = $total - $this->migrationsDone[Migration::STATUS_DONE] - $this->migrationsDone[Migration::STATUS_FAILED] - $this->migrationsDone[Migration::STATUS_SKIPPED]; |
| 182 | - $this->writeln("\nExecuted ".$this->migrationsDone[Migration::STATUS_DONE].' migrations'. |
|
| 183 | - ', failed '.$this->migrationsDone[Migration::STATUS_FAILED]. |
|
| 184 | - ', skipped '.$this->migrationsDone[Migration::STATUS_SKIPPED]. |
|
| 182 | + $this->writeln("\nExecuted " . $this->migrationsDone[Migration::STATUS_DONE] . ' migrations' . |
|
| 183 | + ', failed ' . $this->migrationsDone[Migration::STATUS_FAILED] . |
|
| 184 | + ', skipped ' . $this->migrationsDone[Migration::STATUS_SKIPPED] . |
|
| 185 | 185 | ($missed ? ", missed $missed" : '')); |
| 186 | 186 | |
| 187 | 187 | $time = microtime(true) - $start; |
| 188 | 188 | // since we use subprocesses, we can not measure max memory used |
| 189 | - $this->writeln("<info>Time taken: ".sprintf('%.2f', $time)." secs</info>"); |
|
| 189 | + $this->writeln("<info>Time taken: " . sprintf('%.2f', $time) . " secs</info>"); |
|
| 190 | 190 | |
| 191 | 191 | return $subprocessesFailed + $this->migrationsDone[Migration::STATUS_FAILED] + $missed; |
| 192 | 192 | } |
@@ -228,7 +228,7 @@ discard block |
||
| 228 | 228 | foreach ($toExecute as $name => $migrationDefinition) { |
| 229 | 229 | // let's skip migrations that we know are invalid - user was warned and he decided to proceed anyway |
| 230 | 230 | if ($migrationDefinition->status == MigrationDefinition::STATUS_INVALID) { |
| 231 | - $this->writeln("<comment>Skipping migration (invalid definition?) Path: ".$migrationDefinition->path."</comment>", self::VERBOSITY_CHILD); |
|
| 231 | + $this->writeln("<comment>Skipping migration (invalid definition?) Path: " . $migrationDefinition->path . "</comment>", self::VERBOSITY_CHILD); |
|
| 232 | 232 | $skipped++; |
| 233 | 233 | continue; |
| 234 | 234 | } |
@@ -268,7 +268,7 @@ discard block |
||
| 268 | 268 | $this->executeMigrationInProcess($migrationDefinition, $force, $migrationService, $input); |
| 269 | 269 | |
| 270 | 270 | $executed++; |
| 271 | - } catch(\Exception $e) { |
|
| 271 | + } catch (\Exception $e) { |
|
| 272 | 272 | $failed++; |
| 273 | 273 | |
| 274 | 274 | $errorMessage = $e->getMessage(); |
@@ -301,7 +301,7 @@ discard block |
||
| 301 | 301 | * @param string $buffer |
| 302 | 302 | * @param null|\Symfony\Component\Process\Process $process |
| 303 | 303 | */ |
| 304 | - public function onChildProcessOutput($type, $buffer, $process=null) |
|
| 304 | + public function onChildProcessOutput($type, $buffer, $process = null) |
|
| 305 | 305 | { |
| 306 | 306 | $lines = explode("\n", trim($buffer)); |
| 307 | 307 | |
@@ -319,7 +319,7 @@ discard block |
||
| 319 | 319 | |
| 320 | 320 | // we tag the output with the id of the child process |
| 321 | 321 | if (trim($line) !== '') { |
| 322 | - $msg = '[' . ($process ? $process->getPid() : ''). '] ' . trim($line); |
|
| 322 | + $msg = '[' . ($process ? $process->getPid() : '') . '] ' . trim($line); |
|
| 323 | 323 | if ($type == 'err') { |
| 324 | 324 | $this->writeErrorln($msg, OutputInterface::VERBOSITY_QUIET, OutputInterface::OUTPUT_RAW); |
| 325 | 325 | } else { |
@@ -353,7 +353,7 @@ discard block |
||
| 353 | 353 | |
| 354 | 354 | // filter away all migrations except 'to do' ones |
| 355 | 355 | $toExecute = array(); |
| 356 | - foreach($migrationDefinitions as $name => $migrationDefinition) { |
|
| 356 | + foreach ($migrationDefinitions as $name => $migrationDefinition) { |
|
| 357 | 357 | if (!isset($migrations[$name]) || (($migration = $migrations[$name]) && in_array($migration->status, $allowedStatuses))) { |
| 358 | 358 | $toExecute[$name] = $isChild ? $migrationService->parseMigrationDefinition($migrationDefinition) : $migrationDefinition; |
| 359 | 359 | } |
@@ -395,7 +395,7 @@ discard block |
||
| 395 | 395 | { |
| 396 | 396 | $output->writeln('Found ' . count($toExecute) . ' migrations in ' . count($paths) . ' directories'); |
| 397 | 397 | $output->writeln('In the same directories, migrations previously executed: ' . $this->migrationsAlreadyDone[Migration::STATUS_DONE] . |
| 398 | - ', failed: ' . $this->migrationsAlreadyDone[Migration::STATUS_FAILED] . ', skipped: '. $this->migrationsAlreadyDone[Migration::STATUS_SKIPPED]); |
|
| 398 | + ', failed: ' . $this->migrationsAlreadyDone[Migration::STATUS_FAILED] . ', skipped: ' . $this->migrationsAlreadyDone[Migration::STATUS_SKIPPED]); |
|
| 399 | 399 | if ($this->migrationsAlreadyDone[Migration::STATUS_STARTED]) { |
| 400 | 400 | $output->writeln('<info>In the same directories, migrations currently executing: ' . $this->migrationsAlreadyDone[Migration::STATUS_STARTED] . '</info>'); |
| 401 | 401 | } |
@@ -408,7 +408,7 @@ discard block |
||
| 408 | 408 | protected function groupMigrationsByPath($toExecute) |
| 409 | 409 | { |
| 410 | 410 | $paths = array(); |
| 411 | - foreach($toExecute as $name => $migrationDefinition) { |
|
| 411 | + foreach ($toExecute as $name => $migrationDefinition) { |
|
| 412 | 412 | $path = dirname($migrationDefinition->path); |
| 413 | 413 | if (!isset($paths[$path])) { |
| 414 | 414 | $paths[$path] = 1; |
@@ -213,9 +213,9 @@ discard block |
||
| 213 | 213 | $time = microtime(true) - $start; |
| 214 | 214 | if ($input->getOption('separate-process')) { |
| 215 | 215 | // in case of using subprocesses, we can not measure max memory used |
| 216 | - $this->writeln("<info>Time taken: ".sprintf('%.2f', $time)." secs</info>"); |
|
| 216 | + $this->writeln("<info>Time taken: " . sprintf('%.2f', $time) . " secs</info>"); |
|
| 217 | 217 | } else { |
| 218 | - $this->writeln("<info>Time taken: ".sprintf('%.2f', $time)." secs, memory: ".sprintf('%.2f', (memory_get_peak_usage(true) / 1000000)). ' MB</info>'); |
|
| 218 | + $this->writeln("<info>Time taken: " . sprintf('%.2f', $time) . " secs, memory: " . sprintf('%.2f', (memory_get_peak_usage(true) / 1000000)) . ' MB</info>'); |
|
| 219 | 219 | } |
| 220 | 220 | |
| 221 | 221 | return $failed; |
@@ -442,7 +442,7 @@ discard block |
||
| 442 | 442 | $builderArgs[] = '--no-debug'; |
| 443 | 443 | } |
| 444 | 444 | if ($input->getOption('siteaccess')) { |
| 445 | - $builderArgs[] = '--siteaccess='.$input->getOption('siteaccess'); |
|
| 445 | + $builderArgs[] = '--siteaccess=' . $input->getOption('siteaccess'); |
|
| 446 | 446 | } |
| 447 | 447 | switch ($this->verbosity) { |
| 448 | 448 | case OutputInterface::VERBOSITY_VERBOSE: |