Passed
Push — master ( 5c649b...ed27fb )
by Gaetano
04:01
created
Core/Matcher/TagMatcher.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -156,7 +156,7 @@
 block discarded – undo
156 156
             $childTags = $this->findTagsByParentTagIds(array_keys($parentTags));
157 157
             $tags = array_merge($tags, $childTags);
158 158
             $parentTags = $childTags;
159
-        } while (count( $childTags ) > 0);
159
+        } while (count($childTags) > 0);
160 160
 
161 161
         return $tags;
162 162
     }
Please login to merge, or discard this patch.
Command/StatusCommand.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -197,7 +197,7 @@  discard block
 block discarded – undo
197 197
 
198 198
         if ($input->getOption('todo')) {
199 199
             foreach ($data as $migrationData) {
200
-                $output->writeln("$migrationData", OutputInterface::OUTPUT_RAW|OutputInterface::VERBOSITY_QUIET);
200
+                $output->writeln("$migrationData", OutputInterface::OUTPUT_RAW | OutputInterface::VERBOSITY_QUIET);
201 201
             }
202 202
             return 0;
203 203
         }
@@ -226,7 +226,7 @@  discard block
 block discarded – undo
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) {
Please login to merge, or discard this patch.
Command/MassMigrateCommand.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -180,14 +180,14 @@  discard block
 block discarded – undo
180 180
         }
181 181
 
182 182
         $missed = $total - $this->migrationsDone[Migration::STATUS_DONE] - $this->migrationsDone[Migration::STATUS_FAILED] - $this->migrationsDone[Migration::STATUS_SKIPPED];
183
-        $this->writeln("\nExecuted ".$this->migrationsDone[Migration::STATUS_DONE].' migrations'.
184
-            ', failed '.$this->migrationsDone[Migration::STATUS_FAILED].
185
-            ', skipped '.$this->migrationsDone[Migration::STATUS_SKIPPED].
183
+        $this->writeln("\nExecuted " . $this->migrationsDone[Migration::STATUS_DONE] . ' migrations' .
184
+            ', failed ' . $this->migrationsDone[Migration::STATUS_FAILED] .
185
+            ', skipped ' . $this->migrationsDone[Migration::STATUS_SKIPPED] .
186 186
             ($missed ? ", missed $missed" : ''));
187 187
 
188 188
         $time = microtime(true) - $start;
189 189
         // since we use subprocesses, we can not measure max memory used
190
-        $this->writeln("<info>Time taken: ".sprintf('%.3f', $time)." secs</info>");
190
+        $this->writeln("<info>Time taken: " . sprintf('%.3f', $time) . " secs</info>");
191 191
 
192 192
         return $subprocessesFailed + $this->migrationsDone[Migration::STATUS_FAILED] + $missed;
193 193
     }
@@ -241,7 +241,7 @@  discard block
 block discarded – undo
241 241
         foreach ($toExecute as  $name => $migrationDefinition) {
242 242
             // let's skip migrations that we know are invalid - user was warned and he decided to proceed anyway
243 243
             if ($migrationDefinition->status == MigrationDefinition::STATUS_INVALID) {
244
-                $this->writeln("<comment>Skipping migration (invalid definition?) Path: ".$migrationDefinition->path."</comment>", self::$VERBOSITY_CHILD);
244
+                $this->writeln("<comment>Skipping migration (invalid definition?) Path: " . $migrationDefinition->path . "</comment>", self::$VERBOSITY_CHILD);
245 245
                 $skipped++;
246 246
                 continue;
247 247
             }
@@ -314,7 +314,7 @@  discard block
 block discarded – undo
314 314
      * @param string $buffer
315 315
      * @param null|\Symfony\Component\Process\Process $process
316 316
      */
317
-    public function onChildProcessOutput($type, $buffer, $process=null)
317
+    public function onChildProcessOutput($type, $buffer, $process = null)
318 318
     {
319 319
         $lines = explode("\n", trim($buffer));
320 320
 
@@ -332,7 +332,7 @@  discard block
 block discarded – undo
332 332
 
333 333
             // we tag the output with the id of the child process
334 334
             if (trim($line) !== '') {
335
-                $msg = '[' . ($process ? $process->getPid() : ''). '] ' . trim($line);
335
+                $msg = '[' . ($process ? $process->getPid() : '') . '] ' . trim($line);
336 336
                 if ($type == 'err') {
337 337
                     $this->writeErrorln($msg, OutputInterface::VERBOSITY_QUIET, OutputInterface::OUTPUT_RAW);
338 338
                 } else {
@@ -408,7 +408,7 @@  discard block
 block discarded – undo
408 408
     {
409 409
         $output->writeln('Found ' . count($toExecute) . ' migrations in ' . count($paths) . ' directories');
410 410
         $output->writeln('In the same directories, migrations previously executed: ' . $this->migrationsAlreadyDone[Migration::STATUS_DONE] .
411
-            ', failed: ' . $this->migrationsAlreadyDone[Migration::STATUS_FAILED] . ', skipped: '. $this->migrationsAlreadyDone[Migration::STATUS_SKIPPED]);
411
+            ', failed: ' . $this->migrationsAlreadyDone[Migration::STATUS_FAILED] . ', skipped: ' . $this->migrationsAlreadyDone[Migration::STATUS_SKIPPED]);
412 412
         if ($this->migrationsAlreadyDone[Migration::STATUS_STARTED]) {
413 413
             $output->writeln('<info>In the same directories, migrations currently executing: ' . $this->migrationsAlreadyDone[Migration::STATUS_STARTED] . '</info>');
414 414
         }
Please login to merge, or discard this patch.
Command/ResumeCommand.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -131,7 +131,7 @@
 block discarded – undo
131 131
 
132 132
         $time = microtime(true) - $start;
133 133
         $output->writeln("Resumed $executed migrations, failed $failed");
134
-        $output->writeln("Time taken: ".sprintf('%.3f', $time)." secs, memory: ".sprintf('%.2f', (memory_get_peak_usage(true) / 1000000)). ' MB');
134
+        $output->writeln("Time taken: " . sprintf('%.3f', $time) . " secs, memory: " . sprintf('%.2f', (memory_get_peak_usage(true) / 1000000)) . ' MB');
135 135
 
136 136
         if ($failed) {
137 137
             return 2;
Please login to merge, or discard this patch.
Command/AbstractCommand.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -100,7 +100,7 @@
 block discarded – undo
100 100
             } else if (strpos($path, './') === 0) {
101 101
                 $paths[$i] = substr($path, 2);
102 102
             // q: should we also call realpath on $path? what if there are symlinks at play?
103
-            } elseif (strpos($path, $rootDir) === 0 ) {
103
+            } elseif (strpos($path, $rootDir) === 0) {
104 104
                 $paths[$i] = substr($path, strlen($rootDir));
105 105
             } elseif ($path === '') {
106 106
                 unset($paths[$i]);
Please login to merge, or discard this patch.
Command/GenerateCommand.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -162,7 +162,7 @@
 block discarded – undo
162 162
         }
163 163
 
164 164
         // allow to generate migrations for many entities
165
-        if (strpos($matchValue, ',') !== false ) {
165
+        if (strpos($matchValue, ',') !== false) {
166 166
             $matchValue = explode(',', $matchValue);
167 167
         }
168 168
 
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
@@ -250,9 +250,9 @@  discard block
 block discarded – undo
250 250
         $time = microtime(true) - $start;
251 251
         if ($input->getOption('separate-process')) {
252 252
             // in case of using subprocesses, we can not measure max memory used
253
-            $this->writeln("<info>Time taken: ".sprintf('%.3f', $time)." secs</info>");
253
+            $this->writeln("<info>Time taken: " . sprintf('%.3f', $time) . " secs</info>");
254 254
         } else {
255
-            $this->writeln("<info>Time taken: ".sprintf('%.3f', $time)." secs, memory: ".sprintf('%.2f', (memory_get_peak_usage(true) / 1000000)). ' MB</info>');
255
+            $this->writeln("<info>Time taken: " . sprintf('%.3f', $time) . " secs, memory: " . sprintf('%.2f', (memory_get_peak_usage(true) / 1000000)) . ' MB</info>');
256 256
         }
257 257
 
258 258
         return $failed;
@@ -484,7 +484,7 @@  discard block
 block discarded – undo
484 484
             $builderArgs[] = '--no-debug';
485 485
         }
486 486
         if ($input->getOption('siteaccess')) {
487
-            $builderArgs[] = '--siteaccess='.$input->getOption('siteaccess');
487
+            $builderArgs[] = '--siteaccess=' . $input->getOption('siteaccess');
488 488
         }
489 489
         switch ($this->verbosity) {
490 490
             case OutputInterface::VERBOSITY_VERBOSE:
Please login to merge, or discard this patch.
Core/Matcher/ContentVersionMatcher.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -2,7 +2,7 @@  discard block
 block discarded – undo
2 2
 
3 3
 namespace Kaliop\eZMigrationBundle\Core\Matcher;
4 4
 
5
-use eZ\Publish\API\Repository\Exceptions\UnauthorizedException ;
5
+use eZ\Publish\API\Repository\Exceptions\UnauthorizedException;
6 6
 use eZ\Publish\API\Repository\Repository;
7 7
 use eZ\Publish\API\Repository\Values\Content\Content;
8 8
 use eZ\Publish\API\Repository\Values\Content\VersionInfo;
@@ -204,14 +204,14 @@  discard block
 block discarded – undo
204 204
         $i = 0;
205 205
         foreach ($contentVersions as $versionKey => $versionInfo) {
206 206
             foreach ($values as $acceptedVersionNo) {
207
-                if ($acceptedVersionNo > 0 ) {
207
+                if ($acceptedVersionNo > 0) {
208 208
                     if ($acceptedVersionNo == $versionInfo->versionNo) {
209 209
                         $versions[$versionKey] = $versionInfo;
210 210
                         break;
211 211
                     }
212 212
                 } else {
213 213
                     // negative $acceptedVersionNo means 'leave the last X versions', eg: -1 = leave the last version
214
-                    if ($i < $contentVersionsCount + $acceptedVersionNo)  {
214
+                    if ($i < $contentVersionsCount + $acceptedVersionNo) {
215 215
                         $versions[$versionKey] = $versionInfo;
216 216
                         break;
217 217
 
Please login to merge, or discard this patch.
Core/Matcher/QueryBasedMatcher.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -155,7 +155,7 @@  discard block
 block discarded – undo
155 155
                     return new Query\Criterion\Field($attribute, self::$operatorsMap[$operator], $match);
156 156
                 } else {
157 157
                     /// @todo make the list of unary operators more flexible
158
-                    switch($spec) {
158
+                    switch ($spec) {
159 159
                         case 'empty':
160 160
                             return new Query\Criterion\IsFieldEmpty($attribute);
161 161
                         default:
@@ -301,7 +301,7 @@  discard block
 block discarded – undo
301 301
 
302 302
             $direction = $this->hash2SortOrder($sortItem['sort_order']);
303 303
 
304
-            switch($sortItem['sort_field']) {
304
+            switch ($sortItem['sort_field']) {
305 305
                 case self::SORT_CONTENT_ID:
306 306
                     $out[] = new SortClause\ContentId($direction);
307 307
                     break;
Please login to merge, or discard this patch.