Passed
Push — master ( 5c649b...ed27fb )
by Gaetano
04:01
created
Core/MigrationService.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -310,7 +310,7 @@  discard block
 block discarded – undo
310 310
         }
311 311
 
312 312
         if ($migrationDefinition->status == MigrationDefinition::STATUS_INVALID) {
313
-            throw new MigrationBundleException("Can not execute " . $this->getEntityName($migrationDefinition). " '{$migrationDefinition->name}': {$migrationDefinition->parsingError}");
313
+            throw new MigrationBundleException("Can not execute " . $this->getEntityName($migrationDefinition) . " '{$migrationDefinition->name}': {$migrationDefinition->parsingError}");
314 314
         }
315 315
 
316 316
         /// @todo add support for setting in $migrationContext a userContentType, userGroupContentType ?
@@ -344,7 +344,7 @@  discard block
 block discarded – undo
344 344
 
345 345
         try {
346 346
 
347
-            $i = $stepOffset+1;
347
+            $i = $stepOffset + 1;
348 348
             $finalStatus = Migration::STATUS_DONE;
349 349
             $finalMessage = null;
350 350
 
@@ -481,12 +481,12 @@  discard block
 block discarded – undo
481 481
     public function resumeMigration(Migration $migration, $useTransaction = true, array $forcedReferences = array())
482 482
     {
483 483
         if ($migration->status != Migration::STATUS_SUSPENDED) {
484
-            throw new MigrationBundleException("Can not resume ".$this->getEntityName($migration)." '{$migration->name}': it is not in suspended status");
484
+            throw new MigrationBundleException("Can not resume " . $this->getEntityName($migration) . " '{$migration->name}': it is not in suspended status");
485 485
         }
486 486
 
487 487
         $migrationDefinitions = $this->getMigrationsDefinitions(array($migration->path));
488 488
         if (!count($migrationDefinitions)) {
489
-            throw new MigrationBundleException("Can not resume ".$this->getEntityName($migration)." '{$migration->name}': its definition is missing");
489
+            throw new MigrationBundleException("Can not resume " . $this->getEntityName($migration) . " '{$migration->name}': its definition is missing");
490 490
         }
491 491
 
492 492
         $defs = $migrationDefinitions->getArrayCopy();
@@ -494,7 +494,7 @@  discard block
 block discarded – undo
494 494
 
495 495
         $migrationDefinition = $this->parseMigrationDefinition($migrationDefinition);
496 496
         if ($migrationDefinition->status == MigrationDefinition::STATUS_INVALID) {
497
-            throw new MigrationBundleException("Can not resume ".$this->getEntityName($migration)." '{$migration->name}': {$migrationDefinition->parsingError}");
497
+            throw new MigrationBundleException("Can not resume " . $this->getEntityName($migration) . " '{$migration->name}': {$migrationDefinition->parsingError}");
498 498
         }
499 499
 
500 500
         // restore context
@@ -507,11 +507,11 @@  discard block
 block discarded – undo
507 507
         }
508 508
 
509 509
         if (!isset($this->migrationContext[$migration->name])) {
510
-            throw new MigrationBundleException("Can not resume ".$this->getEntityName($migration)." '{$migration->name}': the stored context is missing");
510
+            throw new MigrationBundleException("Can not resume " . $this->getEntityName($migration) . " '{$migration->name}': the stored context is missing");
511 511
         }
512 512
         $restoredContext = $this->migrationContext[$migration->name];
513
-        if (!is_array($restoredContext) || !isset($restoredContext['context']) || !isset($restoredContext['step'] )) {
514
-            throw new MigrationBundleException("Can not resume ".$this->getEntityName($migration)." '{$migration->name}': the stored context is invalid");
513
+        if (!is_array($restoredContext) || !isset($restoredContext['context']) || !isset($restoredContext['step'])) {
514
+            throw new MigrationBundleException("Can not resume " . $this->getEntityName($migration) . " '{$migration->name}': the stored context is invalid");
515 515
         }
516 516
 
517 517
         // update migration status
@@ -532,7 +532,7 @@  discard block
 block discarded – undo
532 532
      * @param bool|null $forceSigchildEnabled
533 533
      * @return array
534 534
      */
535
-    protected function migrationContextFromParameters($defaultLanguageCode = null, $adminLogin = null, $forceSigchildEnabled = null )
535
+    protected function migrationContextFromParameters($defaultLanguageCode = null, $adminLogin = null, $forceSigchildEnabled = null)
536 536
     {
537 537
         $properties = array();
538 538
 
Please login to merge, or discard this patch.
Core/StorageHandler/Database/Migration.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -206,7 +206,7 @@  discard block
 block discarded – undo
206 206
     public function endMigration(APIMigration $migration, $force = false)
207 207
     {
208 208
         if ($migration->status == APIMigration::STATUS_STARTED) {
209
-            throw new MigrationBundleException($this->getEntityName($migration)." '{$migration->name}' can not be ended as its status is 'started'...");
209
+            throw new MigrationBundleException($this->getEntityName($migration) . " '{$migration->name}' can not be ended as its status is 'started'...");
210 210
         }
211 211
 
212 212
         $this->createTableIfNeeded();
@@ -233,13 +233,13 @@  discard block
 block discarded – undo
233 233
         if (!is_array($existingMigrationData)) {
234 234
             // commit to release the lock
235 235
             $conn->commit();
236
-            throw new MigrationBundleException($this->getEntityName($migration)." '{$migration->name}' can not be ended as it is not found");
236
+            throw new MigrationBundleException($this->getEntityName($migration) . " '{$migration->name}' can not be ended as it is not found");
237 237
         }
238 238
 
239 239
         if (($existingMigrationData['status'] != APIMigration::STATUS_STARTED) && !$force) {
240 240
             // commit to release the lock
241 241
             $conn->commit();
242
-            throw new MigrationBundleException($this->getEntityName($migration)." '{$migration->name}' can not be ended as it is not executing");
242
+            throw new MigrationBundleException($this->getEntityName($migration) . " '{$migration->name}' can not be ended as it is not executing");
243 243
         }
244 244
 
245 245
         $conn->update(
@@ -395,7 +395,7 @@  discard block
 block discarded – undo
395 395
         if (!is_array($existingMigrationData)) {
396 396
             // commit immediately, to release the lock and avoid deadlocks
397 397
             $conn->commit();
398
-            throw new MigrationBundleException($this->getEntityName($migration)." '{$migration->name}' can not be resumed as it is not found");
398
+            throw new MigrationBundleException($this->getEntityName($migration) . " '{$migration->name}' can not be resumed as it is not found");
399 399
         }
400 400
 
401 401
         // migration exists
@@ -404,7 +404,7 @@  discard block
 block discarded – undo
404 404
         if ($existingMigrationData['status'] != APIMigration::STATUS_SUSPENDED) {
405 405
             // commit to release the lock
406 406
             $conn->commit();
407
-            throw new MigrationBundleException($this->getEntityName($migration)." '{$migration->name}' can not be resumed as it is not suspended");
407
+            throw new MigrationBundleException($this->getEntityName($migration) . " '{$migration->name}' can not be resumed as it is not suspended");
408 408
         }
409 409
 
410 410
         $migration = new APIMigration(
Please login to merge, or discard this patch.
Core/Executor/MigrationDefinitionExecutor.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -170,7 +170,7 @@
 block discarded – undo
170 170
 
171 171
         foreach ($dsl['references'] as $key => $reference) {
172 172
             // BC
173
-            if (is_array($reference) && isset($reference['json_path']) && !isset($reference['attribute'] )) {
173
+            if (is_array($reference) && isset($reference['json_path']) && !isset($reference['attribute'])) {
174 174
                 $reference['attribute'] = $reference['json_path'];
175 175
             }
176 176
             $reference = $this->parseReferenceDefinition($key, $reference);
Please login to merge, or discard this patch.
Core/Executor/ContentManager.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -778,7 +778,7 @@
 block discarded – undo
778 778
             },
779 779
             array_filter(
780 780
                 $this->repository->getContentLanguageService()->loadLanguages(),
781
-                function ($language) {
781
+                function($language) {
782 782
                     return $language->enabled;
783 783
                 }
784 784
             )
Please login to merge, or discard this patch.
Core/Executor/ObjectStateManager.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -268,10 +268,10 @@
 block discarded – undo
268 268
                 $names = array();
269 269
                 $descriptions = array();
270 270
                 foreach ($objectState->languageCodes as $languageCode) {
271
-                    $names[$languageCode] =  $objectState->getName($languageCode);
271
+                    $names[$languageCode] = $objectState->getName($languageCode);
272 272
                 }
273 273
                 foreach ($objectState->languageCodes as $languageCode) {
274
-                    $descriptions[$languageCode] =  $objectState->getDescription($languageCode);
274
+                    $descriptions[$languageCode] = $objectState->getDescription($languageCode);
275 275
                 }
276 276
                 $groupData = array_merge(
277 277
                     $groupData,
Please login to merge, or discard this patch.
Core/Executor/MigrationExecutor.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -147,7 +147,7 @@  discard block
 block discarded – undo
147 147
         }
148 148
         $step = new MigrationStep($dsl['type'], $dsl, $context);
149 149
 
150
-        switch($dsl['type']) {
150
+        switch ($dsl['type']) {
151 151
             case 'content':
152 152
                 return $this->contentManager->execute($step);
153 153
             case 'location':
@@ -178,7 +178,7 @@  discard block
 block discarded – undo
178 178
                     return $this->matchConditions($values);
179 179
 
180 180
                 default:
181
-                    throw new InvalidStepDefinitionException("Unknown until condition: '$key' when suspending a migration ".var_export($conditions, true));
181
+                    throw new InvalidStepDefinitionException("Unknown until condition: '$key' when suspending a migration " . var_export($conditions, true));
182 182
             }
183 183
         }
184 184
     }
Please login to merge, or discard this patch.
Core/Executor/RoleManager.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -445,7 +445,7 @@
 block discarded – undo
445 445
     protected function sortPolicyLimitationsDefinitions(array &$limitations)
446 446
     {
447 447
         usort($limitations, function($l1, $l2) {
448
-            if (($iComp = strcmp($l1['identifier'], $l2['identifier'])) != 0 ) {
448
+            if (($iComp = strcmp($l1['identifier'], $l2['identifier'])) != 0) {
449 449
                 return $iComp;
450 450
             }
451 451
             if (is_int($l1['values']) || is_float($l1['values'])) {
Please login to merge, or discard this patch.
Core/Executor/ObjectStateGroupManager.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -248,10 +248,10 @@
 block discarded – undo
248 248
                 $names = array();
249 249
                 $descriptions = array();
250 250
                 foreach ($objectStateGroup->languageCodes as $languageCode) {
251
-                    $names[$languageCode] =  $objectStateGroup->getName($languageCode);
251
+                    $names[$languageCode] = $objectStateGroup->getName($languageCode);
252 252
                 }
253 253
                 foreach ($objectStateGroup->languageCodes as $languageCode) {
254
-                    $descriptions[$languageCode] =  $objectStateGroup->getDescription($languageCode);
254
+                    $descriptions[$languageCode] = $objectStateGroup->getDescription($languageCode);
255 255
                 }
256 256
                 $groupData = array_merge(
257 257
                     $groupData,
Please login to merge, or discard this patch.
Core/Executor/TagManager.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -165,7 +165,7 @@  discard block
 block discarded – undo
165 165
 
166 166
         // sort tags by depth so that there will be no errors in case we are deleting parent and child
167 167
         $tagsCollection = $tagsCollection->getArrayCopy();
168
-        uasort($tagsCollection, function ($t1, $t2) {
168
+        uasort($tagsCollection, function($t1, $t2) {
169 169
             if ($t1->depth == $t2->depth) return 0;
170 170
             return ($t1->depth > $t2->depth) ? -1 : 1;
171 171
         });
@@ -272,7 +272,7 @@  discard block
 block discarded – undo
272 272
             case 'create':
273 273
                 // sort top to bottom
274 274
                 $tagCollection = $tagCollection->getArrayCopy();
275
-                uasort($tagCollection, function ($t1, $t2) {
275
+                uasort($tagCollection, function($t1, $t2) {
276 276
                     if ($t1->depth == $t2->depth) return 0;
277 277
                     return ($t1->depth > $t2->depth) ? 1 : -1;
278 278
                 });
@@ -280,7 +280,7 @@  discard block
 block discarded – undo
280 280
             case 'delete':
281 281
                 // sort bottom to top
282 282
                 $tagCollection = $tagCollection->getArrayCopy();
283
-                uasort($tagCollection, function ($t1, $t2) {
283
+                uasort($tagCollection, function($t1, $t2) {
284 284
                     if ($t1->depth == $t2->depth) return 0;
285 285
                     return ($t1->depth > $t2->depth) ? -1 : 1;
286 286
                 });
Please login to merge, or discard this patch.