Completed
Pull Request — master (#60)
by Jérôme
07:11
created
Core/Executor/UserManager.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -151,7 +151,7 @@  discard block
 block discarded – undo
151 151
                 if ($this->referenceResolver->isReference($userId)) {
152 152
                     $userId = $this->referenceResolver->getReferenceValue($userId);
153 153
                 }
154
-                array_push($usersToDelete,$userService->loadUser($userId));
154
+                array_push($usersToDelete, $userService->loadUser($userId));
155 155
             }
156 156
         }
157 157
 
@@ -160,7 +160,7 @@  discard block
 block discarded – undo
160 160
                 $this->dsl['email'] = array($this->dsl['email']);
161 161
             }
162 162
             foreach ($this->dsl['email'] as $email) {
163
-                $usersToDelete = array_merge($usersToDelete,$userService->loadUsersByEmail($email));
163
+                $usersToDelete = array_merge($usersToDelete, $userService->loadUsersByEmail($email));
164 164
             }
165 165
         }
166 166
 
@@ -169,11 +169,11 @@  discard block
 block discarded – undo
169 169
                 $this->dsl['username'] = array($this->dsl['username']);
170 170
             }
171 171
             foreach ($this->dsl['username'] as $username) {
172
-                array_push($usersToDelete,$userService->loadUserByLogin($username));
172
+                array_push($usersToDelete, $userService->loadUserByLogin($username));
173 173
             }
174 174
         }
175 175
 
176
-        foreach($usersToDelete as $user) {
176
+        foreach ($usersToDelete as $user) {
177 177
             $userService->deleteUser($user);
178 178
         }
179 179
     }
Please login to merge, or discard this patch.
Tests/phpunit/0_CollectionsTest.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,6 +1,6 @@
 block discarded – undo
1 1
 <?php
2 2
 
3
-include_once(__DIR__.'/CommandTest.php');
3
+include_once(__DIR__ . '/CommandTest.php');
4 4
 
5 5
 use Kaliop\eZMigrationBundle\API\Collection\MigrationStepsCollection;
6 6
 use Kaliop\eZMigrationBundle\API\Value\MigrationStep;
Please login to merge, or discard this patch.
Tests/phpunit/1_GenerateTest.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -1,6 +1,6 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 
3
-include_once(__DIR__.'/CommandTest.php');
3
+include_once(__DIR__ . '/CommandTest.php');
4 4
 
5 5
 use Symfony\Component\Console\Input\ArrayInput;
6 6
 
@@ -70,6 +70,6 @@  discard block
 block discarded – undo
70 70
         $exitCode = $this->app->run($input, $this->output);
71 71
         $output = $this->fetchOutput();
72 72
         $this->assertSame(0, $exitCode, 'CLI Command failed. Output: ' . $output);
73
-        $this->assertRegExp('?\| ' . basename($filePath) . ' +\| not executed +\|?', $output );
73
+        $this->assertRegExp('?\| ' . basename($filePath) . ' +\| not executed +\|?', $output);
74 74
     }
75 75
 }
Please login to merge, or discard this patch.
Core/MigrationService.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -46,7 +46,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
Please login to merge, or discard this patch.