@@ -78,7 +78,6 @@ discard block |
||
78 | 78 | /** |
79 | 79 | * Fetch git tag for latest version. |
80 | 80 | * |
81 | - * @param null $path Optional path to the versions XML file. |
|
82 | 81 | */ |
83 | 82 | protected function git() |
84 | 83 | { |
@@ -93,7 +92,6 @@ discard block |
||
93 | 92 | /** |
94 | 93 | * Fetch SQL latest patch version. |
95 | 94 | * |
96 | - * @param null $path Optional path to the versions XML file. |
|
97 | 95 | */ |
98 | 96 | protected function sql() |
99 | 97 | { |
@@ -268,6 +268,9 @@ discard block |
||
268 | 268 | } |
269 | 269 | } |
270 | 270 | |
271 | + /** |
|
272 | + * @param integer $property |
|
273 | + */ |
|
271 | 274 | protected function isChanged($property) |
272 | 275 | { |
273 | 276 | return (($this->changes & $property) == $property); |
@@ -309,6 +312,10 @@ discard block |
||
309 | 312 | } |
310 | 313 | } |
311 | 314 | |
315 | + /** |
|
316 | + * @param string $methodOld |
|
317 | + * @param string $methodUse |
|
318 | + */ |
|
312 | 319 | private function deprecated($methodOld, $methodUse) |
313 | 320 | { |
314 | 321 | trigger_error("This method ($methodOld) is deprecated. Please use '$methodUse' instead.", |
@@ -110,10 +110,12 @@ |
||
110 | 110 | $this->changes |= self::UPDATED_GIT_TAG; |
111 | 111 | |
112 | 112 | return $this->versions->git->tag; |
113 | - } else { // They're NOT the same but we were told not to update. |
|
113 | + } else { |
|
114 | +// They're NOT the same but we were told not to update. |
|
114 | 115 | return false; |
115 | 116 | } |
116 | - } else { // They're the same so return true |
|
117 | + } else { |
|
118 | +// They're the same so return true |
|
117 | 119 | return true; |
118 | 120 | } |
119 | 121 | } |
@@ -87,6 +87,9 @@ discard block |
||
87 | 87 | } |
88 | 88 | sleep(2); |
89 | 89 | |
90 | +/** |
|
91 | + * @param string $pane |
|
92 | + */ |
|
90 | 93 | function writelog($pane) |
91 | 94 | { |
92 | 95 | $path = dirname(__FILE__) . "/bin/logs"; |
@@ -100,6 +103,9 @@ discard block |
||
100 | 103 | } |
101 | 104 | } |
102 | 105 | |
106 | +/** |
|
107 | + * @param string $cmd |
|
108 | + */ |
|
103 | 109 | function command_exist($cmd) |
104 | 110 | { |
105 | 111 | $returnVal = exec("which $cmd 2>/dev/null"); |
@@ -101,6 +101,10 @@ discard block |
||
101 | 101 | return $this->pdo->queryOneRow(sprintf('SELECT bookinfo.* FROM bookinfo WHERE bookinfo.id = %d', $id)); |
102 | 102 | } |
103 | 103 | |
104 | + /** |
|
105 | + * @param string $author |
|
106 | + * @param string|null $title |
|
107 | + */ |
|
104 | 108 | public function getBookInfoByName($author, $title) |
105 | 109 | { |
106 | 110 | $pdo = $this->pdo; |
@@ -332,6 +336,9 @@ discard block |
||
332 | 336 | return $browseby; |
333 | 337 | } |
334 | 338 | |
339 | + /** |
|
340 | + * @param string $title |
|
341 | + */ |
|
335 | 342 | public function fetchAmazonProperties($title) |
336 | 343 | { |
337 | 344 | $conf = new GenericConfiguration(); |
@@ -472,6 +479,9 @@ discard block |
||
472 | 479 | } |
473 | 480 | } |
474 | 481 | |
482 | + /** |
|
483 | + * @param string $releasetype |
|
484 | + */ |
|
475 | 485 | public function parseTitle($release_name, $releaseID, $releasetype) |
476 | 486 | { |
477 | 487 | $a = preg_replace('/\d{1,2} \d{1,2} \d{2,4}|(19|20)\d\d|anybody got .+?[a-z]\? |[-._ ](Novel|TIA)([-._ ]|$)|( |\.)HQ(-|\.| )|[\(\)\.\-_ ](AVI|AZW3?|DOC|EPUB|LIT|MOBI|NFO|RETAIL|(si)?PDF|RTF|TXT)[\)\]\.\-_ ](?![a-z0-9])|compleet|DAGSTiDNiNGEN|DiRFiX|\+ extra|r?e ?Books?([\.\-_ ]English|ers)?|azw3?|ePu(b|p)s?|html|mobi|^NEW[\.\-_ ]|PDF([\.\-_ ]English)?|Please post more|Post description|Proper|Repack(fix)?|[\.\-_ ](Chinese|English|French|German|Italian|Retail|Scan|Swedish)|^R4 |Repost|Skytwohigh|TIA!+|TruePDF|V413HAV|(would someone )?please (re)?post.+? "|with the authors name right/i', '', $release_name); |
@@ -354,18 +354,12 @@ discard block |
||
354 | 354 | $apaiIo = new ApaiIO($conf); |
355 | 355 | |
356 | 356 | $response = $apaiIo->runOperation($search); |
357 | - if ($response === false) |
|
358 | - { |
|
357 | + if ($response === false) { |
|
359 | 358 | throw new \Exception("Could not connect to Amazon"); |
360 | - } |
|
361 | - else |
|
362 | - { |
|
363 | - if (isset($response->Items->Item->ItemAttributes->Title)) |
|
364 | - { |
|
359 | + } else { |
|
360 | + if (isset($response->Items->Item->ItemAttributes->Title)) { |
|
365 | 361 | return $response; |
366 | - } |
|
367 | - else |
|
368 | - { |
|
362 | + } else { |
|
369 | 363 | return false; |
370 | 364 | } |
371 | 365 | } |
@@ -455,7 +449,8 @@ discard block |
||
455 | 449 | |
456 | 450 | // Update release. |
457 | 451 | $this->pdo->queryExec(sprintf('UPDATE releases SET bookinfo_id = %d WHERE id = %d', $bookId, $arr['id'])); |
458 | - } else { // Could not parse release title. |
|
452 | + } else { |
|
453 | +// Could not parse release title. |
|
459 | 454 | $this->pdo->queryExec(sprintf('UPDATE releases SET bookinfo_id = %d WHERE id = %d', -2, $arr['id'])); |
460 | 455 | if ($this->echooutput) { |
461 | 456 | echo '.'; |
@@ -177,6 +177,9 @@ |
||
177 | 177 | ]); |
178 | 178 | } |
179 | 179 | |
180 | + /** |
|
181 | + * @param string $category |
|
182 | + */ |
|
180 | 183 | public static function getCategoryValue($category) |
181 | 184 | { |
182 | 185 | return constant('self::' . $category); |
@@ -271,8 +271,9 @@ discard block |
||
271 | 271 | " from categories c left outer join categories cp on cp.id = c.parentid where c.id = %d", $id |
272 | 272 | ) |
273 | 273 | ); |
274 | - if (!$res) |
|
275 | - return null; |
|
274 | + if (!$res) { |
|
275 | + return null; |
|
276 | + } |
|
276 | 277 | |
277 | 278 | $min = intval($res['minsizetoformrelease']); |
278 | 279 | $max = intval($res['maxsizetoformrelease']); |
@@ -427,8 +428,9 @@ discard block |
||
427 | 428 | $temp_array[-1] = "--Please Select--"; |
428 | 429 | } |
429 | 430 | |
430 | - foreach ($categories as $category) |
|
431 | - $temp_array[$category["id"]] = $category["title"]; |
|
431 | + foreach ($categories as $category) { |
|
432 | + $temp_array[$category["id"]] = $category["title"]; |
|
433 | + } |
|
432 | 434 | |
433 | 435 | return $temp_array; |
434 | 436 | } |
@@ -174,6 +174,9 @@ discard block |
||
174 | 174 | return $colored_string; |
175 | 175 | } |
176 | 176 | |
177 | + /** |
|
178 | + * @param string $fg |
|
179 | + */ |
|
177 | 180 | public static function set256($fg, $opt = "None", $bg = "None") |
178 | 181 | { |
179 | 182 | $colored_string = "\033[38;5;" . self::$colors256[$fg]; |
@@ -199,6 +202,9 @@ discard block |
||
199 | 202 | return $infostring; |
200 | 203 | } |
201 | 204 | |
205 | + /** |
|
206 | + * @param string $str |
|
207 | + */ |
|
202 | 208 | public static function notice($str) |
203 | 209 | { |
204 | 210 | $noticstring = "\033[38;5;" . self::$colors256['Blue'] . "mNotice: $str\033[0m\n"; |
@@ -229,12 +235,18 @@ discard block |
||
229 | 235 | return $str; |
230 | 236 | } |
231 | 237 | |
238 | + /** |
|
239 | + * @param string $str |
|
240 | + */ |
|
232 | 241 | public static function alternate($str) |
233 | 242 | { |
234 | 243 | $str = "\033[38;5;" . self::$colors256['DeepPink1'] . "m$str\033[0m\n"; |
235 | 244 | return $str; |
236 | 245 | } |
237 | 246 | |
247 | + /** |
|
248 | + * @param string $str |
|
249 | + */ |
|
238 | 250 | public static function tmuxOrange($str) |
239 | 251 | { |
240 | 252 | $str = "\033[38;5;" . self::$colors256['Orange'] . "m$str\033[0m\n"; |
@@ -253,12 +265,18 @@ discard block |
||
253 | 265 | return $str; |
254 | 266 | } |
255 | 267 | |
268 | + /** |
|
269 | + * @param string $str |
|
270 | + */ |
|
256 | 271 | public static function alternateOver($str) |
257 | 272 | { |
258 | 273 | $str = "\033[38;5;" . self::$colors256['DeepPink1'] . "m$str\033[0m"; |
259 | 274 | return $str; |
260 | 275 | } |
261 | 276 | |
277 | + /** |
|
278 | + * @param string $str |
|
279 | + */ |
|
262 | 280 | public static function warningOver($str) |
263 | 281 | { |
264 | 282 | $str = "\033[38;5;" . self::$colors256['Red'] . "m"; |
@@ -915,6 +915,9 @@ discard block |
||
915 | 915 | return (isset($result['title']) && !empty($result['title']) && isset($result['platform'])) ? $result : false; |
916 | 916 | } |
917 | 917 | |
918 | + /** |
|
919 | + * @param string $platform |
|
920 | + */ |
|
918 | 921 | function getBrowseNode($platform) |
919 | 922 | { |
920 | 923 | switch ($platform) { |
@@ -982,6 +985,9 @@ discard block |
||
982 | 985 | return $nodeId; |
983 | 986 | } |
984 | 987 | |
988 | + /** |
|
989 | + * @param string $nodeName |
|
990 | + */ |
|
985 | 991 | public function matchBrowseNode($nodeName) |
986 | 992 | { |
987 | 993 | $str = ''; |
@@ -501,7 +501,7 @@ discard block |
||
501 | 501 | $con['esrb'] = (string)$amaz->Items->Item->ItemAttributes->ESRBAgeRating; |
502 | 502 | $con['releasedate'] = (string)$amaz->Items->Item->ItemAttributes->ReleaseDate; |
503 | 503 | |
504 | - if(!isset($con['releasedate'])){ |
|
504 | + if(!isset($con['releasedate'])) { |
|
505 | 505 | $con['releasedate'] = ""; |
506 | 506 | } |
507 | 507 | |
@@ -694,13 +694,13 @@ discard block |
||
694 | 694 | $con['cover'] |
695 | 695 | ) |
696 | 696 | ); |
697 | - if($con['cover'] === 1){ |
|
697 | + if($con['cover'] === 1) { |
|
698 | 698 | $con['cover'] = $ri->saveImage($consoleId, $con['coverurl'], $this->imgSavePath, 250, 250); |
699 | 699 | } |
700 | 700 | } else { |
701 | 701 | $consoleId = $check['id']; |
702 | 702 | |
703 | - if($con['cover'] === 1){ |
|
703 | + if($con['cover'] === 1) { |
|
704 | 704 | $con['cover'] = $ri->saveImage($consoleId, $con['coverurl'], $this->imgSavePath, 250, 250); |
705 | 705 | } |
706 | 706 | |
@@ -736,18 +736,12 @@ discard block |
||
736 | 736 | $apaiIo = new ApaiIO($conf); |
737 | 737 | |
738 | 738 | $response = $apaiIo->runOperation($search); |
739 | - if ($response === false) |
|
740 | - { |
|
739 | + if ($response === false) { |
|
741 | 740 | throw new \Exception("Could not connect to Amazon"); |
742 | - } |
|
743 | - else |
|
744 | - { |
|
745 | - if (isset($response->Items->Item->ItemAttributes->Title)) |
|
746 | - { |
|
741 | + } else { |
|
742 | + if (isset($response->Items->Item->ItemAttributes->Title)) { |
|
747 | 743 | return $response; |
748 | - } |
|
749 | - else |
|
750 | - { |
|
744 | + } else { |
|
751 | 745 | return false; |
752 | 746 | } |
753 | 747 | } |
@@ -128,6 +128,9 @@ |
||
128 | 128 | return $this->row2Object($row); |
129 | 129 | } |
130 | 130 | |
131 | + /** |
|
132 | + * @param Content $content |
|
133 | + */ |
|
131 | 134 | public function validate($content) |
132 | 135 | { |
133 | 136 | if (substr($content->url, 0, 1) != '/') { |
@@ -269,7 +269,7 @@ discard block |
||
269 | 269 | * |
270 | 270 | * @param $encoding |
271 | 271 | * |
272 | - * @return mixed If setting the encoding; returns true on success, else false. |
|
272 | + * @return string|boolean If setting the encoding; returns true on success, else false. |
|
273 | 273 | * When getting, returns the encoding. |
274 | 274 | */ |
275 | 275 | public function encoding($encoding = null) |
@@ -337,7 +337,7 @@ discard block |
||
337 | 337 | * @param string $context |
338 | 338 | * @param array $options |
339 | 339 | * |
340 | - * @return void |
|
340 | + * @return string |
|
341 | 341 | */ |
342 | 342 | public function conditions($conditions, $context, array $options = []) |
343 | 343 | { |