Completed
Push — master ( e552c5...5b1e94 )
by Gaetano
07:24
created
Command/MigrateCommand.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -61,7 +61,7 @@  discard block
 block discarded – undo
61 61
     {
62 62
         $migrationsService = $this->getMigrationService();
63 63
 
64
-        $migrationDefinitions = $migrationsService->getMigrationsDefinitions($input->getOption('path')) ;
64
+        $migrationDefinitions = $migrationsService->getMigrationsDefinitions($input->getOption('path'));
65 65
         $migrations = $migrationsService->getMigrations();
66 66
 
67 67
         if (!count($migrationDefinitions)) {
@@ -71,7 +71,7 @@  discard block
 block discarded – undo
71 71
 
72 72
         // filter away all migrations except 'to do' ones
73 73
         $toExecute = array();
74
-        foreach($migrationDefinitions as $name => $migrationDefinition) {
74
+        foreach ($migrationDefinitions as $name => $migrationDefinition) {
75 75
             if (!isset($migrations[$name]) || (($migration = $migrations[$name]) && $migration->status == Migration::STATUS_TODO)) {
76 76
                 $toExecute[$name] = $migrationsService->parseMigrationDefinition($migrationDefinition);
77 77
             }
@@ -88,7 +88,7 @@  discard block
 block discarded – undo
88 88
 
89 89
         $data = array();
90 90
         $i = 1;
91
-        foreach($toExecute as $name => $migrationDefinition) {
91
+        foreach ($toExecute as $name => $migrationDefinition) {
92 92
             $notes = '';
93 93
             if ($migrationDefinition->status != MigrationDefinition::STATUS_PARSED) {
94 94
                 $notes = '<error>' . $migrationDefinition->parsingError . '</error>';
@@ -123,7 +123,7 @@  discard block
 block discarded – undo
123 123
             $output->writeln("=============================================\n");
124 124
         }
125 125
 
126
-        foreach($toExecute as $name => $migrationDefinition) {
126
+        foreach ($toExecute as $name => $migrationDefinition) {
127 127
 
128 128
             // let's skip migrations that we know are invalid - user was warned and he decide to proceed anyway
129 129
             if ($migrationDefinition->status == MigrationDefinition::STATUS_INVALID) {
@@ -135,12 +135,12 @@  discard block
 block discarded – undo
135 135
 
136 136
             try {
137 137
                 $migrationsService->executeMigration($migrationDefinition);
138
-            } catch(\Exception $e) {
138
+            } catch (\Exception $e) {
139 139
                 if ($input->getOption('ignore-failures')) {
140
-                    $output->writeln("\n<error>Migration failed!".$e->getMessage()."</error>\n");
140
+                    $output->writeln("\n<error>Migration failed!" . $e->getMessage() . "</error>\n");
141 141
                     continue;
142 142
                 }
143
-                $output->writeln("\n<error>Migration aborted!".$e->getMessage()."</error>");
143
+                $output->writeln("\n<error>Migration aborted!" . $e->getMessage() . "</error>");
144 144
                 return 1;
145 145
             }
146 146
 
Please login to merge, or discard this patch.
Command/StatusCommand.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -41,7 +41,7 @@  discard block
 block discarded – undo
41 41
     {
42 42
         $migrationsService = $this->getMigrationService();
43 43
 
44
-        $migrationDefinitions = $migrationsService->getMigrationsDefinitions($input->getOption('path')) ;
44
+        $migrationDefinitions = $migrationsService->getMigrationsDefinitions($input->getOption('path'));
45 45
         $migrations = $migrationsService->getMigrations();
46 46
 
47 47
         if (!count($migrationDefinitions) && !count($migrations)) {
@@ -51,10 +51,10 @@  discard block
 block discarded – undo
51 51
 
52 52
         // create a unique ist of all migrations (coming from db) and definitions (coming from disk)
53 53
         $index = array();
54
-        foreach($migrationDefinitions as $migrationDefinition) {
54
+        foreach ($migrationDefinitions as $migrationDefinition) {
55 55
             $index[$migrationDefinition->name] = array('definition' => $migrationDefinition);
56 56
         }
57
-        foreach($migrations as $migration) {
57
+        foreach ($migrations as $migration) {
58 58
             if (isset($index[$migration->name])) {
59 59
                 $index[$migration->name]['migration'] = $migration;
60 60
             } else {
@@ -68,7 +68,7 @@  discard block
 block discarded – undo
68 68
                         {
69 69
                             $index[$migration->name]['definition'] = reset($migrationDefinitionCollection);
70 70
                         }
71
-                    } catch(\Exception $e) {
71
+                    } catch (\Exception $e) {
72 72
                         /// @todo one day we should be able to limit the kind of exceptions we have to catch here...
73 73
                     }
74 74
                 }
@@ -80,7 +80,7 @@  discard block
 block discarded – undo
80 80
 
81 81
         $data = array();
82 82
         $i = 1;
83
-        foreach($index as $name => $value) {
83
+        foreach ($index as $name => $value) {
84 84
             if (!isset($value['migration'])) {
85 85
                 $migrationDefinition = $migrationsService->parseMigrationDefinition($value['definition']);
86 86
                 $notes = '';
Please login to merge, or discard this patch.
Command/GenerateCommand.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -80,7 +80,7 @@  discard block
 block discarded – undo
80 80
         }
81 81
 
82 82
         $activeBundles = array();
83
-        foreach($this->getApplication()->getKernel()->getBundles() as $bundle)
83
+        foreach ($this->getApplication()->getKernel()->getBundles() as $bundle)
84 84
         {
85 85
             $activeBundles[] = $bundle->getName();
86 86
         }
@@ -155,7 +155,7 @@  discard block
 block discarded – undo
155 155
                     $className = 'Migration';
156 156
                 }
157 157
                 // Make sure that php class names are unique, not only migration definition file names
158
-                $existingMigrations = count(glob($migrationDirectory.'/*_' . $className .'*.php'));
158
+                $existingMigrations = count(glob($migrationDirectory . '/*_' . $className . '*.php'));
159 159
                 if ($existingMigrations) {
160 160
                     $className = $className . sprintf('%03d', $existingMigrations + 1);
161 161
                 }
@@ -201,7 +201,7 @@  discard block
 block discarded – undo
201 201
         if ($migrationType == 'role') {
202 202
             $code = $this->generateRoleTemplate($parameters['role']);
203 203
         } else {
204
-            $code = $this->getContainer()->get('twig')->render($this->thisBundle . ':MigrationTemplate:'.$template, $parameters);
204
+            $code = $this->getContainer()->get('twig')->render($this->thisBundle . ':MigrationTemplate:' . $template, $parameters);
205 205
         }
206 206
 
207 207
         file_put_contents($path, $code);
@@ -267,7 +267,7 @@  discard block
 block discarded – undo
267 267
         /** @var \eZ\Publish\API\Repository\SectionService $sectionService */
268 268
         $sectionService = $repository->getSectionService();
269 269
 
270
-        foreach($limitation->limitationValues as $value)
270
+        foreach ($limitation->limitationValues as $value)
271 271
         {
272 272
 
273 273
         }
Please login to merge, or discard this patch.
Command/MigrationCommand.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -44,7 +44,7 @@
 block discarded – undo
44 44
      */
45 45
     protected function execute(InputInterface $input, OutputInterface $output)
46 46
     {
47
-        if (/*! $input->getOption('add') &&*/ ! $input->getOption('delete')) {
47
+        if (/*! $input->getOption('add') &&*/ !$input->getOption('delete')) {
48 48
             throw new \InvalidArgumentException('You must specify whether you want to --delete the specified migration.');
49 49
         }
50 50
 
Please login to merge, or discard this patch.
Core/Executor/UserManager.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -132,7 +132,7 @@  discard block
 block discarded – undo
132 132
                 $this->dsl['user_id'] = array($this->dsl['user_id']);
133 133
             }
134 134
             foreach ($this->dsl['user_id'] as $id) {
135
-                array_push($usersToDelete,$userService->loadUser($id));
135
+                array_push($usersToDelete, $userService->loadUser($id));
136 136
             }
137 137
         }
138 138
         if (isset($this->dsl['email'])) {
@@ -140,7 +140,7 @@  discard block
 block discarded – undo
140 140
                 $this->dsl['email'] = array($this->dsl['email']);
141 141
             }
142 142
             foreach ($this->dsl['email'] as $email) {
143
-                $usersToDelete = array_merge($usersToDelete,$userService->loadUsersByEmail($email));
143
+                $usersToDelete = array_merge($usersToDelete, $userService->loadUsersByEmail($email));
144 144
             }
145 145
         }
146 146
         if (isset($this->dsl['username'])) {
@@ -148,11 +148,11 @@  discard block
 block discarded – undo
148 148
                 $this->dsl['username'] = array($this->dsl['username']);
149 149
             }
150 150
             foreach ($this->dsl['username'] as $username) {
151
-                array_push($usersToDelete,$userService->loadUserByLogin($username));
151
+                array_push($usersToDelete, $userService->loadUserByLogin($username));
152 152
             }
153 153
         }
154 154
 
155
-        foreach($usersToDelete as $user){
155
+        foreach ($usersToDelete as $user) {
156 156
             $userService->deleteUser($user);
157 157
         }
158 158
     }
Please login to merge, or discard this patch.
Core/Executor/TagManager.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -12,7 +12,7 @@
 block discarded – undo
12 12
 
13 13
     protected $tagService;
14 14
 
15
-    public function __construct(TagsService $tagService=null)
15
+    public function __construct(TagsService $tagService = null)
16 16
     {
17 17
         $this->tagService = $tagService;
18 18
     }
Please login to merge, or discard this patch.
Core/Executor/ContentManager.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -125,7 +125,7 @@  discard block
 block discarded – undo
125 125
         }
126 126
 
127 127
         $draft = $contentService->createContentDraft($contentInfo);
128
-        $contentService->updateContent($draft->versionInfo,$contentUpdateStruct);
128
+        $contentService->updateContent($draft->versionInfo, $contentUpdateStruct);
129 129
         $content = $contentService->publishVersion($draft->versionInfo);
130 130
 
131 131
         if (array_key_exists('new_remote_id', $this->dsl)) {
@@ -158,7 +158,7 @@  discard block
 block discarded – undo
158 158
 
159 159
         $contentService = $this->repository->getContentService();
160 160
 
161
-        if (isset($this->dsl['object_id'])){
161
+        if (isset($this->dsl['object_id'])) {
162 162
             if (!is_array($this->dsl['object_id'])) {
163 163
                 $this->dsl['object_id'] = array($this->dsl['object_id']);
164 164
             }
@@ -186,7 +186,7 @@  discard block
 block discarded – undo
186 186
      * @param ContentCreateStruct $createStruct
187 187
      * @param array $fields
188 188
      */
189
-    protected function setFields(ContentCreateStruct &$createStruct, array $fields)
189
+    protected function setFields(ContentCreateStruct & $createStruct, array $fields)
190 190
     {
191 191
         foreach ($fields as $field) {
192 192
             // each $field is one key value pair
@@ -214,7 +214,7 @@  discard block
 block discarded – undo
214 214
      * @param ContentUpdateStruct $updateStruct
215 215
      * @param array $fields
216 216
      */
217
-    protected function setFieldsToUpdate(ContentUpdateStruct &$updateStruct, array $fields, ContentType $contentType)
217
+    protected function setFieldsToUpdate(ContentUpdateStruct & $updateStruct, array $fields, ContentType $contentType)
218 218
     {
219 219
         foreach ($fields as $field) {
220 220
             // each $field is one key value pair
Please login to merge, or discard this patch.
Core/Executor/UserGroupManager.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -129,7 +129,7 @@
 block discarded – undo
129 129
             $groupIds = array($groupIds);
130 130
         }
131 131
 
132
-        foreach($groupIds as $groupId) {
132
+        foreach ($groupIds as $groupId) {
133 133
             $userGroup = $userService->loadUserGroup($groupId);
134 134
             $userService->deleteUserGroup($userGroup);
135 135
         }
Please login to merge, or discard this patch.
Core/Executor/LocationManager.php 1 patch
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -43,7 +43,7 @@
 block discarded – undo
43 43
             !isset($match['parent_location_id']) &&
44 44
             !isset($match['parent_location_remote_id'])
45 45
         ) {
46
-          throw new \Exception('Either the ID or remote ID of a content, the ID or remote ID of a location or the id or remote ID
46
+            throw new \Exception('Either the ID or remote ID of a content, the ID or remote ID of a location or the id or remote ID
47 47
           of the parent location of the contents you want to create a new location are required to create a new location.');
48 48
         }
49 49
 
Please login to merge, or discard this patch.