Passed
Push — master ( 80de3b...15b42a )
by Gaetano
06:55
created
Command/MigrationCommand.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -95,7 +95,7 @@
 block discarded – undo
95 95
 
96 96
             $output->writeln('<info>Migration: ' . $migration->name . '</info>');
97 97
             $output->writeln('Status: ' . $status);
98
-            $output->writeln('Executed on: <info>' . ($migration->executionDate != null ? date("Y-m-d H:i:s", $migration->executionDate) : '--'). '</info>');
98
+            $output->writeln('Executed on: <info>' . ($migration->executionDate != null ? date("Y-m-d H:i:s", $migration->executionDate) : '--') . '</info>');
99 99
             $output->writeln('Execution notes: <info>' . $migration->executionError . '</info>');
100 100
 
101 101
             if ($migration->status == Migration::STATUS_SUSPENDED) {
Please login to merge, or discard this patch.
Core/Executor/HTTPExecutor.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -67,7 +67,7 @@
 block discarded – undo
67 67
         $body = isset($dsl['body']) ? $this->resolveReferencesInText($dsl['body']) : null;
68 68
 
69 69
         if (isset($dsl['client'])) {
70
-            $client = $this->container->get('httplug.client.'.$dsl['client']);
70
+            $client = $this->container->get('httplug.client.' . $dsl['client']);
71 71
         } else {
72 72
             $client = $this->container->get('httplug.client');
73 73
         }
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
@@ -171,7 +171,7 @@  discard block
 block discarded – undo
171 171
     public function endMigration(APIMigration $migration, $force = false)
172 172
     {
173 173
         if ($migration->status == APIMigration::STATUS_STARTED) {
174
-            throw new \Exception($this->getEntityName($migration)." '{$migration->name}' can not be ended as its status is 'started'...");
174
+            throw new \Exception($this->getEntityName($migration) . " '{$migration->name}' can not be ended as its status is 'started'...");
175 175
         }
176 176
 
177 177
         $this->createTableIfNeeded();
@@ -198,13 +198,13 @@  discard block
 block discarded – undo
198 198
         if (!is_array($existingMigrationData)) {
199 199
             // commit to release the lock
200 200
             $conn->commit();
201
-            throw new \Exception($this->getEntityName($migration)." '{$migration->name}' can not be ended as it is not found");
201
+            throw new \Exception($this->getEntityName($migration) . " '{$migration->name}' can not be ended as it is not found");
202 202
         }
203 203
 
204 204
         if (($existingMigrationData['status'] != APIMigration::STATUS_STARTED) && !$force) {
205 205
             // commit to release the lock
206 206
             $conn->commit();
207
-            throw new \Exception($this->getEntityName($migration)." '{$migration->name}' can not be ended as it is not executing");
207
+            throw new \Exception($this->getEntityName($migration) . " '{$migration->name}' can not be ended as it is not executing");
208 208
         }
209 209
 
210 210
         $conn->update(
@@ -355,7 +355,7 @@  discard block
 block discarded – undo
355 355
         if (!is_array($existingMigrationData)) {
356 356
             // commit immediately, to release the lock and avoid deadlocks
357 357
             $conn->commit();
358
-            throw new \Exception($this->getEntityName($migration)." '{$migration->name}' can not be resumed as it is not found");
358
+            throw new \Exception($this->getEntityName($migration) . " '{$migration->name}' can not be resumed as it is not found");
359 359
         }
360 360
 
361 361
         // migration exists
@@ -364,7 +364,7 @@  discard block
 block discarded – undo
364 364
         if ($existingMigrationData['status'] != APIMigration::STATUS_SUSPENDED) {
365 365
             // commit to release the lock
366 366
             $conn->commit();
367
-            throw new \Exception($this->getEntityName($migration)." '{$migration->name}' can not be resumed as it is not suspended");
367
+            throw new \Exception($this->getEntityName($migration) . " '{$migration->name}' can not be resumed as it is not suspended");
368 368
         }
369 369
 
370 370
         $migration = new APIMigration(
Please login to merge, or discard this patch.
Core/Executor/ProcessExecutor.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -63,7 +63,7 @@
 block discarded – undo
63 63
         $builderArgs = array($this->referenceResolver->resolveReference($dsl['command']));
64 64
 
65 65
         if (isset($dsl['arguments'])) {
66
-            foreach($dsl['arguments'] as $arg) {
66
+            foreach ($dsl['arguments'] as $arg) {
67 67
                 $builderArgs[] = $this->referenceResolver->resolveReference($arg);
68 68
             }
69 69
         }
Please login to merge, or discard this patch.
Core/Executor/MigrationExecutor.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -105,13 +105,13 @@  discard block
 block discarded – undo
105 105
         $dsl['mode'] = 'load';
106 106
         // be kind to users and allow them not to specify this explicitly
107 107
         if (isset($dsl['references'])) {
108
-            foreach($dsl['references'] as &$refDef) {
108
+            foreach ($dsl['references'] as &$refDef) {
109 109
                 $refDef['overwrite'] = true;
110 110
             }
111 111
         }
112 112
         $step = new MigrationStep($dsl['type'], $dsl, $context);
113 113
 
114
-        switch($dsl['type']) {
114
+        switch ($dsl['type']) {
115 115
             case 'content':
116 116
                 return $this->contentManager->execute($step);
117 117
             case 'location':
@@ -139,7 +139,7 @@  discard block
 block discarded – undo
139 139
                     return $this->matchConditions($values);
140 140
 
141 141
                 default:
142
-                    throw new \Exception("Unknown until condition: '$key' when suspending a migration ".var_export($conditions, true));
142
+                    throw new \Exception("Unknown until condition: '$key' when suspending a migration " . var_export($conditions, true));
143 143
             }
144 144
         }
145 145
     }
Please login to merge, or discard this patch.
Command/ResumeCommand.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -93,7 +93,7 @@  discard block
 block discarded – undo
93 93
         $executed = 0;
94 94
         $failed = 0;
95 95
 
96
-        foreach($suspendedMigrations as $suspendedMigration) {
96
+        foreach ($suspendedMigrations as $suspendedMigration) {
97 97
             $output->writeln("<info>Resuming {$suspendedMigration->name}</info>");
98 98
 
99 99
             try {
@@ -113,7 +113,7 @@  discard block
 block discarded – undo
113 113
 
114 114
         $time = microtime(true) - $start;
115 115
         $output->writeln("Resumed $executed migrations, failed $failed");
116
-        $output->writeln("Time taken: ".sprintf('%.2f', $time)." secs, memory: ".sprintf('%.2f', (memory_get_peak_usage(true) / 1000000)). ' MB');
116
+        $output->writeln("Time taken: " . sprintf('%.2f', $time) . " secs, memory: " . sprintf('%.2f', (memory_get_peak_usage(true) / 1000000)) . ' MB');
117 117
 
118 118
         if ($failed) {
119 119
             return 2;
Please login to merge, or discard this patch.
Core/Matcher/ContentMatcher.php 2 patches
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -46,15 +46,15 @@  discard block
 block discarded – undo
46 46
 
47 47
         foreach ($conditions as $key => $values) {
48 48
 
49
-            switch($key) {
49
+            switch ($key) {
50 50
 
51 51
                 case self::MATCH_RELATES_TO:
52 52
                     $contentService = $this->repository->getContentService();
53 53
                     $contents = array();
54 54
                     // allow to specify the objects to relate to using different ways
55 55
                     $relatedContents = $this->match($values);
56
-                    foreach($relatedContents as $relatedContent) {
57
-                        foreach($contentService->loadReverseRelations($relatedContent->contentInfo) as $relatingContent) {
56
+                    foreach ($relatedContents as $relatedContent) {
57
+                        foreach ($contentService->loadReverseRelations($relatedContent->contentInfo) as $relatingContent) {
58 58
                             $contents[$relatingContent->contentInfo->id] = $relatingContent;
59 59
                         }
60 60
                     }
@@ -65,8 +65,8 @@  discard block
 block discarded – undo
65 65
                     $contents = array();
66 66
                     // allow to specify the objects we relate to using different ways
67 67
                     $relatingContents = $this->match($values);
68
-                    foreach($relatingContents as $relatingContent) {
69
-                        foreach($contentService->loadRelations($relatingContent->contentInfo) as $relatedContent) {
68
+                    foreach ($relatingContents as $relatingContent) {
69
+                        foreach ($contentService->loadRelations($relatingContent->contentInfo) as $relatedContent) {
70 70
                             $contents[$relatedContent->contentInfo->id] = $relatedContent;
71 71
                         }
72 72
                     }
Please login to merge, or discard this patch.
Braces   +12 added lines, -4 removed lines patch added patch discarded remove patch
@@ -103,7 +103,9 @@  discard block
 block discarded – undo
103 103
                     $query = new Query();
104 104
                     $query->limit = $limit != 0 ? $limit : self::INT_MAX_16BIT;
105 105
                     $query->offset = $offset;
106
-                    if (isset($query->performCount)) $query->performCount = false;
106
+                    if (isset($query->performCount)) {
107
+                        $query->performCount = false;
108
+                    }
107 109
                     $query->filter = $this->getQueryCriterion($key, $values);
108 110
                     if (!empty($sort)) {
109 111
                         $query->sortClauses = $this->getSortClauses($sort);
@@ -229,7 +231,9 @@  discard block
 block discarded – undo
229 231
     {
230 232
         $query = new Query();
231 233
         $query->limit = self::INT_MAX_16BIT;
232
-        if (isset($query->performCount)) $query->performCount = false;
234
+        if (isset($query->performCount)) {
235
+            $query->performCount = false;
236
+        }
233 237
         $query->filter = new Query\Criterion\ParentLocationId($parentLocationIds);
234 238
         $results = $this->repository->getSearchService()->findContent($query);
235 239
 
@@ -269,7 +273,9 @@  discard block
 block discarded – undo
269 273
     {
270 274
         $query = new Query();
271 275
         $query->limit = self::INT_MAX_16BIT;
272
-        if (isset($query->performCount)) $query->performCount = false;
276
+        if (isset($query->performCount)) {
277
+            $query->performCount = false;
278
+        }
273 279
         $query->filter = new Query\Criterion\ContentTypeIdentifier($contentTypeIdentifiers);
274 280
         // sort objects by depth, lower to higher, so that deleting them has less chances of failure
275 281
         // NB: we only do this in eZP versions that allow depth sorting on content queries
@@ -297,7 +303,9 @@  discard block
 block discarded – undo
297 303
     {
298 304
         $query = new Query();
299 305
         $query->limit = self::INT_MAX_16BIT;
300
-        if (isset($query->performCount)) $query->performCount = false;
306
+        if (isset($query->performCount)) {
307
+            $query->performCount = false;
308
+        }
301 309
         $query->filter = new Query\Criterion\ContentTypeId($contentTypeIds);
302 310
         // sort objects by depth, lower to higher, so that deleting them has less chances of failure
303 311
         // NB: we only do this in eZP versions that allow depth sorting on content queries
Please login to merge, or discard this patch.
Core/FieldHandler/EzDateAndTime.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -58,26 +58,26 @@
 block discarded – undo
58 58
     {
59 59
         $format = array();
60 60
         if (0 != $dateInterval->y) {
61
-            $format[] = $dateInterval->y.' years';
61
+            $format[] = $dateInterval->y . ' years';
62 62
         }
63 63
         if (0 != $dateInterval->m) {
64
-            $format[] = $dateInterval->m.' months';
64
+            $format[] = $dateInterval->m . ' months';
65 65
         }
66 66
         if (0 != $dateInterval->d) {
67
-            $format[] = $dateInterval->d.' days';
67
+            $format[] = $dateInterval->d . ' days';
68 68
         }
69 69
         //if (0 < $dateInterval->h || 0 < $dateInterval->i || 0 < $dateInterval->s) {
70 70
         //    $format .= 'T';
71 71
         //}
72 72
         if (0 != $dateInterval->h) {
73
-            $format[] = $dateInterval->h.' hours';
73
+            $format[] = $dateInterval->h . ' hours';
74 74
         }
75 75
         if (0 != $dateInterval->i) {
76
-            $format[] = $dateInterval->i.' minutes';
76
+            $format[] = $dateInterval->i . ' minutes';
77 77
         }
78 78
         if (0 != $dateInterval->s) {
79
-            $format[] = $dateInterval->s.' seconds';
79
+            $format[] = $dateInterval->s . ' seconds';
80 80
         }
81
-        return implode( ', ', $format);
81
+        return implode(', ', $format);
82 82
     }
83 83
 }
Please login to merge, or discard this patch.
Core/Matcher/TrashMatcher.php 1 patch
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -36,7 +36,9 @@
 block discarded – undo
36 36
 
37 37
             $query = new Query();
38 38
             $query->limit = self::INT_MAX_16BIT;
39
-            if (isset($query->performCount)) $query->performCount = false;
39
+            if (isset($query->performCount)) {
40
+                $query->performCount = false;
41
+            }
40 42
             $query->filter = $this->getQueryCriterion($key, $values);
41 43
             $results = $this->repository->getTrashService()->findTrashItems($query);
42 44
 
Please login to merge, or discard this patch.