@@ -46,7 +46,7 @@ discard block |
||
| 46 | 46 | |
| 47 | 47 | public function addExecutor(ExecutorInterface $executor) |
| 48 | 48 | { |
| 49 | - foreach($executor->supportedTypes() as $type) { |
|
| 49 | + foreach ($executor->supportedTypes() as $type) { |
|
| 50 | 50 | $this->executors[$type] = $executor; |
| 51 | 51 | } |
| 52 | 52 | } |
@@ -61,8 +61,8 @@ discard block |
||
| 61 | 61 | { |
| 62 | 62 | // we try to be flexible in file types we support, and the same time avoid loading all files in a directory |
| 63 | 63 | $handledDefinitions = array(); |
| 64 | - foreach($this->loader->listAvailableDefinitions($paths) as $migrationName => $definitionPath) { |
|
| 65 | - foreach($this->DefinitionParsers as $definitionParser) { |
|
| 64 | + foreach ($this->loader->listAvailableDefinitions($paths) as $migrationName => $definitionPath) { |
|
| 65 | + foreach ($this->DefinitionParsers as $definitionParser) { |
|
| 66 | 66 | if ($definitionParser->supports($migrationName)) { |
| 67 | 67 | $handledDefinitions[] = $definitionPath; |
| 68 | 68 | } |
@@ -123,13 +123,13 @@ discard block |
||
| 123 | 123 | */ |
| 124 | 124 | public function parseMigrationDefinition(MigrationDefinition $migrationDefinition) |
| 125 | 125 | { |
| 126 | - foreach($this->DefinitionParsers as $definitionParser) { |
|
| 126 | + foreach ($this->DefinitionParsers as $definitionParser) { |
|
| 127 | 127 | if ($definitionParser->supports($migrationDefinition->name)) { |
| 128 | 128 | // parse the source file |
| 129 | 129 | $migrationDefinition = $definitionParser->parseMigrationDefinition($migrationDefinition); |
| 130 | 130 | |
| 131 | 131 | // and make sure we know how to handle all steps |
| 132 | - foreach($migrationDefinition->steps as $step) { |
|
| 132 | + foreach ($migrationDefinition->steps as $step) { |
|
| 133 | 133 | if (!isset($this->executors[$step->type])) { |
| 134 | 134 | return new MigrationDefinition( |
| 135 | 135 | $migrationDefinition->name, |
@@ -185,7 +185,7 @@ discard block |
||
| 185 | 185 | |
| 186 | 186 | $i = 1; |
| 187 | 187 | |
| 188 | - foreach($migrationDefinition->steps as $step) { |
|
| 188 | + foreach ($migrationDefinition->steps as $step) { |
|
| 189 | 189 | // we validated the fact that we have a good executor at parsing time |
| 190 | 190 | $executor = $this->executors[$step->type]; |
| 191 | 191 | $executor->execute($step); |
@@ -207,19 +207,19 @@ discard block |
||
| 207 | 207 | if ($useTransaction) { |
| 208 | 208 | try { |
| 209 | 209 | $this->repository->commit(); |
| 210 | - } catch(\RuntimeException $e) { |
|
| 210 | + } catch (\RuntimeException $e) { |
|
| 211 | 211 | // at present time, the ez5 repo does not support nested commits. So if some migration step has committed |
| 212 | 212 | // already, we get an exception a this point. Extremely poor design, but what can we do ? |
| 213 | 213 | /// @todo log warning |
| 214 | 214 | } |
| 215 | 215 | } |
| 216 | 216 | |
| 217 | - } catch(\Exception $e) { |
|
| 217 | + } catch (\Exception $e) { |
|
| 218 | 218 | |
| 219 | 219 | if ($useTransaction) { |
| 220 | 220 | try { |
| 221 | 221 | $this->repository->rollBack(); |
| 222 | - } catch(\RuntimeException $e2) { |
|
| 222 | + } catch (\RuntimeException $e2) { |
|
| 223 | 223 | // at present time, the ez5 repo does not support nested commits. So if some migration step has committed |
| 224 | 224 | // already, we get an exception a this point. Extremely poor design, but what can we do ? |
| 225 | 225 | /// @todo log error |