From e0c26282a603881e8d2f839d94c28dbbfc57d71b Mon Sep 17 00:00:00 2001 From: Gerrit Uitslag Date: Mon, 29 Sep 2014 03:34:17 +0200 Subject: scrutinizer documentations issues --- inc/HTTPClient.php | 8 ++- inc/Sitemapper.php | 2 +- inc/actions.php | 2 +- inc/cache.php | 4 +- inc/common.php | 2 +- inc/html.php | 5 +- inc/media.php | 108 +++++++++++++++++++++++++++++++++++++---- inc/pageutils.php | 2 +- inc/parser/metadata.php | 2 +- inc/parser/xhtml.php | 2 +- inc/plugincontroller.class.php | 2 +- inc/subscription.php | 2 +- inc/template.php | 39 ++++++++++----- 13 files changed, 147 insertions(+), 33 deletions(-) (limited to 'inc') diff --git a/inc/HTTPClient.php b/inc/HTTPClient.php index cd4c7c4c5..ea20e3e56 100644 --- a/inc/HTTPClient.php +++ b/inc/HTTPClient.php @@ -57,6 +57,12 @@ class DokuHTTPClient extends HTTPClient { * @triggers HTTPCLIENT_REQUEST_SEND * @author Andreas Gohr */ + /** + * @param string $url + * @param string|array $data the post data either as array or raw data + * @param string $method + * @return bool + */ function sendRequest($url,$data='',$method='GET'){ $httpdata = array('url' => $url, 'data' => $data, @@ -104,7 +110,7 @@ class HTTPClient { var $header_regexp; // if set this RE must match against the headers, else abort var $headers; var $debug; - var $start = 0; // for timings + var $start = 0.0; // for timings var $keep_alive = true; // keep alive rocks // don't set these, read on error diff --git a/inc/Sitemapper.php b/inc/Sitemapper.php index 6332746a6..33f6d7a36 100644 --- a/inc/Sitemapper.php +++ b/inc/Sitemapper.php @@ -53,7 +53,7 @@ class Sitemapper { foreach($pages as $id){ //skip hidden, non existing and restricted files if(isHiddenPage($id)) continue; - if(auth_aclcheck($id,'','') < AUTH_READ) continue; + if(auth_aclcheck($id,'',array()) < AUTH_READ) continue; $item = SitemapItem::createFromID($id); if ($item !== null) $items[] = $item; diff --git a/inc/actions.php b/inc/actions.php index ef09a0dc7..2b819a0d6 100644 --- a/inc/actions.php +++ b/inc/actions.php @@ -394,7 +394,7 @@ function act_save($act){ return 'conflict'; //save it - saveWikiText($ID,con($PRE,$TEXT,$SUF,1),$SUM,$INPUT->bool('minor')); //use pretty mode for con + saveWikiText($ID,con($PRE,$TEXT,$SUF,true),$SUM,$INPUT->bool('minor')); //use pretty mode for con //unlock it unlock($ID); diff --git a/inc/cache.php b/inc/cache.php index 6817e771b..191d54e45 100644 --- a/inc/cache.php +++ b/inc/cache.php @@ -316,7 +316,7 @@ class cache_instructions extends cache_parser { * retrieve the cached data * * @param bool $clean true to clean line endings, false to leave line endings alone - * @return string cache contents + * @return array cache contents */ public function retrieveCache($clean=true) { $contents = io_readFile($this->cache, false); @@ -326,7 +326,7 @@ class cache_instructions extends cache_parser { /** * cache $instructions * - * @param string $instructions the instruction to be cached + * @param array $instructions the instruction to be cached * @return bool true on success, false otherwise */ public function storeCache($instructions) { diff --git a/inc/common.php b/inc/common.php index e56285f62..95ea4e72d 100644 --- a/inc/common.php +++ b/inc/common.php @@ -968,7 +968,7 @@ function rawLocale($id, $ext = 'txt') { * @author Andreas Gohr * * @param string $id page id - * @param string $rev timestamp when a revision of wikitext is desired + * @param string|int $rev timestamp when a revision of wikitext is desired * @return string */ function rawWiki($id, $rev = '') { diff --git a/inc/html.php b/inc/html.php index bda6fb398..dd4a3d8da 100644 --- a/inc/html.php +++ b/inc/html.php @@ -422,6 +422,9 @@ function html_locked(){ * @author Andreas Gohr * @author Ben Coburn * @author Kate Arzamastseva + * + * @param int $first skip the first n changelog lines + * @param bool|string $media_id id of media, or false for current page */ function html_revisions($first=0, $media_id = false){ global $ID; @@ -926,7 +929,7 @@ function html_li_default($item){ * @param array $data array with item arrays * @param string $class class of ul wrapper * @param callable $func callback to print an list item - * @param string $lifunc callback to the opening li tag + * @param callable $lifunc callback to the opening li tag * @param bool $forcewrapper Trigger building a wrapper ul if the first level is 0 (we have a root object) or 1 (just the root content) * @return string html of an unordered list diff --git a/inc/media.php b/inc/media.php index 9022858e1..2b802a0ae 100644 --- a/inc/media.php +++ b/inc/media.php @@ -41,6 +41,11 @@ function media_filesinuse($data,$id){ * * @author Andreas Gohr * @author Kate Arzamastseva + * + * @param string $id media id + * @param int $auth permission level + * @param array $data + * @return bool */ function media_metasave($id,$auth,$data){ if($auth < AUTH_UPLOAD) return false; @@ -113,6 +118,10 @@ function media_ispublic($id){ * * @author Andreas Gohr * @author Kate Arzamastseva + * + * @param string $id media id + * @param int $auth permission level + * @return bool */ function media_metaform($id,$auth){ global $lang; @@ -175,6 +184,9 @@ function media_metaform($id,$auth){ * Convenience function to check if a media file is still in use * * @author Michael Klier + * + * @param string $id media id + * @return array|bool */ function media_inuse($id) { global $conf; @@ -367,9 +379,18 @@ function copy_uploaded_file($from, $to){ * $data[2] id: the future directory id of the uploaded file * $data[3] imime: the mimetype of the uploaded file * $data[4] overwrite: if an existing file is going to be overwritten + * $data[5] move: * * @triggers MEDIA_UPLOAD_FINISH */ +/** + * @param array $file + * @param string $id + * @param bool $ow + * @param int $auth permission level + * @param string $move function name + * @return array|mixed + */ function media_save($file, $id, $ow, $auth, $move) { if($auth < AUTH_UPLOAD) { return array("You don't have permissions to upload files.", -1); @@ -817,8 +838,13 @@ function media_tab_search($ns,$auth=null) { * Prints tab that displays mediafile details * * @author Kate Arzamastseva + * + * @param string $image media id + * @param string $ns + * @param null|int $auth permission level + * @param string|int $rev */ -function media_tab_view($image, $ns, $auth=null, $rev=false) { +function media_tab_view($image, $ns, $auth=null, $rev='') { global $lang; if(is_null($auth)) $auth = auth_quickaclcheck("$ns:*"); @@ -837,6 +863,10 @@ function media_tab_view($image, $ns, $auth=null, $rev=false) { * Prints tab that displays form for editing mediafile metadata * * @author Kate Arzamastseva + * + * @param string $image media id + * @param string $ns + * @param null|int $auth permission level */ function media_tab_edit($image, $ns, $auth=null) { if(is_null($auth)) $auth = auth_quickaclcheck("$ns:*"); @@ -851,6 +881,10 @@ function media_tab_edit($image, $ns, $auth=null) { * Prints tab that displays mediafile revisions * * @author Kate Arzamastseva + * + * @param string $image media id + * @param string $ns + * @param null|int $auth permission level */ function media_tab_history($image, $ns, $auth=null) { global $lang; @@ -875,7 +909,7 @@ function media_tab_history($image, $ns, $auth=null) { * Prints mediafile details * * @param string $image media id - * @param $auth + * @param int $auth permission level * @param int|bool $rev * @param JpegMeta|bool $meta * @author Kate Arzamastseva @@ -912,8 +946,12 @@ function media_preview($image, $auth, $rev=false, $meta=false) { * Prints mediafile action buttons * * @author Kate Arzamastseva + * + * @param string $image media id + * @param int $auth permission level + * @param string|int $rev revision timestamp, or empty string */ -function media_preview_buttons($image, $auth, $rev=false) { +function media_preview_buttons($image, $auth, $rev='') { global $lang, $conf; echo '