@@ -44,7 +44,9 @@ |
||
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) |
@@ -74,8 +74,11 @@ discard block |
||
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 |
||
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 | } |
@@ -59,7 +59,9 @@ discard block |
||
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 |
||
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 | } |