From 7bd581b53070ae0938c0ed31fbe6b48e61f109c2 Mon Sep 17 00:00:00 2001 From: jgen Date: Sun, 12 Mar 2017 14:29:35 -0700 Subject: [PATCH] Scrutinizer commets. --- core/imageboard.pack.php | 2 +- core/util.inc.php | 28 ++++++++++++++++++++++++++++ ext/wiki/main.php | 4 ++++ themes/lite/layout.class.php | 2 +- 4 files changed, 34 insertions(+), 2 deletions(-) diff --git a/core/imageboard.pack.php b/core/imageboard.pack.php index 71b57191..755de669 100644 --- a/core/imageboard.pack.php +++ b/core/imageboard.pack.php @@ -1265,7 +1265,7 @@ function add_image($tmpname, $filename, $tags) { * * @param int $orig_width * @param int $orig_height - * @return int[] + * @return integer[] */ function get_thumbnail_size(/*int*/ $orig_width, /*int*/ $orig_height) { global $config; diff --git a/core/util.inc.php b/core/util.inc.php index 21a451ae..36f37cae 100644 --- a/core/util.inc.php +++ b/core/util.inc.php @@ -433,8 +433,20 @@ function endsWith(/*string*/ $haystack, /*string*/ $needle) { } if(!function_exists("mb_strlen")) { // D: + + /** + * @param string $str + */ function mb_strlen($str) {return strlen($str);} + + /** + * @param string $enc + */ function mb_internal_encoding($enc) {} + + /** + * @param string $str + */ function mb_strtolower($str) {return strtolower($str);} } @@ -1028,6 +1040,10 @@ function transload($url, $mfile) { } if (!function_exists('http_parse_headers')) { #http://www.php.net/manual/en/function.http-parse-headers.php#112917 + + /** + * @param string $raw_headers + */ function http_parse_headers ($raw_headers){ $headers = array(); // $headers = []; @@ -1157,9 +1173,21 @@ function log_msg(/*string*/ $section, /*int*/ $priority, /*string*/ $message, $f } // More shorthand ways of logging +/** + * @param string $section + */ function log_debug( /*string*/ $section, /*string*/ $message, $flash=false, $args=array()) {log_msg($section, SCORE_LOG_DEBUG, $message, $flash, $args);} +/** + * @param string $section + */ function log_info( /*string*/ $section, /*string*/ $message, $flash=false, $args=array()) {log_msg($section, SCORE_LOG_INFO, $message, $flash, $args);} +/** + * @param string $section + */ function log_warning( /*string*/ $section, /*string*/ $message, $flash=false, $args=array()) {log_msg($section, SCORE_LOG_WARNING, $message, $flash, $args);} +/** + * @param string $section + */ function log_error( /*string*/ $section, /*string*/ $message, $flash=false, $args=array()) {log_msg($section, SCORE_LOG_ERROR, $message, $flash, $args);} function log_critical(/*string*/ $section, /*string*/ $message, $flash=false, $args=array()) {log_msg($section, SCORE_LOG_CRITICAL, $message, $flash, $args);} diff --git a/ext/wiki/main.php b/ext/wiki/main.php index cd61a1e4..5d5d28da 100644 --- a/ext/wiki/main.php +++ b/ext/wiki/main.php @@ -494,6 +494,10 @@ class Wiki extends Extension { /** * callback function to format the diffence-lines with your 'style' + * @param integer $nr1 + * @param integer $nr2 + * @param string $stat + * @return string */ private function formatline( $nr1, $nr2, $stat, &$value ) { #change to $value if problems if(trim($value) == "") { diff --git a/themes/lite/layout.class.php b/themes/lite/layout.class.php index 1728044f..337d60a3 100644 --- a/themes/lite/layout.class.php +++ b/themes/lite/layout.class.php @@ -241,7 +241,7 @@ EOD; /** * @param string $link - * @param null|string $desc + * @param string $desc * @param string[] $pages_matched * @return null|string */