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..81582cdf 100644 --- a/core/util.inc.php +++ b/core/util.inc.php @@ -432,12 +432,6 @@ function endsWith(/*string*/ $haystack, /*string*/ $needle) { return (substr($haystack, $start) === $needle); } -if(!function_exists("mb_strlen")) { // D: - function mb_strlen($str) {return strlen($str);} - function mb_internal_encoding($enc) {} - function mb_strtolower($str) {return strtolower($str);} -} - /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *\ * HTML Generation * \* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ @@ -1028,6 +1022,11 @@ 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 + * @return string[] + */ function http_parse_headers ($raw_headers){ $headers = array(); // $headers = []; @@ -1157,10 +1156,40 @@ function log_msg(/*string*/ $section, /*int*/ $priority, /*string*/ $message, $f } // More shorthand ways of logging +/** + * @param string $section + * @param string $message + * @param bool|string $flash + * @param array $args + */ function log_debug( /*string*/ $section, /*string*/ $message, $flash=false, $args=array()) {log_msg($section, SCORE_LOG_DEBUG, $message, $flash, $args);} +/** + * @param string $section + * @param string $message + * @param bool|string $flash + * @param array $args + */ function log_info( /*string*/ $section, /*string*/ $message, $flash=false, $args=array()) {log_msg($section, SCORE_LOG_INFO, $message, $flash, $args);} +/** + * @param string $section + * @param string $message + * @param bool|string $flash + * @param array $args + */ function log_warning( /*string*/ $section, /*string*/ $message, $flash=false, $args=array()) {log_msg($section, SCORE_LOG_WARNING, $message, $flash, $args);} +/** + * @param string $section + * @param string $message + * @param bool|string $flash + * @param array $args + */ function log_error( /*string*/ $section, /*string*/ $message, $flash=false, $args=array()) {log_msg($section, SCORE_LOG_ERROR, $message, $flash, $args);} +/** + * @param string $section + * @param string $message + * @param bool|string $flash + * @param array $args + */ function log_critical(/*string*/ $section, /*string*/ $message, $flash=false, $args=array()) {log_msg($section, SCORE_LOG_CRITICAL, $message, $flash, $args);} @@ -1191,8 +1220,8 @@ function get_request_id() { /** * Remove an item from an array * - * @param $array - * @param $to_remove + * @param array $array + * @param mixed $to_remove * @return array */ function array_remove($array, $to_remove) { @@ -1211,8 +1240,8 @@ function array_remove($array, $to_remove) { * * Also removes duplicate values from the array. * - * @param $array - * @param $element + * @param array $array + * @param mixed $element * @return array */ function array_add($array, $element) { @@ -1226,7 +1255,7 @@ function array_add($array, $element) { /** * Return the unique elements of an array, case insensitively * - * @param $array + * @param array $array * @return array */ function array_iunique($array) { @@ -1250,8 +1279,8 @@ function array_iunique($array) { * * from http://uk.php.net/network * - * @param $IP - * @param $CIDR + * @param string $IP + * @param string $CIDR * @return bool */ function ip_in_range($IP, $CIDR) { @@ -1390,7 +1419,10 @@ function list_files(/*string*/ $base, $_sub_dir="") { return $file_list; } - +/** + * @param string $path + * @return string + */ function path_to_tags($path) { $matches = array(); if(preg_match("/\d+ - (.*)\.([a-zA-Z]+)/", basename($path), $matches)) { diff --git a/ext/index/main.php b/ext/index/main.php index 5d09218b..49e53781 100644 --- a/ext/index/main.php +++ b/ext/index/main.php @@ -161,14 +161,14 @@ class SearchTermParseEvent extends Event { /** @var null|string */ public $term = null; - /** @var null */ + /** @var string[] */ public $context = array(); /** @var \Querylet[] */ public $querylets = array(); /** * @param string|null $term - * @param array $context + * @param string[] $context */ public function __construct($term, array $context) { $this->term = $term; diff --git a/ext/ouroboros_api/main.php b/ext/ouroboros_api/main.php index 8c8a5138..95a69d97 100644 --- a/ext/ouroboros_api/main.php +++ b/ext/ouroboros_api/main.php @@ -776,6 +776,9 @@ class OuroborosAPI extends Extension $page->set_data($response); } + /** + * @param string $type + */ private function createItemXML(XMLWriter &$xml, $type, $item) { $xml->startElement($type); diff --git a/ext/rating/main.php b/ext/rating/main.php index 8345b74b..fffb60f0 100644 --- a/ext/rating/main.php +++ b/ext/rating/main.php @@ -242,7 +242,7 @@ class Ratings extends Extension { } /** - * @param $context + * @param string[] $context * @return bool */ private function no_rating_query($context) { diff --git a/ext/view/theme.php b/ext/view/theme.php index 68e6affe..64bd1a57 100644 --- a/ext/view/theme.php +++ b/ext/view/theme.php @@ -45,6 +45,9 @@ class ViewImageTheme extends Themelet { return "$h_prev | $h_index | $h_next"; } + /** + * @return string + */ protected function build_navigation(Image $image) { $h_pin = $this->build_pin($image); $h_search = " 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/tests/bootstrap.php b/tests/bootstrap.php index 73172759..d17b242a 100644 --- a/tests/bootstrap.php +++ b/tests/bootstrap.php @@ -63,6 +63,9 @@ abstract class ShimmiePHPUnitTestCase extends \PHPUnit_Framework_TestCase { $this->assertNotContains($title, $page->title); } + /** + * @param integer $code + */ protected function assert_response($code) { global $page; $this->assertEquals($code, $page->code); @@ -84,15 +87,24 @@ abstract class ShimmiePHPUnitTestCase extends \PHPUnit_Framework_TestCase { $this->assertContains($text, $this->page_to_text($section)); } + /** + * @param string $text + */ protected function assert_no_text($text, $section=null) { $this->assertNotContains($text, $this->page_to_text($section)); } + /** + * @param string $content + */ protected function assert_content($content) { global $page; $this->assertContains($content, $page->data); } + /** + * @param string $content + */ protected function assert_no_content($content) { global $page; $this->assertNotContains($content, $page->data); 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 */