Completed
Push — master ( 2e4bb9...57d19c )
by Gaetano
07:25
created
Command/MassMigrateCommand.php 1 patch
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -102,7 +102,7 @@  discard block
 block discarded – undo
102 102
 
103 103
             $processes = array();
104 104
             /** @var MigrationDefinition $migrationDefinition */
105
-            foreach($paths as $path => $count) {
105
+            foreach ($paths as $path => $count) {
106 106
                 $this->writeln("<info>Queueing processing of: $path ($count migrations)</info>", OutputInterface::VERBOSITY_VERBOSE);
107 107
 
108 108
                 $process = $builder
@@ -139,11 +139,11 @@  discard block
 block discarded – undo
139 139
 
140 140
             $time = microtime(true) - $start;
141 141
 
142
-            $this->writeln('<info>'.$this->migrationsDone[0].' migrations executed, '.$this->migrationsDone[1].' failed, '.$this->migrationsDone[2].' skipped</info>');
142
+            $this->writeln('<info>' . $this->migrationsDone[0] . ' migrations executed, ' . $this->migrationsDone[1] . ' failed, ' . $this->migrationsDone[2] . ' skipped</info>');
143 143
             $this->writeln("<info>Import finished</info>\n");
144 144
 
145 145
             // since we use subprocesses, we can not measure max memory used
146
-            $this->writeln("Time taken: ".sprintf('%.2f', $time)." secs");
146
+            $this->writeln("Time taken: " . sprintf('%.2f', $time) . " secs");
147 147
 
148 148
             return $failed;
149 149
 
@@ -169,7 +169,7 @@  discard block
 block discarded – undo
169 169
             foreach ($toExecute as  $name => $migrationDefinition) {
170 170
                 // let's skip migrations that we know are invalid - user was warned and he decided to proceed anyway
171 171
                 if ($migrationDefinition->status == MigrationDefinition::STATUS_INVALID) {
172
-                    $this->writeln("<comment>Skipping migration (invalid definition?) Path: ".$migrationDefinition->path."</comment>", self::VERBOSITY_CHILD);
172
+                    $this->writeln("<comment>Skipping migration (invalid definition?) Path: " . $migrationDefinition->path . "</comment>", self::VERBOSITY_CHILD);
173 173
                     $skipped++;
174 174
                     continue;
175 175
                 }
@@ -243,7 +243,7 @@  discard block
 block discarded – undo
243 243
                         );
244 244
 
245 245
                         $executed++;
246
-                    } catch(\Exception $e) {
246
+                    } catch (\Exception $e) {
247 247
                         $failed++;
248 248
                         if ($input->getOption('ignore-failures')) {
249 249
                             $this->writeln("<error>Migration failed! Path: " . $migrationDefinition->path . ", Reason: " . $e->getMessage() . "</error>", self::VERBOSITY_CHILD);
@@ -269,7 +269,7 @@  discard block
 block discarded – undo
269 269
         }
270 270
     }
271 271
 
272
-    public function onSubProcessOutput($type, $buffer, $process=null)
272
+    public function onSubProcessOutput($type, $buffer, $process = null)
273 273
     {
274 274
         $lines = explode("\n", trim($buffer));
275 275
 
@@ -287,7 +287,7 @@  discard block
 block discarded – undo
287 287
 
288 288
             // we tag the output from the different processes
289 289
             if (trim($line) !== '') {
290
-                echo '[' . ($process ? $process->getPid() : ''). '] ' . trim($line) . "\n";
290
+                echo '[' . ($process ? $process->getPid() : '') . '] ' . trim($line) . "\n";
291 291
             }
292 292
         }
293 293
     }
@@ -309,7 +309,7 @@  discard block
 block discarded – undo
309 309
 
310 310
         // filter away all migrations except 'to do' ones
311 311
         $toExecute = array();
312
-        foreach($migrationDefinitions as $name => $migrationDefinition) {
312
+        foreach ($migrationDefinitions as $name => $migrationDefinition) {
313 313
             if (!isset($migrations[$name]) || (($migration = $migrations[$name]) && $migration->status == Migration::STATUS_TODO)) {
314 314
                 $toExecute[$name] = $isChild ? $migrationService->parseMigrationDefinition($migrationDefinition) : $migrationDefinition;
315 315
             }
@@ -351,7 +351,7 @@  discard block
 block discarded – undo
351 351
     {
352 352
         $output->writeln('Found ' . count($toExecute) . ' migrations in ' . count($paths) . ' directories');
353 353
         $output->writeln('In the same directories, migrations previously executed: ' . $this->migrationsAlreadyDone[Migration::STATUS_DONE] .
354
-            ', failed: ' . $this->migrationsAlreadyDone[Migration::STATUS_FAILED] . ', skipped: '. $this->migrationsAlreadyDone[Migration::STATUS_SKIPPED]);
354
+            ', failed: ' . $this->migrationsAlreadyDone[Migration::STATUS_FAILED] . ', skipped: ' . $this->migrationsAlreadyDone[Migration::STATUS_SKIPPED]);
355 355
     }
356 356
 
357 357
     protected function askForConfirmation(InputInterface $input, OutputInterface $output)
@@ -382,7 +382,7 @@  discard block
 block discarded – undo
382 382
     protected function groupMigrationsByPath($toExecute)
383 383
     {
384 384
         $paths = array();
385
-        foreach($toExecute as $name => $migrationDefinition) {
385
+        foreach ($toExecute as $name => $migrationDefinition) {
386 386
             $path = dirname($migrationDefinition->path);
387 387
             if (!isset($paths[$path])) {
388 388
                 $paths[$path] = 1;
Please login to merge, or discard this patch.
Command/MigrateCommand.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -219,9 +219,9 @@  discard block
 block discarded – undo
219 219
         $this->writeln("Executed $executed migrations, failed $failed, skipped $skipped");
220 220
         if ($input->getOption('separate-process')) {
221 221
             // in case of using subprocesses, we can not measure max memory used
222
-            $this->writeln("Time taken: ".sprintf('%.2f', $time)." secs");
222
+            $this->writeln("Time taken: " . sprintf('%.2f', $time) . " secs");
223 223
         } else {
224
-            $this->writeln("Time taken: ".sprintf('%.2f', $time)." secs, memory: ".sprintf('%.2f', (memory_get_peak_usage(true) / 1000000)). ' MB');
224
+            $this->writeln("Time taken: " . sprintf('%.2f', $time) . " secs, memory: " . sprintf('%.2f', (memory_get_peak_usage(true) / 1000000)) . ' MB');
225 225
         }
226 226
     }
227 227
 
@@ -369,7 +369,7 @@  discard block
 block discarded – undo
369 369
             $builderArgs[] = '--no-debug';
370 370
         }
371 371
         if ($input->getOption('siteaccess')) {
372
-            $builderArgs[]='--siteaccess='.$input->getOption('siteaccess');
372
+            $builderArgs[] = '--siteaccess=' . $input->getOption('siteaccess');
373 373
         }
374 374
         // 'optional' options
375 375
         // note: options 'clear-cache', 'ignore-failures', 'no-interaction', 'path' and 'separate-process' we never propagate
Please login to merge, or discard this patch.