Passed
Branch master (bc8843)
by Vitalii
08:40
created
src/Comrade42/PhpBBParser/Command/ParseForumsCommand.php 2 patches
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -47,7 +47,7 @@  discard block
 block discarded – undo
47 47
         if ($status != 200) return;
48 48
 
49 49
         $crawler->filter('#main-content div.forabg')->each(
50
-            function (Crawler $node, $index) use ($output, $entityManager, $entityBridge, $dialogHelper)
50
+            function(Crawler $node, $index) use ($output, $entityManager, $entityBridge, $dialogHelper)
51 51
             {
52 52
                 $categoryId = $index + 1;
53 53
                 $parsedName = $node->filter('ul.topiclist li.header dd.dterm h2')->text();
@@ -67,7 +67,7 @@  discard block
 block discarded – undo
67 67
                 $entityManager->persist($entity);
68 68
 
69 69
                 $node->filter('ul.forums li.row dd.dterm')->each(
70
-                    function (Crawler $node, $index) use ($output, $entityManager, $entityBridge, $dialogHelper, $categoryId)
70
+                    function(Crawler $node, $index) use ($output, $entityManager, $entityBridge, $dialogHelper, $categoryId)
71 71
                     {
72 72
                         $link = $node->filter('a.forumtitle');
73 73
                         $forumId = substr($link->attr('href'), 2, -6);
Please login to merge, or discard this patch.
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -44,7 +44,9 @@
 block discarded – undo
44 44
         $status = $client->getInternalResponse()->getStatus();
45 45
         $output->writeln("<info>[{$status}]</info>");
46 46
 
47
-        if ($status != 200) return;
47
+        if ($status != 200) {
48
+         return;
49
+        }
48 50
 
49 51
         $crawler->filter('#main-content div.forabg')->each(
50 52
             function (Crawler $node, $index) use ($output, $entityManager, $entityBridge, $dialogHelper)
Please login to merge, or discard this patch.
src/Comrade42/PhpBBParser/Command/ParseTopicsCommand.php 2 patches
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -67,7 +67,7 @@  discard block
 block discarded – undo
67 67
             }
68 68
 
69 69
             $crawler = $crawler->filter('#main-content ul.topics li.row');
70
-            $crawler->each(function (Crawler $node, $index) use ($output, $entityManager, $entityBridge, $client, $baseUrl, $forumId)
70
+            $crawler->each(function(Crawler $node, $index) use ($output, $entityManager, $entityBridge, $client, $baseUrl, $forumId)
71 71
             {
72 72
                 $link = $node->filter('dd.dterm a.topictitle');
73 73
                 $topicId = intval(substr($link->attr('href'), 2, -6));
@@ -140,7 +140,7 @@  discard block
 block discarded – undo
140 140
                     }
141 141
 
142 142
                     /** @var \Symfony\Component\DomCrawler\Crawler $crawler */
143
-                    $crawler = $crawler->filter('#main-content div.post')->reduce(function (Crawler $node)
143
+                    $crawler = $crawler->filter('#main-content div.post')->reduce(function(Crawler $node)
144 144
                     {
145 145
                         return is_numeric(substr($node->attr('id'), 1));
146 146
                     });
@@ -151,7 +151,7 @@  discard block
 block discarded – undo
151 151
                         $entityManager->persist($topic);
152 152
                     }
153 153
 
154
-                    $crawler->each(function (Crawler $node) use ($output, $entityManager, $entityBridge, $forumId, $topicId)
154
+                    $crawler->each(function(Crawler $node) use ($output, $entityManager, $entityBridge, $forumId, $topicId)
155 155
                     {
156 156
                         $postId = substr($node->attr('id'), 1);
157 157
 
Please login to merge, or discard this patch.
Braces   +11 added lines, -4 removed lines patch added patch discarded remove patch
@@ -74,8 +74,11 @@  discard block
 block discarded – undo
74 74
                 $title = $link->text();
75 75
 
76 76
                 $link = $node->filter('dd.dterm span.span-tab a');
77
-                if ($link->count() == 1) $authorId = intval(substr($link->attr('href'), 2));
78
-                else $authorId = 0;
77
+                if ($link->count() == 1) {
78
+                 $authorId = intval(substr($link->attr('href'), 2));
79
+                } else {
80
+                 $authorId = 0;
81
+                }
79 82
 
80 83
                 preg_match("/background-image:url\('(.+)'\);/iU", $node->filter('dl.icon')->attr('style'), $matches);
81 84
                 $matches = explode('/', $matches[1]);
@@ -183,13 +186,17 @@  discard block
 block discarded – undo
183 186
                         $entityManager->persist($post);
184 187
                     });
185 188
 
186
-                    if ($crawler->count() < ParseTopicsCommand::POSTS_PER_PAGE) break;
189
+                    if ($crawler->count() < ParseTopicsCommand::POSTS_PER_PAGE) {
190
+                     break;
191
+                    }
187 192
                 }
188 193
 
189 194
                 $entityManager->flush();
190 195
             });
191 196
 
192
-            if ($crawler->count() < static::TOPICS_PER_PAGE) break;
197
+            if ($crawler->count() < static::TOPICS_PER_PAGE) {
198
+             break;
199
+            }
193 200
         }
194 201
     }
195 202
 }
Please login to merge, or discard this patch.
src/Comrade42/PhpBBParser/Command/ParseUsersCommand.php 2 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -50,7 +50,7 @@
 block discarded – undo
50 50
             }
51 51
 
52 52
             $crawler = $crawler->filter('#memberlist tbody tr');
53
-            $crawler->each(function (Crawler $node) use ($output, $entityManager, $entityBridge, $dialogHelper) {
53
+            $crawler->each(function(Crawler $node) use ($output, $entityManager, $entityBridge, $dialogHelper) {
54 54
                 $columns = $node->children();
55 55
                 $id = substr($columns->eq(1)->filter('a')->attr('href'), 2);
56 56
                 $nickname = substr($columns->eq(1)->text(), 2);
Please login to merge, or discard this patch.
Braces   +6 added lines, -2 removed lines patch added patch discarded remove patch
@@ -59,7 +59,9 @@  discard block
 block discarded – undo
59 59
                 $memberName = $entity->getNickname();
60 60
 
61 61
                 $question = "<question>Member name doesn't match for #{$id} ({$memberName} → {$nickname}). Update entity? [Y/n]:</question> ";
62
-                if (!empty($memberName) && $memberName != $nickname && !$dialogHelper->askConfirmation($output, $question)) return;
62
+                if (!empty($memberName) && $memberName != $nickname && !$dialogHelper->askConfirmation($output, $question)) {
63
+                 return;
64
+                }
63 65
 
64 66
                 $regDate = \DateTime::createFromFormat('Y-m-d H:i:s', $columns->eq(3)->text() . ' 00:00:00');
65 67
                 $avatarUrl = $columns->eq(1)->filter('a img')->attr('src');
@@ -77,7 +79,9 @@  discard block
 block discarded – undo
77 79
 
78 80
             $entityManager->flush();
79 81
 
80
-            if ($crawler->count() < static::USERS_PER_PAGE) break;
82
+            if ($crawler->count() < static::USERS_PER_PAGE) {
83
+             break;
84
+            }
81 85
         }
82 86
     }
83 87
 }
Please login to merge, or discard this patch.