Passed
Push — master ( 6fa9cc...aa75bf )
by Gaetano
03:49
created
Core/Loader/Filesystem.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -120,6 +120,6 @@
 block discarded – undo
120 120
     {
121 121
         $rootDir = realpath($this->kernel->getRootDir() . '/..') . '/';
122 122
         // note: we handle the case of 'path = root dir', but path is expected to include a filename...
123
-        return $path === $rootDir ? './' : preg_replace('#^' . preg_quote($rootDir, '#'). '#', '', $path);
123
+        return $path === $rootDir ? './' : preg_replace('#^' . preg_quote($rootDir, '#') . '#', '', $path);
124 124
     }
125 125
 }
Please login to merge, or discard this patch.
Core/FieldHandler/EzSelection.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -36,7 +36,7 @@  discard block
 block discarded – undo
36 36
 
37 37
         // allow user to pass in selection values by name
38 38
         $fieldSettings = null;
39
-        foreach($fieldValue as $key => $val) {
39
+        foreach ($fieldValue as $key => $val) {
40 40
 
41 41
             // NB: this might result in double reference-resolving when the original value is a string, given preResolveReferences...
42 42
             $val = $this->referenceResolver->resolveReference($val);
@@ -48,7 +48,7 @@  discard block
 block discarded – undo
48 48
                     if ($fieldSettings === null) {
49 49
                         $fieldSettings = $this->loadFieldSettings($context['contentTypeIdentifier'], $context['fieldIdentifier']);
50 50
                     }
51
-                    foreach($fieldSettings['options'] as $pos => $name) {
51
+                    foreach ($fieldSettings['options'] as $pos => $name) {
52 52
                         if ($name === $val) {
53 53
                             $fieldValue[$key] = $pos;
54 54
                             break;
Please login to merge, or discard this patch.
Core/Matcher/QueryBasedMatcher.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -155,7 +155,7 @@  discard block
 block discarded – undo
155 155
                     return new Query\Criterion\Field($attribute, self::$operatorsMap[$operator], $match);
156 156
                 } else {
157 157
                     /// @todo make the list of unary operators more flexible
158
-                    switch($spec) {
158
+                    switch ($spec) {
159 159
                         case 'empty':
160 160
                             return new Query\Criterion\IsFieldEmpty($attribute);
161 161
                         default:
@@ -180,7 +180,7 @@  discard block
 block discarded – undo
180 180
                 return new Query\Criterion\DateMetadata(Query\Criterion\DateMetadata::CREATED, self::$operatorsMap[$operator], $match);
181 181
 
182 182
             case self::MATCH_GROUP:
183
-                foreach($values as &$value) {
183
+                foreach ($values as &$value) {
184 184
                     if (!ctype_digit($value)) {
185 185
                         $value = $this->groupMatcher->matchOneByKey($value)->id;
186 186
                     }
@@ -199,7 +199,7 @@  discard block
 block discarded – undo
199 199
                 return new Query\Criterion\DateMetadata(Query\Criterion\DateMetadata::MODIFIED, self::$operatorsMap[$operator], $match);
200 200
 
201 201
             case self::MATCH_OBJECT_STATE:
202
-                foreach($values as &$value) {
202
+                foreach ($values as &$value) {
203 203
                     if (!ctype_digit($value)) {
204 204
                         $value = $this->stateMatcher->matchOneByKey($value)->id;
205 205
                     }
@@ -207,7 +207,7 @@  discard block
 block discarded – undo
207 207
                 return new Query\Criterion\ObjectStateId($values);
208 208
 
209 209
             case self::MATCH_OWNER:
210
-                foreach($values as &$value) {
210
+                foreach ($values as &$value) {
211 211
                     if (!ctype_digit($value)) {
212 212
                         $value = $this->userMatcher->matchOneByKey($value)->id;
213 213
                     }
@@ -227,7 +227,7 @@  discard block
 block discarded – undo
227 227
                 return new Query\Criterion\ParentLocationId($locationIds);
228 228
 
229 229
             case self::MATCH_SECTION:
230
-                foreach($values as &$value) {
230
+                foreach ($values as &$value) {
231 231
                     if (!ctype_digit($value)) {
232 232
                         $value = $this->sectionMatcher->matchOneByKey($value)->id;
233 233
                     }
@@ -248,7 +248,7 @@  discard block
 block discarded – undo
248 248
 
249 249
             case self::MATCH_AND:
250 250
                 $subCriteria = array();
251
-                foreach($values as $subCriterion) {
251
+                foreach ($values as $subCriterion) {
252 252
                     $value = reset($subCriterion);
253 253
                     $subCriteria[] = $this->getQueryCriterion(key($subCriterion), $value);
254 254
                 }
@@ -256,7 +256,7 @@  discard block
 block discarded – undo
256 256
 
257 257
             case self::MATCH_OR:
258 258
                 $subCriteria = array();
259
-                foreach($values as $subCriterion) {
259
+                foreach ($values as $subCriterion) {
260 260
                     $value = reset($subCriterion);
261 261
                     $subCriteria[] = $this->getQueryCriterion(key($subCriterion), $value);
262 262
                 }
@@ -301,7 +301,7 @@  discard block
 block discarded – undo
301 301
 
302 302
             $direction = $this->hash2SortOrder($sortItem['sort_order']);
303 303
 
304
-            switch($sortItem['sort_field']) {
304
+            switch ($sortItem['sort_field']) {
305 305
                 case self::SORT_CONTENT_ID:
306 306
                     $out[] = new SortClause\ContentId($direction);
307 307
                     break;
Please login to merge, or discard this patch.
Core/Matcher/UrlWildcardMatcher.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -93,7 +93,7 @@
 block discarded – undo
93 93
                 // return unique contents
94 94
                 $urlWildcard = $this->repository->getURLWildcardService()->load($urlId);
95 95
                 $urls[$urlWildcard->id] = $urlWildcard;
96
-            } catch(NotFoundException $e) {
96
+            } catch (NotFoundException $e) {
97 97
                 if (!$tolerateMisses) {
98 98
                     throw $e;
99 99
                 }
Please login to merge, or discard this patch.
Core/Matcher/UrlAliasMatcher.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -108,7 +108,7 @@  discard block
 block discarded – undo
108 108
                 // return unique items
109 109
                 $UrlAlias = $this->repository->getUrlAliasService()->load($urlId);
110 110
                 $urls[$UrlAlias->id] = $UrlAlias;
111
-            } catch(NotFoundException $e) {
111
+            } catch (NotFoundException $e) {
112 112
                 if (!$tolerateMisses) {
113 113
                     throw $e;
114 114
                 }
@@ -133,7 +133,7 @@  discard block
 block discarded – undo
133 133
                 // return unique contents
134 134
                 $UrlAlias = $this->repository->getUrlAliasService()->lookup($url);
135 135
                 $urls[$UrlAlias->id] = $UrlAlias;
136
-            } catch(NotFoundException $e) {
136
+            } catch (NotFoundException $e) {
137 137
                 if (!$tolerateMisses) {
138 138
                     throw $e;
139 139
                 }
@@ -173,7 +173,7 @@  discard block
 block discarded – undo
173 173
                         $urls[$UrlAlias->id] = $UrlAlias;
174 174
                     }
175 175
                 }
176
-            } catch(NotFoundException $e) {
176
+            } catch (NotFoundException $e) {
177 177
                 if (!$tolerateMisses) {
178 178
                     throw $e;
179 179
                 }
Please login to merge, or discard this patch.
Core/FieldHandler/EzMatrix.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -65,11 +65,11 @@
 block discarded – undo
65 65
         $data = array();
66 66
 
67 67
         if ($this->usingLegacyFieldType()) {
68
-            foreach($fieldValue->rows as $row) {
68
+            foreach ($fieldValue->rows as $row) {
69 69
                 $data[] = $row->toArray();
70 70
             }
71 71
         } else {
72
-            foreach($fieldValue->getRows() as $row) {
72
+            foreach ($fieldValue->getRows() as $row) {
73 73
                 $data[] = $row->getCells();
74 74
             }
75 75
         }
Please login to merge, or discard this patch.
Command/ResumeCommand.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -99,7 +99,7 @@  discard block
 block discarded – undo
99 99
         $forcedRefs = array();
100 100
         if ($input->getOption('set-reference') /*&& !$input->getOption('separate-process')*/) {
101 101
             $refResolver = $this->getContainer()->get('ez_migration_bundle.reference_resolver.customreference');
102
-            foreach($input->getOption('set-reference') as $refSpec) {
102
+            foreach ($input->getOption('set-reference') as $refSpec) {
103 103
                 $ref = explode(':', $refSpec, 2);
104 104
                 if (count($ref) < 2 || $ref[0] === '') {
105 105
                     throw new MigrationBundleException("Invalid reference specification: '$refSpec'");
@@ -111,7 +111,7 @@  discard block
 block discarded – undo
111 111
         $executed = 0;
112 112
         $failed = 0;
113 113
 
114
-        foreach($suspendedMigrations as $suspendedMigration) {
114
+        foreach ($suspendedMigrations as $suspendedMigration) {
115 115
             $output->writeln("<info>Resuming {$suspendedMigration->name}</info>");
116 116
 
117 117
             try {
@@ -131,7 +131,7 @@  discard block
 block discarded – undo
131 131
 
132 132
         $time = microtime(true) - $start;
133 133
         $output->writeln("Resumed $executed migrations, failed $failed");
134
-        $output->writeln("Time taken: ".sprintf('%.3f', $time)." secs, memory: ".sprintf('%.2f', (memory_get_peak_usage(true) / 1000000)). ' MB');
134
+        $output->writeln("Time taken: " . sprintf('%.3f', $time) . " secs, memory: " . sprintf('%.2f', (memory_get_peak_usage(true) / 1000000)) . ' MB');
135 135
 
136 136
         if ($failed) {
137 137
             return 2;
Please login to merge, or discard this patch.
Command/MassMigrateCommand.php 1 patch
Spacing   +15 added lines, -15 removed lines patch added patch discarded remove patch
@@ -133,7 +133,7 @@  discard block
 block discarded – undo
133 133
 
134 134
         $processes = array();
135 135
         /** @var MigrationDefinition $migrationDefinition */
136
-        foreach($paths as $path => $count) {
136
+        foreach ($paths as $path => $count) {
137 137
             $this->writeln("<info>Queueing processing of: $path ($count migrations)</info>", OutputInterface::VERBOSITY_VERBOSE);
138 138
 
139 139
             $process = $builder
@@ -180,14 +180,14 @@  discard block
 block discarded – undo
180 180
         }
181 181
 
182 182
         $missed = $total - $this->migrationsDone[Migration::STATUS_DONE] - $this->migrationsDone[Migration::STATUS_FAILED] - $this->migrationsDone[Migration::STATUS_SKIPPED];
183
-        $this->writeln("\nExecuted ".$this->migrationsDone[Migration::STATUS_DONE].' migrations'.
184
-            ', failed '.$this->migrationsDone[Migration::STATUS_FAILED].
185
-            ', skipped '.$this->migrationsDone[Migration::STATUS_SKIPPED].
183
+        $this->writeln("\nExecuted " . $this->migrationsDone[Migration::STATUS_DONE] . ' migrations' .
184
+            ', failed ' . $this->migrationsDone[Migration::STATUS_FAILED] .
185
+            ', skipped ' . $this->migrationsDone[Migration::STATUS_SKIPPED] .
186 186
             ($missed ? ", missed $missed" : ''));
187 187
 
188 188
         $time = microtime(true) - $start;
189 189
         // since we use subprocesses, we can not measure max memory used
190
-        $this->writeln("<info>Time taken: ".sprintf('%.3f', $time)." secs</info>");
190
+        $this->writeln("<info>Time taken: " . sprintf('%.3f', $time) . " secs</info>");
191 191
 
192 192
         return $subprocessesFailed + $this->migrationsDone[Migration::STATUS_FAILED] + $missed;
193 193
     }
@@ -212,7 +212,7 @@  discard block
 block discarded – undo
212 212
                 $prefix = array($php);
213 213
 
214 214
                 if ($input->getOption('child-process-php-ini-config')) {
215
-                    foreach($input->getOption('child-process-php-ini-config') as $iniSpec) {
215
+                    foreach ($input->getOption('child-process-php-ini-config') as $iniSpec) {
216 216
                         $ini = explode(':', $iniSpec, 2);
217 217
                         if (count($ini) < 2 || $ini[0] === '') {
218 218
                             throw new MigrationBundleException("Invalid php ini specification: '$iniSpec'");
@@ -241,7 +241,7 @@  discard block
 block discarded – undo
241 241
         foreach ($toExecute as  $name => $migrationDefinition) {
242 242
             // let's skip migrations that we know are invalid - user was warned and he decided to proceed anyway
243 243
             if ($migrationDefinition->status == MigrationDefinition::STATUS_INVALID) {
244
-                $this->writeln("<comment>Skipping migration (invalid definition?) Path: ".$migrationDefinition->path."</comment>", self::$VERBOSITY_CHILD);
244
+                $this->writeln("<comment>Skipping migration (invalid definition?) Path: " . $migrationDefinition->path . "</comment>", self::$VERBOSITY_CHILD);
245 245
                 $skipped++;
246 246
                 continue;
247 247
             }
@@ -281,7 +281,7 @@  discard block
 block discarded – undo
281 281
                     $this->executeMigrationInProcess($migrationDefinition, $force, $migrationService, $input);
282 282
 
283 283
                     $executed++;
284
-                } catch(\Exception $e) {
284
+                } catch (\Exception $e) {
285 285
                     $failed++;
286 286
 
287 287
                     $errorMessage = $e->getMessage();
@@ -314,7 +314,7 @@  discard block
 block discarded – undo
314 314
      * @param string $buffer
315 315
      * @param null|\Symfony\Component\Process\Process $process
316 316
      */
317
-    public function onChildProcessOutput($type, $buffer, $process=null)
317
+    public function onChildProcessOutput($type, $buffer, $process = null)
318 318
     {
319 319
         $lines = explode("\n", trim($buffer));
320 320
 
@@ -332,7 +332,7 @@  discard block
 block discarded – undo
332 332
 
333 333
             // we tag the output with the id of the child process
334 334
             if (trim($line) !== '') {
335
-                $msg = '[' . ($process ? $process->getPid() : ''). '] ' . trim($line);
335
+                $msg = '[' . ($process ? $process->getPid() : '') . '] ' . trim($line);
336 336
                 if ($type == 'err') {
337 337
                     $this->writeErrorln($msg, OutputInterface::VERBOSITY_QUIET, OutputInterface::OUTPUT_RAW);
338 338
                 } else {
@@ -366,7 +366,7 @@  discard block
 block discarded – undo
366 366
 
367 367
         // filter away all migrations except 'to do' ones
368 368
         $toExecute = array();
369
-        foreach($migrationDefinitions as $name => $migrationDefinition) {
369
+        foreach ($migrationDefinitions as $name => $migrationDefinition) {
370 370
             if (!isset($migrations[$name]) || (($migration = $migrations[$name]) && in_array($migration->status, $allowedStatuses))) {
371 371
                 $toExecute[$name] = $isChild ? $migrationService->parseMigrationDefinition($migrationDefinition) : $migrationDefinition;
372 372
             }
@@ -408,7 +408,7 @@  discard block
 block discarded – undo
408 408
     {
409 409
         $output->writeln('Found ' . count($toExecute) . ' migrations in ' . count($paths) . ' directories');
410 410
         $output->writeln('In the same directories, migrations previously executed: ' . $this->migrationsAlreadyDone[Migration::STATUS_DONE] .
411
-            ', failed: ' . $this->migrationsAlreadyDone[Migration::STATUS_FAILED] . ', skipped: '. $this->migrationsAlreadyDone[Migration::STATUS_SKIPPED]);
411
+            ', failed: ' . $this->migrationsAlreadyDone[Migration::STATUS_FAILED] . ', skipped: ' . $this->migrationsAlreadyDone[Migration::STATUS_SKIPPED]);
412 412
         if ($this->migrationsAlreadyDone[Migration::STATUS_STARTED]) {
413 413
             $output->writeln('<info>In the same directories, migrations currently executing: ' . $this->migrationsAlreadyDone[Migration::STATUS_STARTED] . '</info>');
414 414
         }
@@ -421,7 +421,7 @@  discard block
 block discarded – undo
421 421
     protected function groupMigrationsByPath($toExecute)
422 422
     {
423 423
         $paths = array();
424
-        foreach($toExecute as $name => $migrationDefinition) {
424
+        foreach ($toExecute as $name => $migrationDefinition) {
425 425
             $path = dirname($migrationDefinition->path);
426 426
             if (!isset($paths[$path])) {
427 427
                 $paths[$path] = 1;
@@ -498,12 +498,12 @@  discard block
 block discarded – undo
498 498
             $builderArgs[] = '--separate-process';
499 499
         }
500 500
         if ($input->getOption('set-reference')) {
501
-            foreach($input->getOption('set-reference') as $refSpec) {
501
+            foreach ($input->getOption('set-reference') as $refSpec) {
502 502
                 $builderArgs[] = '--set-reference=' . $refSpec;
503 503
             }
504 504
         }
505 505
         if ($input->getOption('child-process-php-ini-config')) {
506
-            foreach($input->getOption('child-process-php-ini-config') as $iniSpec) {
506
+            foreach ($input->getOption('child-process-php-ini-config') as $iniSpec) {
507 507
                 $builderArgs[] = '--child-process-php-ini-config=' . $iniSpec;
508 508
             }
509 509
         }
Please login to merge, or discard this patch.
Command/MigrateCommand.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -124,7 +124,7 @@  discard block
 block discarded – undo
124 124
                 $prefix = array($php);
125 125
 
126 126
                 if ($input->getOption('child-process-php-ini-config')) {
127
-                    foreach($input->getOption('child-process-php-ini-config') as $iniSpec) {
127
+                    foreach ($input->getOption('child-process-php-ini-config') as $iniSpec) {
128 128
                         $ini = explode(':', $iniSpec, 2);
129 129
                         if (count($ini) < 2 || $ini[0] === '') {
130 130
                             throw new MigrationBundleException("Invalid php ini specification: '$iniSpec'");
@@ -150,7 +150,7 @@  discard block
 block discarded – undo
150 150
 
151 151
         if ($input->getOption('set-reference') && !$input->getOption('separate-process')) {
152 152
             $refResolver = $this->getContainer()->get('ez_migration_bundle.reference_resolver.customreference');
153
-            foreach($input->getOption('set-reference') as $refSpec) {
153
+            foreach ($input->getOption('set-reference') as $refSpec) {
154 154
                 $ref = explode(':', $refSpec, 2);
155 155
                 if (count($ref) < 2 || $ref[0] === '') {
156 156
                     throw new MigrationBundleException("Invalid reference specification: '$refSpec'");
@@ -250,9 +250,9 @@  discard block
 block discarded – undo
250 250
         $time = microtime(true) - $start;
251 251
         if ($input->getOption('separate-process')) {
252 252
             // in case of using subprocesses, we can not measure max memory used
253
-            $this->writeln("<info>Time taken: ".sprintf('%.3f', $time)." secs</info>");
253
+            $this->writeln("<info>Time taken: " . sprintf('%.3f', $time) . " secs</info>");
254 254
         } else {
255
-            $this->writeln("<info>Time taken: ".sprintf('%.3f', $time)." secs, memory: ".sprintf('%.2f', (memory_get_peak_usage(true) / 1000000)). ' MB</info>');
255
+            $this->writeln("<info>Time taken: " . sprintf('%.3f', $time) . " secs, memory: " . sprintf('%.2f', (memory_get_peak_usage(true) / 1000000)) . ' MB</info>');
256 256
         }
257 257
 
258 258
         return $failed;
@@ -484,7 +484,7 @@  discard block
 block discarded – undo
484 484
             $builderArgs[] = '--no-debug';
485 485
         }
486 486
         if ($input->getOption('siteaccess')) {
487
-            $builderArgs[] = '--siteaccess='.$input->getOption('siteaccess');
487
+            $builderArgs[] = '--siteaccess=' . $input->getOption('siteaccess');
488 488
         }
489 489
         switch ($this->verbosity) {
490 490
             case OutputInterface::VERBOSITY_VERBOSE:
@@ -516,7 +516,7 @@  discard block
 block discarded – undo
516 516
             $builderArgs[] = '--no-transactions';
517 517
         }
518 518
         if ($input->getOption('set-reference')) {
519
-            foreach($input->getOption('set-reference') as $refSpec) {
519
+            foreach ($input->getOption('set-reference') as $refSpec) {
520 520
                 $builderArgs[] = '--set-reference=' . $refSpec;
521 521
             }
522 522
         }
Please login to merge, or discard this patch.