Completed
Push — master ( f932c1...98fbad )
by Gaetano
09:59
created
Core/Executor/ContentTypeManager.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -249,7 +249,7 @@  discard block
 block discarded – undo
249 249
                 }
250 250
 
251 251
                 // Add new attributes
252
-                foreach($newFieldDefinitions as $newFieldDefinition) {
252
+                foreach ($newFieldDefinitions as $newFieldDefinition) {
253 253
                     if ($newFieldDefinition->position == 0) {
254 254
                         $newFieldDefinition->position = ++$maxFieldDefinitionPos;
255 255
                     }
@@ -370,7 +370,7 @@  discard block
 block discarded – undo
370 370
                     break;
371 371
                 case 'content_type_groups_ids':
372 372
                     $value = [];
373
-                    foreach($contentType->contentTypeGroups as $existingGroup) {
373
+                    foreach ($contentType->contentTypeGroups as $existingGroup) {
374 374
                         $value[] = $existingGroup->id;
375 375
                     }
376 376
                     break;
@@ -766,7 +766,7 @@  discard block
 block discarded – undo
766 766
         $contentTypeGroup = $this->contentTypeGroupMatcher->matchOneByKey($contentTypeGroupId);
767 767
         $contentTypeGroupId = $contentTypeGroup->id;
768 768
 
769
-        foreach($contentType->contentTypeGroups as $existingGroup) {
769
+        foreach ($contentType->contentTypeGroups as $existingGroup) {
770 770
             if ($existingGroup->id === $contentTypeGroupId) {
771 771
                 return;
772 772
             }
@@ -782,7 +782,7 @@  discard block
 block discarded – undo
782 782
         $contentTypeGroup = $this->contentTypeGroupMatcher->matchOneByKey($contentTypeGroupId);
783 783
         $contentTypeGroupId = $contentTypeGroup->id;
784 784
 
785
-        foreach($contentType->contentTypeGroups as $existingGroup) {
785
+        foreach ($contentType->contentTypeGroups as $existingGroup) {
786 786
             if ($existingGroup->id === $contentTypeGroupId) {
787 787
                 $contentTypeService = $this->repository->getContentTypeService();
788 788
                 $contentTypeService->unassignContentTypeGroup($contentType, $contentTypeGroup);
Please login to merge, or discard this patch.
Core/Executor/ContentManager.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -520,7 +520,7 @@  discard block
 block discarded – undo
520 520
                     $locations = $locationService->loadLocations($content->contentInfo);
521 521
                     if (count($locations) > 1) {
522 522
                         $otherParentLocations = array();
523
-                        foreach($locations as $otherLocation) {
523
+                        foreach ($locations as $otherLocation) {
524 524
                             if ($otherLocation->id != $location->id) {
525 525
                                 $otherParentLocations[] = $otherLocation->parentLocationId;
526 526
                             }
@@ -696,7 +696,7 @@  discard block
 block discarded – undo
696 696
             },
697 697
             array_filter(
698 698
                 $this->repository->getContentLanguageService()->loadLanguages(),
699
-                function ($language) {
699
+                function($language) {
700 700
                     return $language->enabled;
701 701
                 }
702 702
             )
Please login to merge, or discard this patch.
Core/ReferenceResolver/LoopResolver.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -35,7 +35,7 @@
 block discarded – undo
35 35
      */
36 36
     public function getReferenceValue($identifier)
37 37
     {
38
-        switch(substr($identifier, 5)) {
38
+        switch (substr($identifier, 5)) {
39 39
             case 'iteration':
40 40
                 $current = end($this->stack);
41 41
                 return $current['step'];
Please login to merge, or discard this patch.
Core/Executor/LoopExecutor.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -80,7 +80,7 @@  discard block
 block discarded – undo
80 80
                     $subStep = new MigrationStep($type, $stepDef, array_merge($step->context, array()));
81 81
                     try {
82 82
                         $result = $stepExecutors[$j]->execute($subStep);
83
-                    } catch(MigrationStepSkippedException $e) {
83
+                    } catch (MigrationStepSkippedException $e) {
84 84
                         // all ok, continue the loop
85 85
                     }
86 86
                 }
@@ -97,7 +97,7 @@  discard block
 block discarded – undo
97 97
                     $subStep = new MigrationStep($type, $stepDef, array_merge($step->context, array()));
98 98
                     try {
99 99
                         $result = $stepExecutors[$j]->execute($subStep);
100
-                    } catch(MigrationStepSkippedException $e) {
100
+                    } catch (MigrationStepSkippedException $e) {
101 101
                         // all ok, continue the loop
102 102
                     }
103 103
                 }
Please login to merge, or discard this patch.
Core/Helper/SortConverter.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -40,7 +40,7 @@
 block discarded – undo
40 40
     public function sortField2Hash($value)
41 41
     {
42 42
         $ref = new \ReflectionClass('eZ\Publish\API\Repository\Values\Content\Location');
43
-        foreach($ref->getConstants() as $key => $val) {
43
+        foreach ($ref->getConstants() as $key => $val) {
44 44
             if (strpos($key, 'SORT_FIELD_') === 0 && $val == $value) {
45 45
                 $out = strtolower(substr($key, 11));
46 46
                 if ($out == 'contentobject_id') {
Please login to merge, or discard this patch.
Core/Matcher/QueryBasedMatcher.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -146,7 +146,7 @@  discard block
 block discarded – undo
146 146
                 return new Query\Criterion\DateMetadata(Query\Criterion\DateMetadata::CREATED, self::$operatorsMap[$operator], $match);
147 147
 
148 148
             case self::MATCH_GROUP:
149
-                foreach($values as &$value) {
149
+                foreach ($values as &$value) {
150 150
                     if (!ctype_digit($value)) {
151 151
                         $value = $this->groupMatcher->matchOneByKey($value)->id;
152 152
                     }
@@ -165,7 +165,7 @@  discard block
 block discarded – undo
165 165
                 return new Query\Criterion\DateMetadata(Query\Criterion\DateMetadata::MODIFIED, self::$operatorsMap[$operator], $match);
166 166
 
167 167
             case self::MATCH_OBJECT_STATE:
168
-                foreach($values as &$value) {
168
+                foreach ($values as &$value) {
169 169
                     if (!ctype_digit($value)) {
170 170
                         $value = $this->stateMatcher->matchOneByKey($value)->id;
171 171
                     }
@@ -173,7 +173,7 @@  discard block
 block discarded – undo
173 173
                 return new Query\Criterion\ObjectStateId($values);
174 174
 
175 175
             case self::MATCH_OWNER:
176
-                foreach($values as &$value) {
176
+                foreach ($values as &$value) {
177 177
                     if (!ctype_digit($value)) {
178 178
                         $value = $this->userMatcher->matchOneByKey($value)->id;
179 179
                     }
@@ -193,7 +193,7 @@  discard block
 block discarded – undo
193 193
                 return new Query\Criterion\ParentLocationId($locationIds);
194 194
 
195 195
             case self::MATCH_SECTION:
196
-                foreach($values as &$value) {
196
+                foreach ($values as &$value) {
197 197
                     if (!ctype_digit($value)) {
198 198
                         $value = $this->sectionMatcher->matchOneByKey($value)->id;
199 199
                     }
@@ -214,7 +214,7 @@  discard block
 block discarded – undo
214 214
 
215 215
             case self::MATCH_AND:
216 216
                 $subCriteria = array();
217
-                foreach($values as $subCriterion) {
217
+                foreach ($values as $subCriterion) {
218 218
                     $value = reset($subCriterion);
219 219
                     $subCriteria[] = $this->getQueryCriterion(key($subCriterion), $value);
220 220
                 }
@@ -222,7 +222,7 @@  discard block
 block discarded – undo
222 222
 
223 223
             case self::MATCH_OR:
224 224
                 $subCriteria = array();
225
-                foreach($values as $subCriterion) {
225
+                foreach ($values as $subCriterion) {
226 226
                     $value = reset($subCriterion);
227 227
                     $subCriteria[] = $this->getQueryCriterion(key($subCriterion), $value);
228 228
                 }
@@ -259,7 +259,7 @@  discard block
 block discarded – undo
259 259
 
260 260
             $direction = $this->hash2SortOrder($sortItem['sort_order']);
261 261
 
262
-            switch($sortItem['sort_field']) {
262
+            switch ($sortItem['sort_field']) {
263 263
                 case SELF::SORT_CONTENT_ID:
264 264
                     $out[] = new SortClause\ContentId($direction);
265 265
                     break;
Please login to merge, or discard this patch.
Core/Executor/ContentVersionManager.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -149,7 +149,7 @@
 block discarded – undo
149 149
 
150 150
     protected function versionStatusToHash($status)
151 151
     {
152
-        foreach(ContentVersionMatcher::STATUS_MAP as $own => $ez) {
152
+        foreach (ContentVersionMatcher::STATUS_MAP as $own => $ez) {
153 153
             if ($status == $ez) {
154 154
                 return $own;
155 155
             }
Please login to merge, or discard this patch.
Core/Matcher/ContentVersionMatcher.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -45,7 +45,7 @@  discard block
 block discarded – undo
45 45
         $versions = array();
46 46
 
47 47
         $contentCollection = $this->contentMatcher->match($contentConditions, $sort, $offset, $limit);
48
-        foreach($contentCollection as $content) {
48
+        foreach ($contentCollection as $content) {
49 49
             $versions = array_merge($versions, $this->matchContentVersions($versionConditions, $content));
50 50
         }
51 51
 
@@ -151,7 +151,7 @@  discard block
 block discarded – undo
151 151
     {
152 152
         $versions = array();
153 153
         foreach ($this->findAllContentVersions($content) as $versionKey => $versionInfo) {
154
-            foreach($values as $acceptedStatus) {
154
+            foreach ($values as $acceptedStatus) {
155 155
                 if ($versionInfo->status == self::STATUS_MAP[$acceptedStatus]) {
156 156
                     $versions[$versionKey] = $versionInfo;
157 157
                     break;
@@ -173,15 +173,15 @@  discard block
 block discarded – undo
173 173
         $contentVersionsCount = count($contentVersions);
174 174
         $i = 0;
175 175
         foreach ($contentVersions as $versionKey => $versionInfo) {
176
-            foreach($values as $acceptedVersionNo) {
177
-                if ($acceptedVersionNo > 0 ) {
176
+            foreach ($values as $acceptedVersionNo) {
177
+                if ($acceptedVersionNo > 0) {
178 178
                     if ($acceptedVersionNo == $versionInfo->versionNo) {
179 179
                         $versions[$versionKey] = $versionInfo;
180 180
                         break;
181 181
                     }
182 182
                 } else {
183 183
                     // negative $acceptedVersionNo means 'leave the last X versions', eg: -1 = leave the last version
184
-                    if ($i < $contentVersionsCount + $acceptedVersionNo)  {
184
+                    if ($i < $contentVersionsCount + $acceptedVersionNo) {
185 185
                         $versions[$versionKey] = $versionInfo;
186 186
                         break;
187 187
 
@@ -202,7 +202,7 @@  discard block
 block discarded – undo
202 202
         $contentVersions = $this->repository->getContentService()->loadVersions($content->contentInfo);
203 203
         // different eZ kernels apparently sort versions in different order...
204 204
         $sortedVersions = array();
205
-        foreach($contentVersions as $versionInfo) {
205
+        foreach ($contentVersions as $versionInfo) {
206 206
             $sortedVersions[$content->contentInfo->id . '/' . $versionInfo->versionNo] = $versionInfo;
207 207
         }
208 208
         ksort($sortedVersions);
Please login to merge, or discard this patch.
Command/MigrateCommand.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -219,9 +219,9 @@  discard block
 block discarded – undo
219 219
         $this->writeln("Executed $executed migrations, failed $failed, skipped $skipped");
220 220
         if ($input->getOption('separate-process')) {
221 221
             // in case of using subprocesses, we can not measure max memory used
222
-            $this->writeln("Time taken: ".sprintf('%.2f', $time)." secs");
222
+            $this->writeln("Time taken: " . sprintf('%.2f', $time) . " secs");
223 223
         } else {
224
-            $this->writeln("Time taken: ".sprintf('%.2f', $time)." secs, memory: ".sprintf('%.2f', (memory_get_peak_usage(true) / 1000000)). ' MB');
224
+            $this->writeln("Time taken: " . sprintf('%.2f', $time) . " secs, memory: " . sprintf('%.2f', (memory_get_peak_usage(true) / 1000000)) . ' MB');
225 225
         }
226 226
     }
227 227
 
@@ -369,7 +369,7 @@  discard block
 block discarded – undo
369 369
             $builderArgs[] = '--no-debug';
370 370
         }
371 371
         if ($input->getOption('siteaccess')) {
372
-            $builderArgs[]='--siteaccess='.$input->getOption('siteaccess');
372
+            $builderArgs[] = '--siteaccess=' . $input->getOption('siteaccess');
373 373
         }
374 374
         // 'optional' options
375 375
         // note: options 'clear-cache', 'ignore-failures', 'no-interaction', 'path' and 'separate-process' we never propagate
Please login to merge, or discard this patch.