Passed
Push — master ( eff446...11d98b )
by Gaetano
05:37
created
Command/MassMigrateCommand.php 1 patch
Spacing   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -132,7 +132,7 @@  discard block
 block discarded – undo
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
@@ -178,14 +178,14 @@  discard block
 block discarded – undo
178 178
         }
179 179
 
180 180
         $missed = $total - $this->migrationsDone[Migration::STATUS_DONE] - $this->migrationsDone[Migration::STATUS_FAILED] - $this->migrationsDone[Migration::STATUS_SKIPPED];
181
-        $this->writeln("\nExecuted ".$this->migrationsDone[Migration::STATUS_DONE].' migrations'.
182
-            ', failed '.$this->migrationsDone[Migration::STATUS_FAILED].
183
-            ', skipped '.$this->migrationsDone[Migration::STATUS_SKIPPED].
181
+        $this->writeln("\nExecuted " . $this->migrationsDone[Migration::STATUS_DONE] . ' migrations' .
182
+            ', failed ' . $this->migrationsDone[Migration::STATUS_FAILED] .
183
+            ', skipped ' . $this->migrationsDone[Migration::STATUS_SKIPPED] .
184 184
             ($missed ? ", missed $missed" : ''));
185 185
 
186 186
         $time = microtime(true) - $start;
187 187
         // since we use subprocesses, we can not measure max memory used
188
-        $this->writeln("<info>Time taken: ".sprintf('%.2f', $time)." secs</info>");
188
+        $this->writeln("<info>Time taken: " . sprintf('%.2f', $time) . " secs</info>");
189 189
 
190 190
         return $subprocessesFailed + $this->migrationsDone['failed'] + $missed;
191 191
     }
@@ -227,7 +227,7 @@  discard block
 block discarded – undo
227 227
         foreach ($toExecute as  $name => $migrationDefinition) {
228 228
             // let's skip migrations that we know are invalid - user was warned and he decided to proceed anyway
229 229
             if ($migrationDefinition->status == MigrationDefinition::STATUS_INVALID) {
230
-                $this->writeln("<comment>Skipping migration (invalid definition?) Path: ".$migrationDefinition->path."</comment>", self::VERBOSITY_CHILD);
230
+                $this->writeln("<comment>Skipping migration (invalid definition?) Path: " . $migrationDefinition->path . "</comment>", self::VERBOSITY_CHILD);
231 231
                 $skipped++;
232 232
                 continue;
233 233
             }
@@ -262,7 +262,7 @@  discard block
 block discarded – undo
262 262
                     $this->executeMigrationInProcess($migrationDefinition, $force, $migrationService, $input);
263 263
 
264 264
                     $executed++;
265
-                } catch(\Exception $e) {
265
+                } catch (\Exception $e) {
266 266
                     $failed++;
267 267
 
268 268
                     $errorMessage = $e->getMessage();
@@ -294,7 +294,7 @@  discard block
 block discarded – undo
294 294
      * @param string $buffer
295 295
      * @param null|\Symfony\Component\Process\Process $process
296 296
      */
297
-    public function onChildProcessOutput($type, $buffer, $process=null)
297
+    public function onChildProcessOutput($type, $buffer, $process = null)
298 298
     {
299 299
         $lines = explode("\n", trim($buffer));
300 300
 
@@ -312,7 +312,7 @@  discard block
 block discarded – undo
312 312
 
313 313
             // we tag the output with the id of the child process
314 314
             if (trim($line) !== '') {
315
-                $msg = '[' . ($process ? $process->getPid() : ''). '] ' . trim($line);
315
+                $msg = '[' . ($process ? $process->getPid() : '') . '] ' . trim($line);
316 316
                 if ($type == 'err') {
317 317
                     $this->writeErrorln($msg, OutputInterface::VERBOSITY_NORMAL, OutputInterface::OUTPUT_RAW);
318 318
                 } else {
@@ -348,7 +348,7 @@  discard block
 block discarded – undo
348 348
 
349 349
         // filter away all migrations except 'to do' ones
350 350
         $toExecute = array();
351
-        foreach($migrationDefinitions as $name => $migrationDefinition) {
351
+        foreach ($migrationDefinitions as $name => $migrationDefinition) {
352 352
             if (!isset($migrations[$name]) || (($migration = $migrations[$name]) && in_array($migration->status, $allowedStatuses))) {
353 353
                 $toExecute[$name] = $isChild ? $migrationService->parseMigrationDefinition($migrationDefinition) : $migrationDefinition;
354 354
             }
@@ -390,7 +390,7 @@  discard block
 block discarded – undo
390 390
     {
391 391
         $output->writeln('Found ' . count($toExecute) . ' migrations in ' . count($paths) . ' directories');
392 392
         $output->writeln('In the same directories, migrations previously executed: ' . $this->migrationsAlreadyDone[Migration::STATUS_DONE] .
393
-            ', failed: ' . $this->migrationsAlreadyDone[Migration::STATUS_FAILED] . ', skipped: '. $this->migrationsAlreadyDone[Migration::STATUS_SKIPPED]);
393
+            ', failed: ' . $this->migrationsAlreadyDone[Migration::STATUS_FAILED] . ', skipped: ' . $this->migrationsAlreadyDone[Migration::STATUS_SKIPPED]);
394 394
         if ($this->migrationsAlreadyDone[Migration::STATUS_STARTED]) {
395 395
             $output->writeln('<info>In the same directories, migrations currently executing: ' . $this->migrationsAlreadyDone[Migration::STATUS_STARTED] . '</info>');
396 396
         }
@@ -403,7 +403,7 @@  discard block
 block discarded – undo
403 403
     protected function groupMigrationsByPath($toExecute)
404 404
     {
405 405
         $paths = array();
406
-        foreach($toExecute as $name => $migrationDefinition) {
406
+        foreach ($toExecute as $name => $migrationDefinition) {
407 407
             $path = dirname($migrationDefinition->path);
408 408
             if (!isset($paths[$path])) {
409 409
                 $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
@@ -207,9 +207,9 @@  discard block
 block discarded – undo
207 207
         $time = microtime(true) - $start;
208 208
         if ($input->getOption('separate-process')) {
209 209
             // in case of using subprocesses, we can not measure max memory used
210
-            $this->writeln("<info>Time taken: ".sprintf('%.2f', $time)." secs</info>");
210
+            $this->writeln("<info>Time taken: " . sprintf('%.2f', $time) . " secs</info>");
211 211
         } else {
212
-            $this->writeln("<info>Time taken: ".sprintf('%.2f', $time)." secs, memory: ".sprintf('%.2f', (memory_get_peak_usage(true) / 1000000)). ' MB</info>');
212
+            $this->writeln("<info>Time taken: " . sprintf('%.2f', $time) . " secs, memory: " . sprintf('%.2f', (memory_get_peak_usage(true) / 1000000)) . ' MB</info>');
213 213
         }
214 214
 
215 215
         return $failed;
@@ -433,7 +433,7 @@  discard block
 block discarded – undo
433 433
             $builderArgs[] = '--no-debug';
434 434
         }
435 435
         if ($input->getOption('siteaccess')) {
436
-            $builderArgs[]='--siteaccess='.$input->getOption('siteaccess');
436
+            $builderArgs[] = '--siteaccess=' . $input->getOption('siteaccess');
437 437
         }
438 438
         // 'optional' options
439 439
         // note: options 'clear-cache', 'ignore-failures', 'no-interaction', 'path', 'separate-process' and 'survive-disconnected-tty' we never propagate
Please login to merge, or discard this patch.
Core/Process/ProcessBuilder.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -22,23 +22,23 @@
 block discarded – undo
22 22
     public function getProcess()
23 23
     {
24 24
         $parentClass = get_parent_class($this);
25
-        $this_prefix = \Closure::bind(function(ProcessBuilder $builder){return $builder->prefix;}, null, $parentClass);
25
+        $this_prefix = \Closure::bind(function(ProcessBuilder $builder) {return $builder->prefix; }, null, $parentClass);
26 26
         $this_prefix = $this_prefix($this);
27
-        $this_arguments = \Closure::bind(function(ProcessBuilder $builder){return $builder->arguments;}, null, $parentClass);
27
+        $this_arguments = \Closure::bind(function(ProcessBuilder $builder) {return $builder->arguments; }, null, $parentClass);
28 28
         $this_arguments = $this_arguments($this);
29
-        $this_options = \Closure::bind(function(ProcessBuilder $builder){return $builder->options;}, null, $parentClass);
29
+        $this_options = \Closure::bind(function(ProcessBuilder $builder) {return $builder->options; }, null, $parentClass);
30 30
         $this_options = $this_options($this);
31
-        $this_inheritEnv = \Closure::bind(function(ProcessBuilder $builder){return $builder->inheritEnv;}, null, $parentClass);
31
+        $this_inheritEnv = \Closure::bind(function(ProcessBuilder $builder) {return $builder->inheritEnv; }, null, $parentClass);
32 32
         $this_inheritEnv = $this_inheritEnv($this);
33
-        $this_env = \Closure::bind(function(ProcessBuilder $builder){return $builder->env;}, null, $parentClass);
33
+        $this_env = \Closure::bind(function(ProcessBuilder $builder) {return $builder->env; }, null, $parentClass);
34 34
         $this_env = $this_env($this);
35
-        $this_cwd = \Closure::bind(function(ProcessBuilder $builder){return $builder->cwd;}, null, $parentClass);
35
+        $this_cwd = \Closure::bind(function(ProcessBuilder $builder) {return $builder->cwd; }, null, $parentClass);
36 36
         $this_cwd = $this_cwd($this);
37
-        $this_input = \Closure::bind(function(ProcessBuilder $builder){return $builder->input;}, null, $parentClass);
37
+        $this_input = \Closure::bind(function(ProcessBuilder $builder) {return $builder->input; }, null, $parentClass);
38 38
         $this_input = $this_input($this);
39
-        $this_timeout = \Closure::bind(function(ProcessBuilder $builder){return $builder->timeout;}, null, $parentClass);
39
+        $this_timeout = \Closure::bind(function(ProcessBuilder $builder) {return $builder->timeout; }, null, $parentClass);
40 40
         $this_timeout = $this_timeout($this);
41
-        $this_outputDisabled = \Closure::bind(function(ProcessBuilder $builder){return $builder->outputDisabled;}, null, $parentClass);
41
+        $this_outputDisabled = \Closure::bind(function(ProcessBuilder $builder) {return $builder->outputDisabled; }, null, $parentClass);
42 42
         $this_outputDisabled = $this_outputDisabled($this);
43 43
 
44 44
         if (0 === count($this_prefix) && 0 === count($this_arguments)) {
Please login to merge, or discard this patch.