@@ -264,7 +264,7 @@ discard block |
||
264 | 264 | } |
265 | 265 | |
266 | 266 | if ($migrationDefinition->status == MigrationDefinition::STATUS_INVALID) { |
267 | - throw new \Exception("Can not execute " . $this->getEntityName($migrationDefinition). " '{$migrationDefinition->name}': {$migrationDefinition->parsingError}"); |
|
267 | + throw new \Exception("Can not execute " . $this->getEntityName($migrationDefinition) . " '{$migrationDefinition->name}': {$migrationDefinition->parsingError}"); |
|
268 | 268 | } |
269 | 269 | |
270 | 270 | /// @todo add support for setting in $migrationContext a userContentType, userGroupContentType ? |
@@ -298,7 +298,7 @@ discard block |
||
298 | 298 | |
299 | 299 | try { |
300 | 300 | |
301 | - $i = $stepOffset+1; |
|
301 | + $i = $stepOffset + 1; |
|
302 | 302 | $finalStatus = Migration::STATUS_DONE; |
303 | 303 | $finalMessage = null; |
304 | 304 | |
@@ -433,12 +433,12 @@ discard block |
||
433 | 433 | public function resumeMigration(Migration $migration, $useTransaction = true) |
434 | 434 | { |
435 | 435 | if ($migration->status != Migration::STATUS_SUSPENDED) { |
436 | - throw new \Exception("Can not resume ".$this->getEntityName($migration)." '{$migration->name}': it is not in suspended status"); |
|
436 | + throw new \Exception("Can not resume " . $this->getEntityName($migration) . " '{$migration->name}': it is not in suspended status"); |
|
437 | 437 | } |
438 | 438 | |
439 | 439 | $migrationDefinitions = $this->getMigrationsDefinitions(array($migration->path)); |
440 | 440 | if (!count($migrationDefinitions)) { |
441 | - throw new \Exception("Can not resume ".$this->getEntityName($migration)." '{$migration->name}': its definition is missing"); |
|
441 | + throw new \Exception("Can not resume " . $this->getEntityName($migration) . " '{$migration->name}': its definition is missing"); |
|
442 | 442 | } |
443 | 443 | |
444 | 444 | $defs = $migrationDefinitions->getArrayCopy(); |
@@ -446,18 +446,18 @@ discard block |
||
446 | 446 | |
447 | 447 | $migrationDefinition = $this->parseMigrationDefinition($migrationDefinition); |
448 | 448 | if ($migrationDefinition->status == MigrationDefinition::STATUS_INVALID) { |
449 | - throw new \Exception("Can not resume ".$this->getEntityName($migration)." '{$migration->name}': {$migrationDefinition->parsingError}"); |
|
449 | + throw new \Exception("Can not resume " . $this->getEntityName($migration) . " '{$migration->name}': {$migrationDefinition->parsingError}"); |
|
450 | 450 | } |
451 | 451 | |
452 | 452 | // restore context |
453 | 453 | $this->contextHandler->restoreCurrentContext($migration->name); |
454 | 454 | |
455 | 455 | if (!isset($this->migrationContext[$migration->name])) { |
456 | - throw new \Exception("Can not resume ".$this->getEntityName($migration)." '{$migration->name}': the stored context is missing"); |
|
456 | + throw new \Exception("Can not resume " . $this->getEntityName($migration) . " '{$migration->name}': the stored context is missing"); |
|
457 | 457 | } |
458 | 458 | $restoredContext = $this->migrationContext[$migration->name]; |
459 | - if (!is_array($restoredContext) || !isset($restoredContext['context']) || !isset($restoredContext['step'] )) { |
|
460 | - throw new \Exception("Can not resume ".$this->getEntityName($migration)." '{$migration->name}': the stored context is invalid"); |
|
459 | + if (!is_array($restoredContext) || !isset($restoredContext['context']) || !isset($restoredContext['step'])) { |
|
460 | + throw new \Exception("Can not resume " . $this->getEntityName($migration) . " '{$migration->name}': the stored context is invalid"); |
|
461 | 461 | } |
462 | 462 | |
463 | 463 | // update migration status |
@@ -478,7 +478,7 @@ discard block |
||
478 | 478 | * @param bool|null $forceSigchildEnabled |
479 | 479 | * @return array |
480 | 480 | */ |
481 | - protected function migrationContextFromParameters($defaultLanguageCode = null, $adminLogin = null, $forceSigchildEnabled = null ) |
|
481 | + protected function migrationContextFromParameters($defaultLanguageCode = null, $adminLogin = null, $forceSigchildEnabled = null) |
|
482 | 482 | { |
483 | 483 | $properties = array(); |
484 | 484 |
@@ -87,7 +87,9 @@ discard block |
||
87 | 87 | if (!empty($sort)) { |
88 | 88 | $query->sortClauses = $this->getSortClauses($sort); |
89 | 89 | } |
90 | - if (isset($query->performCount)) $query->performCount = false; |
|
90 | + if (isset($query->performCount)) { |
|
91 | + $query->performCount = false; |
|
92 | + } |
|
91 | 93 | $query->filter = $this->getQueryCriterion($key, $values); |
92 | 94 | $results = $this->getSearchService()->findLocations($query); |
93 | 95 | |
@@ -234,7 +236,9 @@ discard block |
||
234 | 236 | { |
235 | 237 | $query = new LocationQuery(); |
236 | 238 | $query->limit = self::INT_MAX_16BIT; |
237 | - if (isset($query->performCount)) $query->performCount = false; |
|
239 | + if (isset($query->performCount)) { |
|
240 | + $query->performCount = false; |
|
241 | + } |
|
238 | 242 | $query->filter = new Query\Criterion\ParentLocationId($parentLocationIds); |
239 | 243 | |
240 | 244 | $results = $this->getSearchService()->findLocations($query); |
@@ -120,7 +120,9 @@ discard block |
||
120 | 120 | $query = new Query(); |
121 | 121 | $query->limit = $limit != 0 ? $limit : $this->queryLimit; |
122 | 122 | $query->offset = $offset; |
123 | - if (isset($query->performCount)) $query->performCount = false; |
|
123 | + if (isset($query->performCount)) { |
|
124 | + $query->performCount = false; |
|
125 | + } |
|
124 | 126 | $query->filter = $this->getQueryCriterion($key, $values); |
125 | 127 | if (!empty($sort)) { |
126 | 128 | $query->sortClauses = $this->getSortClauses($sort); |
@@ -246,7 +248,9 @@ discard block |
||
246 | 248 | { |
247 | 249 | $query = new Query(); |
248 | 250 | $query->limit = $this->queryLimit; |
249 | - if (isset($query->performCount)) $query->performCount = false; |
|
251 | + if (isset($query->performCount)) { |
|
252 | + $query->performCount = false; |
|
253 | + } |
|
250 | 254 | $query->filter = new Query\Criterion\ParentLocationId($parentLocationIds); |
251 | 255 | $results = $this->getSearchService()->findContent($query); |
252 | 256 | |
@@ -286,7 +290,9 @@ discard block |
||
286 | 290 | { |
287 | 291 | $query = new Query(); |
288 | 292 | $query->limit = $this->queryLimit; |
289 | - if (isset($query->performCount)) $query->performCount = false; |
|
293 | + if (isset($query->performCount)) { |
|
294 | + $query->performCount = false; |
|
295 | + } |
|
290 | 296 | $query->filter = new Query\Criterion\ContentTypeIdentifier($contentTypeIdentifiers); |
291 | 297 | // sort objects by depth, lower to higher, so that deleting them has less chances of failure |
292 | 298 | // NB: we only do this in eZP versions that allow depth sorting on content queries |
@@ -314,7 +320,9 @@ discard block |
||
314 | 320 | { |
315 | 321 | $query = new Query(); |
316 | 322 | $query->limit = $this->queryLimit; |
317 | - if (isset($query->performCount)) $query->performCount = false; |
|
323 | + if (isset($query->performCount)) { |
|
324 | + $query->performCount = false; |
|
325 | + } |
|
318 | 326 | $query->filter = new Query\Criterion\ContentTypeId($contentTypeIds); |
319 | 327 | // sort objects by depth, lower to higher, so that deleting them has less chances of failure |
320 | 328 | // NB: we only do this in eZP versions that allow depth sorting on content queries |
@@ -226,7 +226,7 @@ |
||
226 | 226 | */ |
227 | 227 | protected function sortMigrationIndex(array &$index, $sortBy) |
228 | 228 | { |
229 | - switch($sortBy) { |
|
229 | + switch ($sortBy) { |
|
230 | 230 | case 'execution': |
231 | 231 | uasort($index, function($m1, $m2) { |
232 | 232 | if (isset($m1['migration']) && $m1['migration']->executionDate !== null) { |
@@ -41,7 +41,7 @@ |
||
41 | 41 | $fieldValue = array($fieldValue); |
42 | 42 | } |
43 | 43 | if (!$refsResolved) { |
44 | - foreach($fieldValue as $key => $countryValue) { |
|
44 | + foreach ($fieldValue as $key => $countryValue) { |
|
45 | 45 | $fieldValue[$key] = $this->referenceResolver->resolveReference($countryValue); |
46 | 46 | } |
47 | 47 | } |
@@ -46,7 +46,7 @@ discard block |
||
46 | 46 | |
47 | 47 | // BC |
48 | 48 | if (isset($step->dsl['references_type'])) { |
49 | - switch($step->dsl['references_type']) { |
|
49 | + switch ($step->dsl['references_type']) { |
|
50 | 50 | case 'array': |
51 | 51 | return (isset($step->dsl['references_allow_empty']) && $step->dsl['references_allow_empty'] == true); |
52 | 52 | case 'scalar': |
@@ -81,7 +81,7 @@ discard block |
||
81 | 81 | |
82 | 82 | // BC |
83 | 83 | if (isset($step->dsl['references_type'])) { |
84 | - switch($step->dsl['references_type']) { |
|
84 | + switch ($step->dsl['references_type']) { |
|
85 | 85 | case 'array': |
86 | 86 | return self::$RESULT_TYPE_MULTIPLE; |
87 | 87 | case 'scalar': |
@@ -105,7 +105,7 @@ discard block |
||
105 | 105 | */ |
106 | 106 | protected function hasNonScalarReferences($referencesDefinition) |
107 | 107 | { |
108 | - foreach($referencesDefinition as $referenceDefinition) { |
|
108 | + foreach ($referencesDefinition as $referenceDefinition) { |
|
109 | 109 | if (!$this->isScalarReference($referenceDefinition)) |
110 | 110 | { |
111 | 111 | return true; |
@@ -166,7 +166,7 @@ discard block |
||
166 | 166 | |
167 | 167 | foreach ($dsl['references'] as $reference) { |
168 | 168 | // BC |
169 | - if (isset($reference['json_path']) && !isset($reference['attribute'] )) { |
|
169 | + if (isset($reference['json_path']) && !isset($reference['attribute'])) { |
|
170 | 170 | $reference['attribute'] = $reference['json_path']; |
171 | 171 | } |
172 | 172 | |
@@ -195,7 +195,7 @@ discard block |
||
195 | 195 | { |
196 | 196 | $migrationService = $this->migrationService; |
197 | 197 | $executors = $migrationService->listExecutors(); |
198 | - foreach($executors as $key => $name) { |
|
198 | + foreach ($executors as $key => $name) { |
|
199 | 199 | $executor = $migrationService->getExecutor($name); |
200 | 200 | if (!$executor instanceof MigrationGeneratorInterface) { |
201 | 201 | unset($executors[$key]); |
@@ -224,7 +224,7 @@ discard block |
||
224 | 224 | |
225 | 225 | $multivalued = ($this->getResultsType($step) == self::$RESULT_TYPE_MULTIPLE); |
226 | 226 | |
227 | - if ($item instanceof AbstractCollection || is_array($item)) { |
|
227 | + if ($item instanceof AbstractCollection || is_array($item)) { |
|
228 | 228 | $items = $item; |
229 | 229 | } else { |
230 | 230 | $items = array($item); |
@@ -267,7 +267,7 @@ discard block |
||
267 | 267 | { |
268 | 268 | // allow setting *some* refs even when we have 0 or N matches |
269 | 269 | foreach ($referencesDefinition as $key => $reference) { |
270 | - switch($reference['attribute']) { |
|
270 | + switch ($reference['attribute']) { |
|
271 | 271 | |
272 | 272 | case 'count': |
273 | 273 | $value = count($entity); |