@@ -150,7 +150,7 @@ discard block |
||
150 | 150 | } |
151 | 151 | |
152 | 152 | // allow to generate migrations for many entities |
153 | - if (strpos($matchValue, ',') !== false ) { |
|
153 | + if (strpos($matchValue, ',') !== false) { |
|
154 | 154 | $matchValue = explode(',', $matchValue); |
155 | 155 | } |
156 | 156 | |
@@ -260,7 +260,7 @@ discard block |
||
260 | 260 | { |
261 | 261 | $migrationService = $this->getMigrationService(); |
262 | 262 | $executors = $migrationService->listExecutors(); |
263 | - foreach($executors as $key => $name) { |
|
263 | + foreach ($executors as $key => $name) { |
|
264 | 264 | $executor = $migrationService->getExecutor($name); |
265 | 265 | if (!$executor instanceof MigrationGeneratorInterface) { |
266 | 266 | unset($executors[$key]); |
@@ -234,11 +234,11 @@ |
||
234 | 234 | if ($mode != 'delete') { |
235 | 235 | $names = array(); |
236 | 236 | $descriptions = array(); |
237 | - foreach($objectStateGroup->languageCodes as $languageCode) { |
|
238 | - $names[$languageCode] = $objectStateGroup->getName($languageCode); |
|
237 | + foreach ($objectStateGroup->languageCodes as $languageCode) { |
|
238 | + $names[$languageCode] = $objectStateGroup->getName($languageCode); |
|
239 | 239 | } |
240 | - foreach($objectStateGroup->languageCodes as $languageCode) { |
|
241 | - $descriptions[$languageCode] = $objectStateGroup->getDescription($languageCode); |
|
240 | + foreach ($objectStateGroup->languageCodes as $languageCode) { |
|
241 | + $descriptions[$languageCode] = $objectStateGroup->getDescription($languageCode); |
|
242 | 242 | } |
243 | 243 | $groupData = array_merge( |
244 | 244 | $groupData, |
@@ -248,11 +248,11 @@ |
||
248 | 248 | if ($mode != 'delete') { |
249 | 249 | $names = array(); |
250 | 250 | $descriptions = array(); |
251 | - foreach($objectState->languageCodes as $languageCode) { |
|
252 | - $names[$languageCode] = $objectState->getName($languageCode); |
|
251 | + foreach ($objectState->languageCodes as $languageCode) { |
|
252 | + $names[$languageCode] = $objectState->getName($languageCode); |
|
253 | 253 | } |
254 | - foreach($objectState->languageCodes as $languageCode) { |
|
255 | - $descriptions[$languageCode] = $objectState->getDescription($languageCode); |
|
254 | + foreach ($objectState->languageCodes as $languageCode) { |
|
255 | + $descriptions[$languageCode] = $objectState->getDescription($languageCode); |
|
256 | 256 | } |
257 | 257 | $groupData = array_merge( |
258 | 258 | $groupData, |
@@ -81,7 +81,7 @@ discard block |
||
81 | 81 | |
82 | 82 | switch ($key) { |
83 | 83 | case self::MATCH_AND: |
84 | - foreach($values as $subCriterion) { |
|
84 | + foreach ($values as $subCriterion) { |
|
85 | 85 | $value = $this->match($subCriterion); |
86 | 86 | if (!reset($value)) { |
87 | 87 | return $value; |
@@ -90,7 +90,7 @@ discard block |
||
90 | 90 | return array(true); |
91 | 91 | |
92 | 92 | case self::MATCH_OR: |
93 | - foreach($values as $subCriterion) { |
|
93 | + foreach ($values as $subCriterion) { |
|
94 | 94 | $value = $this->match($subCriterion); |
95 | 95 | if (reset($value)) { |
96 | 96 | return $value; |
@@ -35,7 +35,7 @@ discard block |
||
35 | 35 | public function storeCurrentContext($migrationName) |
36 | 36 | { |
37 | 37 | $context = array(); |
38 | - foreach($this->providers as $label => $provider) { |
|
38 | + foreach ($this->providers as $label => $provider) { |
|
39 | 39 | $context[$label] = $provider->getCurrentContext($migrationName); |
40 | 40 | } |
41 | 41 | |
@@ -52,7 +52,7 @@ discard block |
||
52 | 52 | if (!is_array($context)) { |
53 | 53 | throw new \Exception("No execution context found associated with migration '$migrationName'"); |
54 | 54 | } |
55 | - foreach($this->providers as $label => $provider) { |
|
55 | + foreach ($this->providers as $label => $provider) { |
|
56 | 56 | if (isset($context[$label])) { |
57 | 57 | $provider->restoreContext($migrationName, $context[$label]); |
58 | 58 | } |
@@ -95,7 +95,7 @@ |
||
95 | 95 | |
96 | 96 | $output->writeln('<info>Migration: ' . $migration->name . '</info>'); |
97 | 97 | $output->writeln('Status: ' . $status); |
98 | - $output->writeln('Executed on: <info>' . ($migration->executionDate != null ? date("Y-m-d H:i:s", $migration->executionDate) : '--'). '</info>'); |
|
98 | + $output->writeln('Executed on: <info>' . ($migration->executionDate != null ? date("Y-m-d H:i:s", $migration->executionDate) : '--') . '</info>'); |
|
99 | 99 | $output->writeln('Execution notes: <info>' . $migration->executionError . '</info>'); |
100 | 100 | |
101 | 101 | if ($migration->status == Migration::STATUS_SUSPENDED) { |
@@ -58,26 +58,26 @@ |
||
58 | 58 | { |
59 | 59 | $format = array(); |
60 | 60 | if (0 != $dateInterval->y) { |
61 | - $format[] = $dateInterval->y.' years'; |
|
61 | + $format[] = $dateInterval->y . ' years'; |
|
62 | 62 | } |
63 | 63 | if (0 != $dateInterval->m) { |
64 | - $format[] = $dateInterval->m.' months'; |
|
64 | + $format[] = $dateInterval->m . ' months'; |
|
65 | 65 | } |
66 | 66 | if (0 != $dateInterval->d) { |
67 | - $format[] = $dateInterval->d.' days'; |
|
67 | + $format[] = $dateInterval->d . ' days'; |
|
68 | 68 | } |
69 | 69 | //if (0 < $dateInterval->h || 0 < $dateInterval->i || 0 < $dateInterval->s) { |
70 | 70 | // $format .= 'T'; |
71 | 71 | //} |
72 | 72 | if (0 != $dateInterval->h) { |
73 | - $format[] = $dateInterval->h.' hours'; |
|
73 | + $format[] = $dateInterval->h . ' hours'; |
|
74 | 74 | } |
75 | 75 | if (0 != $dateInterval->i) { |
76 | - $format[] = $dateInterval->i.' minutes'; |
|
76 | + $format[] = $dateInterval->i . ' minutes'; |
|
77 | 77 | } |
78 | 78 | if (0 != $dateInterval->s) { |
79 | - $format[] = $dateInterval->s.' seconds'; |
|
79 | + $format[] = $dateInterval->s . ' seconds'; |
|
80 | 80 | } |
81 | - return implode( ', ', $format); |
|
81 | + return implode(', ', $format); |
|
82 | 82 | } |
83 | 83 | } |
@@ -57,7 +57,7 @@ discard block |
||
57 | 57 | if (empty($paths)) { |
58 | 58 | $paths = array(); |
59 | 59 | /** @var $bundle \Symfony\Component\HttpKernel\Bundle\BundleInterface */ |
60 | - foreach($this->kernel->getBundles() as $bundle) |
|
60 | + foreach ($this->kernel->getBundles() as $bundle) |
|
61 | 61 | { |
62 | 62 | $path = $bundle->getPath() . "/" . $this->versionDirectory; |
63 | 63 | if (is_dir($path)) { |
@@ -67,7 +67,7 @@ discard block |
||
67 | 67 | } |
68 | 68 | |
69 | 69 | $definitions = array(); |
70 | - foreach($paths as $path) { |
|
70 | + foreach ($paths as $path) { |
|
71 | 71 | if (is_file($path)) { |
72 | 72 | $definitions[basename($path)] = $returnFilename ? $path : new MigrationDefinition( |
73 | 73 | basename($path), |
@@ -60,8 +60,7 @@ |
||
60 | 60 | } |
61 | 61 | } |
62 | 62 | } |
63 | - } |
|
64 | - else { |
|
63 | + } else { |
|
65 | 64 | throw new \Exception("Path '$path' is neither a file nor directory"); |
66 | 65 | } |
67 | 66 | } |
@@ -28,7 +28,7 @@ discard block |
||
28 | 28 | $currentProcesses = array_splice($processesQueue, 0, $maxParallel); |
29 | 29 | // start the initial stack of processes |
30 | 30 | foreach ($currentProcesses as $process) { |
31 | - $process->start(function ($type, $buffer) use ($callback, $process) { |
|
31 | + $process->start(function($type, $buffer) use ($callback, $process) { |
|
32 | 32 | if ($callback) { |
33 | 33 | $callback($type, $buffer, $process); |
34 | 34 | } |
@@ -44,7 +44,7 @@ discard block |
||
44 | 44 | // directly add and start new process after the previous finished |
45 | 45 | if (count($processesQueue) > 0) { |
46 | 46 | $nextProcess = array_shift($processesQueue); |
47 | - $nextProcess->start(function ($type, $buffer) use ($callback, $nextProcess) { |
|
47 | + $nextProcess->start(function($type, $buffer) use ($callback, $nextProcess) { |
|
48 | 48 | if ($callback) { |
49 | 49 | $callback($type, $buffer, $nextProcess); |
50 | 50 | } |