Completed
Pull Request — master (#133)
by Damian
07:53
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/MailExecutor.php 1 patch
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -48,7 +48,7 @@
 block discarded – undo
48 48
     /**
49 49
      * @param array $dsl
50 50
      * @param array $context
51
-     * @return true
51
+     * @return boolean
52 52
      * @throws \Exception
53 53
      */
54 54
     protected function send($dsl, $context)
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/Executor/FileExecutor.php 1 patch
Doc Comments   +4 added lines, -3 removed lines patch added patch discarded remove patch
@@ -96,7 +96,7 @@  discard block
 block discarded – undo
96 96
     /**
97 97
      * @param array $dsl
98 98
      * @param array $context
99
-     * @return true
99
+     * @return boolean
100 100
      * @throws \Exception
101 101
      */
102 102
     protected function copy($dsl, $context)
@@ -128,7 +128,7 @@  discard block
 block discarded – undo
128 128
     /**
129 129
      * @param array $dsl
130 130
      * @param array $context
131
-     * @return true
131
+     * @return boolean
132 132
      * @throws \Exception
133 133
      */
134 134
     protected function move($dsl, $context)
@@ -160,7 +160,7 @@  discard block
 block discarded – undo
160 160
     /**
161 161
      * @param array $dsl
162 162
      * @param array $context
163
-     * @return true
163
+     * @return boolean
164 164
      * @throws \Exception
165 165
      */
166 166
     protected function delete($dsl, $context)
@@ -236,6 +236,7 @@  discard block
 block discarded – undo
236 236
      * Replaces any references inside a string
237 237
      *
238 238
      * @param string
239
+     * @param string $text
239 240
      * @return string
240 241
      */
241 242
     protected function resolveReferencesInText($text)
Please login to merge, or discard this patch.
Core/StorageHandler/Database/Migration.php 2 patches
Doc Comments   +3 added lines patch added patch discarded remove patch
@@ -447,6 +447,9 @@
 block discarded – undo
447 447
         );
448 448
     }
449 449
 
450
+    /**
451
+     * @param APIMigration $migration
452
+     */
450 453
     protected function getEntityName($migration)
451 454
     {
452 455
         return end(explode('\\', get_class($migration)));
Please login to merge, or discard this 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.
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
@@ -85,7 +85,9 @@  discard block
 block discarded – undo
85 85
 
86 86
                     $query = new Query();
87 87
                     $query->limit = self::INT_MAX_16BIT;
88
-                    if (isset($query->performCount)) $query->performCount = false;
88
+                    if (isset($query->performCount)) {
89
+                        $query->performCount = false;
90
+                    }
89 91
                     $query->filter = $this->getQueryCriterion($key, $values);
90 92
                     switch ($key) {
91 93
                         case 'content_type_id':
@@ -206,7 +208,9 @@  discard block
 block discarded – undo
206 208
     {
207 209
         $query = new Query();
208 210
         $query->limit = self::INT_MAX_16BIT;
209
-        if (isset($query->performCount)) $query->performCount = false;
211
+        if (isset($query->performCount)) {
212
+            $query->performCount = false;
213
+        }
210 214
         $query->filter = new Query\Criterion\ParentLocationId($parentLocationIds);
211 215
         $results = $this->repository->getSearchService()->findContent($query);
212 216
 
@@ -246,7 +250,9 @@  discard block
 block discarded – undo
246 250
     {
247 251
         $query = new Query();
248 252
         $query->limit = self::INT_MAX_16BIT;
249
-        if (isset($query->performCount)) $query->performCount = false;
253
+        if (isset($query->performCount)) {
254
+            $query->performCount = false;
255
+        }
250 256
         $query->filter = new Query\Criterion\ContentTypeIdentifier($contentTypeIdentifiers);
251 257
         // sort objects by depth, lower to higher, so that deleting them has less chances of failure
252 258
         // NB: we only do this in eZP versions that allow depth sorting on content queries
@@ -274,7 +280,9 @@  discard block
 block discarded – undo
274 280
     {
275 281
         $query = new Query();
276 282
         $query->limit = self::INT_MAX_16BIT;
277
-        if (isset($query->performCount)) $query->performCount = false;
283
+        if (isset($query->performCount)) {
284
+            $query->performCount = false;
285
+        }
278 286
         $query->filter = new Query\Criterion\ContentTypeId($contentTypeIds);
279 287
         // sort objects by depth, lower to higher, so that deleting them has less chances of failure
280 288
         // NB: we only do this in eZP versions that allow depth sorting on content queries
Please login to merge, or discard this patch.
Core/Executor/RepositoryExecutor.php 2 patches
Doc Comments   +3 added lines patch added patch discarded remove patch
@@ -216,6 +216,9 @@
 block discarded – undo
216 216
         return preg_replace('/(?<!^)[A-Z]/', ' $0', $className);
217 217
     }
218 218
 
219
+    /**
220
+     * @param AbstractCollection $collection
221
+     */
219 222
     protected function getCollectionName($collection)
220 223
     {
221 224
         $className = get_class($collection);
Please login to merge, or discard this patch.
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -161,7 +161,7 @@  discard block
 block discarded – undo
161 161
     {
162 162
         // allow setting *some* refs even when we have 0 or N matches
163 163
         foreach ($referencesDefinition as $key => $reference) {
164
-            switch($reference['attribute']) {
164
+            switch ($reference['attribute']) {
165 165
 
166 166
                 case 'count':
167 167
                     $value = count($entity);
@@ -197,7 +197,7 @@  discard block
 block discarded – undo
197 197
                     throw new \InvalidArgumentException($this->getSelfName() . ' does not support setting references for multiple ' . $this->getCollectionName($entity) . 's');
198 198
                 }
199 199
                 if (count($entity) == 0) {
200
-                    throw new \InvalidArgumentException($this->getSelfName() . ' does not support setting references for no ' . $this->getCollectionName($entity). 's');
200
+                    throw new \InvalidArgumentException($this->getSelfName() . ' does not support setting references for no ' . $this->getCollectionName($entity) . 's');
201 201
                 }
202 202
             }
203 203
 
Please login to merge, or discard this patch.