@@ -112,7 +112,9 @@ discard block |
||
112 | 112 | */ |
113 | 113 | final public function isValidTitleURL(string $title_url) : bool { |
114 | 114 | $success = (bool) preg_match($this->titleFormat, $title_url); |
115 | - if(!$success) log_message('error', "Invalid Title URL ({$this->site}): {$title_url}"); |
|
115 | + if(!$success) { |
|
116 | + log_message('error', "Invalid Title URL ({$this->site}): {$title_url}"); |
|
117 | + } |
|
116 | 118 | return $success; |
117 | 119 | } |
118 | 120 | |
@@ -126,7 +128,9 @@ discard block |
||
126 | 128 | */ |
127 | 129 | final public function isValidChapter(string $chapter) : bool { |
128 | 130 | $success = (bool) preg_match($this->chapterFormat, $chapter); |
129 | - if(!$success) log_message('error', "Invalid Chapter ({$this->site}): {$chapter}"); |
|
131 | + if(!$success) { |
|
132 | + log_message('error', "Invalid Chapter ({$this->site}): {$chapter}"); |
|
133 | + } |
|
130 | 134 | return $success; |
131 | 135 | } |
132 | 136 | |
@@ -149,10 +153,16 @@ discard block |
||
149 | 153 | //curl_setopt($ch, CURLOPT_VERBOSE, 1); |
150 | 154 | curl_setopt($ch, CURLOPT_HEADER, 1); |
151 | 155 | |
152 | - if($follow_redirect) curl_setopt($ch, CURLOPT_FOLLOWLOCATION, TRUE); |
|
156 | + if($follow_redirect) { |
|
157 | + curl_setopt($ch, CURLOPT_FOLLOWLOCATION, TRUE); |
|
158 | + } |
|
153 | 159 | |
154 | - if(!empty($cookie_string)) curl_setopt($ch, CURLOPT_COOKIE, $cookie_string); |
|
155 | - if(!empty($cookiejar_path)) curl_setopt($ch, CURLOPT_COOKIEFILE, $cookiejar_path); |
|
160 | + if(!empty($cookie_string)) { |
|
161 | + curl_setopt($ch, CURLOPT_COOKIE, $cookie_string); |
|
162 | + } |
|
163 | + if(!empty($cookiejar_path)) { |
|
164 | + curl_setopt($ch, CURLOPT_COOKIEFILE, $cookiejar_path); |
|
165 | + } |
|
156 | 166 | |
157 | 167 | //Some sites check the useragent for stuff, use a pre-defined user-agent to avoid stuff. |
158 | 168 | curl_setopt($ch, CURLOPT_USERAGENT, 'Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/54.0.2824.0 Safari/537.36'); |
@@ -362,8 +372,12 @@ discard block |
||
362 | 372 | $status = FALSE; |
363 | 373 | |
364 | 374 | //Make sure we have a volume element |
365 | - if(count($oldChapterSegments) === 1) array_unshift($oldChapterSegments, 'v0'); |
|
366 | - if(count($newChapterSegments) === 1) array_unshift($newChapterSegments, 'v0'); |
|
375 | + if(count($oldChapterSegments) === 1) { |
|
376 | + array_unshift($oldChapterSegments, 'v0'); |
|
377 | + } |
|
378 | + if(count($newChapterSegments) === 1) { |
|
379 | + array_unshift($newChapterSegments, 'v0'); |
|
380 | + } |
|
367 | 381 | |
368 | 382 | $oldCount = count($oldChapterSegments); |
369 | 383 | $newCount = count($newChapterSegments); |
@@ -376,8 +390,12 @@ discard block |
||
376 | 390 | $newVolume = substr(array_shift($newChapterSegments), 1); |
377 | 391 | |
378 | 392 | //Forcing volume to 0 as TBD might not be the latest (although it can be, but that is covered by other checks) |
379 | - if(in_array($oldVolume, ['TBD', 'TBA', 'NA', 'LMT'])) $oldVolume = 0; |
|
380 | - if(in_array($newVolume, ['TBD', 'TBA', 'NA', 'LMT'])) $newVolume = 0; |
|
393 | + if(in_array($oldVolume, ['TBD', 'TBA', 'NA', 'LMT'])) { |
|
394 | + $oldVolume = 0; |
|
395 | + } |
|
396 | + if(in_array($newVolume, ['TBD', 'TBA', 'NA', 'LMT'])) { |
|
397 | + $newVolume = 0; |
|
398 | + } |
|
381 | 399 | |
382 | 400 | $oldVolume = floatval($oldVolume); |
383 | 401 | $newVolume = floatval($newVolume); |
@@ -23,7 +23,7 @@ |
||
23 | 23 | |
24 | 24 | $data = $content['body']; |
25 | 25 | $xml = simplexml_load_string($data) or die("Error: Cannot create object"); |
26 | - if(((string) $xml->{'channel'}->title) !== 'Comments on: '){ |
|
26 | + if(((string) $xml->{'channel'}->title) !== 'Comments on: ') { |
|
27 | 27 | if(isset($xml->{'channel'}->item[0])) { |
28 | 28 | $titleData['title'] = trim(substr((string) $xml->{'channel'}->title, 0, -33)); |
29 | 29 |
@@ -75,7 +75,9 @@ discard block |
||
75 | 75 | $arr['series'][$row->category]['manga'][] = $data; |
76 | 76 | |
77 | 77 | if(!$data['title_data']['active']) { |
78 | - if(!$arr['has_inactive']) $arr['has_inactive'] = TRUE; |
|
78 | + if(!$arr['has_inactive']) { |
|
79 | + $arr['has_inactive'] = TRUE; |
|
80 | + } |
|
79 | 81 | $arr['inactive_titles'][$data['full_title_url']] = $data['title_data']['title']; |
80 | 82 | } |
81 | 83 | } |
@@ -111,11 +113,15 @@ discard block |
||
111 | 113 | |
112 | 114 | if($sortOrder == 'asc') { |
113 | 115 | $unreadSort = ($a_text <=> $b_text); |
114 | - if($unreadSort) return $unreadSort; |
|
116 | + if($unreadSort) { |
|
117 | + return $unreadSort; |
|
118 | + } |
|
115 | 119 | return $a_text2 <=> $b_text2; |
116 | 120 | } else { |
117 | 121 | $unreadSort = ($a_text <=> $b_text); |
118 | - if($unreadSort) return $unreadSort; |
|
122 | + if($unreadSort) { |
|
123 | + return $unreadSort; |
|
124 | + } |
|
119 | 125 | return $b_text2 <=> $a_text2; |
120 | 126 | } |
121 | 127 | }); |
@@ -45,7 +45,8 @@ |
||
45 | 45 | |
46 | 46 | $content = $this->get_content($fullURL); |
47 | 47 | $data = $content['body']; |
48 | - if($data !== 'Can\'t find the manga series.') { //FIXME: We should check for he proper error here. |
|
48 | + if($data !== 'Can\'t find the manga series.') { |
|
49 | +//FIXME: We should check for he proper error here. |
|
49 | 50 | $xml = simplexml_load_string($data); |
50 | 51 | if($xml) { |
51 | 52 | if(isset($xml->{'channel'}->item[0])) { |