summaryrefslogtreecommitdiff
path: root/inc
diff options
context:
space:
mode:
authorGerrit Uitslag <klapinklapin@gmail.com>2014-09-29 03:34:17 +0200
committerGerrit Uitslag <klapinklapin@gmail.com>2014-09-29 03:34:17 +0200
commite0c26282a603881e8d2f839d94c28dbbfc57d71b (patch)
treeb6b4b7d04d4abc5c6a5121225aefd518d778712b /inc
parentda9572711f54d13ce3c5506971154b0bc359723f (diff)
downloadrpg-e0c26282a603881e8d2f839d94c28dbbfc57d71b.tar.gz
rpg-e0c26282a603881e8d2f839d94c28dbbfc57d71b.tar.bz2
scrutinizer documentations issues
Diffstat (limited to 'inc')
-rw-r--r--inc/HTTPClient.php8
-rw-r--r--inc/Sitemapper.php2
-rw-r--r--inc/actions.php2
-rw-r--r--inc/cache.php4
-rw-r--r--inc/common.php2
-rw-r--r--inc/html.php5
-rw-r--r--inc/media.php108
-rw-r--r--inc/pageutils.php2
-rw-r--r--inc/parser/metadata.php2
-rw-r--r--inc/parser/xhtml.php2
-rw-r--r--inc/plugincontroller.class.php2
-rw-r--r--inc/subscription.php2
-rw-r--r--inc/template.php39
13 files changed, 147 insertions, 33 deletions
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 <andi@splitbrain.org>
*/
+ /**
+ * @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 <andi@splitbrain.org>
*
* @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 <andi@splitbrain.org>
* @author Ben Coburn <btcoburn@silicodon.net>
* @author Kate Arzamastseva <pshns@ukr.net>
+ *
+ * @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 <andi@splitbrain.org>
* @author Kate Arzamastseva <pshns@ukr.net>
+ *
+ * @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 <andi@splitbrain.org>
* @author Kate Arzamastseva <pshns@ukr.net>
+ *
+ * @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 <chi@chimeric.de>
+ *
+ * @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 <pshns@ukr.net>
+ *
+ * @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 <pshns@ukr.net>
+ *
+ * @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 <pshns@ukr.net>
+ *
+ * @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 <pshns@ukr.net>
@@ -912,8 +946,12 @@ function media_preview($image, $auth, $rev=false, $meta=false) {
* Prints mediafile action buttons
*
* @author Kate Arzamastseva <pshns@ukr.net>
+ *
+ * @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 '<ul class="actions">'.NL;
@@ -962,7 +1000,7 @@ function media_preview_buttons($image, $auth, $rev=false) {
*
* @author Kate Arzamastseva <pshns@ukr.net>
* @param string $image
- * @param int $rev
+ * @param int|string $rev
* @param JpegMeta $meta
* @param int $size
* @return array
@@ -986,9 +1024,10 @@ function media_image_preview_size($image, $rev, $meta, $size = 500) {
* Returns the requested EXIF/IPTC tag from the image meta
*
* @author Kate Arzamastseva <pshns@ukr.net>
- * @param array $tags
+ *
+ * @param array $tags
* @param JpegMeta $meta
- * @param string $alt
+ * @param string $alt
* @return string
*/
function media_getTag($tags,$meta,$alt=''){
@@ -1002,6 +1041,7 @@ function media_getTag($tags,$meta,$alt=''){
* Returns mediafile tags
*
* @author Kate Arzamastseva <pshns@ukr.net>
+ *
* @param JpegMeta $meta
* @return array
*/
@@ -1033,7 +1073,13 @@ function media_file_tags($meta) {
*
* @author Kate Arzamastseva <pshns@ukr.net>
*/
-function media_details($image, $auth, $rev=false, $meta=false) {
+/**
+ * @param string $image image id
+ * @param int $auth permission level
+ * @param string|int $rev revision timestamp, or empty string
+ * @param bool|JpegMeta $meta image object, or create one if false
+ */
+function media_details($image, $auth, $rev='', $meta=false) {
global $lang;
if (!$meta) $meta = new JpegMeta(mediaFN($image, $rev));
@@ -1057,6 +1103,13 @@ function media_details($image, $auth, $rev=false, $meta=false) {
*
* @author Kate Arzamastseva <pshns@ukr.net>
*/
+/**
+ * @param string $image image id
+ * @param string $ns
+ * @param int $auth permission level
+ * @param bool $fromajax
+ * @return void|bool|string
+ */
function media_diff($image, $ns, $auth, $fromajax = false) {
global $conf;
global $INPUT;
@@ -1135,6 +1188,13 @@ function _media_file_diff($data) {
* Shows difference between two revisions of image
*
* @author Kate Arzamastseva <pshns@ukr.net>
+ *
+ * @param string $image
+ * @param string|int $l_rev revision timestamp, or empty string
+ * @param string|int $r_rev revision timestamp, or empty string
+ * @param string $ns
+ * @param int $auth permission level
+ * @param bool $fromajax
*/
function media_file_diff($image, $l_rev, $r_rev, $ns, $auth, $fromajax){
global $lang;
@@ -1256,8 +1316,8 @@ function media_file_diff($image, $l_rev, $r_rev, $ns, $auth, $fromajax){
*
* @author Kate Arzamastseva <pshns@ukr.net>
* @param string $image
- * @param int $l_rev
- * @param int $r_rev
+ * @param int $l_rev revision timestamp, or empty string
+ * @param int $r_rev revision timestamp, or empty string
* @param array $l_size
* @param array $r_size
* @param string $type
@@ -1325,6 +1385,12 @@ function media_restore($image, $rev, $auth){
* @author Andreas Gohr <gohr@cosmocode.de>
* @author Kate Arzamastseva <pshns@ukr.net>
* @triggers MEDIA_SEARCH
+ *
+ * @param string $query
+ * @param string $ns
+ * @param null|int $auth
+ * @param bool $fullscreen
+ * @param string $sort
*/
function media_searchlist($query,$ns,$auth=null,$fullscreen=false,$sort='natural'){
global $conf;
@@ -1375,10 +1441,14 @@ function media_searchlist($query,$ns,$auth=null,$fullscreen=false,$sort='natural
/**
* Formats and prints one file in the list
+ *
+ * @param array $item
+ * @param int $auth permission level
+ * @param string $jump item id
+ * @param bool $display_namespace
*/
function media_printfile($item,$auth,$jump,$display_namespace=false){
global $lang;
- global $conf;
// Prepare zebra coloring
// I always wanted to use this variable name :-D
@@ -1472,6 +1542,11 @@ function media_printicon($filename, $size=''){
* Formats and prints one file in the list in the thumbnails view
*
* @author Kate Arzamastseva <pshns@ukr.net>
+ *
+ * @param array $item
+ * @param int $auth
+ * @param bool|string $jump
+ * @param bool $display_namespace
*/
function media_printfile_thumbs($item,$auth,$jump=false,$display_namespace=false){
@@ -1519,6 +1594,9 @@ function media_printfile_thumbs($item,$auth,$jump=false,$display_namespace=false
/**
* Prints a thumbnail and metainfo
+ *
+ * @param array $item
+ * @param bool $fullscreen
*/
function media_printimgdetail($item, $fullscreen=false){
// prepare thumbnail
@@ -1621,6 +1699,10 @@ function media_managerURL($params=false, $amp='&amp;', $abs=false, $params_array
*
* @author Andreas Gohr <andi@splitbrain.org>
* @author Kate Arzamastseva <pshns@ukr.net>
+ *
+ * @param string $ns
+ * @param int $auth permission level
+ * @param bool $fullscreen
*/
function media_uploadform($ns, $auth, $fullscreen = false){
global $lang;
@@ -1708,6 +1790,10 @@ function media_getuploadsize(){
*
* @author Tobias Sarnowski <sarnowski@cosmocode.de>
* @author Kate Arzamastseva <pshns@ukr.net>
+ *
+ * @param string $ns
+ * @param string $query
+ * @param bool $fullscreen
*/
function media_searchform($ns,$query='',$fullscreen=false){
global $lang;
@@ -1735,6 +1821,8 @@ function media_searchform($ns,$query='',$fullscreen=false){
* Build a tree outline of available media namespaces
*
* @author Andreas Gohr <andi@splitbrain.org>
+ *
+ * @param string $ns
*/
function media_nstree($ns){
global $conf;
diff --git a/inc/pageutils.php b/inc/pageutils.php
index 5f62926e4..adfb10cc7 100644
--- a/inc/pageutils.php
+++ b/inc/pageutils.php
@@ -265,7 +265,7 @@ function page_exists($id,$rev='',$clean=true) {
* The filename is URL encoded to protect Unicode chars
*
* @param $raw_id string id of wikipage
- * @param $rev string page revision, empty string for current
+ * @param $rev int|string page revision, empty string for current
* @param $clean bool flag indicating that $raw_id should be cleaned. Only set to false
* when $id is guaranteed to have been cleaned already.
* @return string full path
diff --git a/inc/parser/metadata.php b/inc/parser/metadata.php
index 25bf3fe3d..4619c24ce 100644
--- a/inc/parser/metadata.php
+++ b/inc/parser/metadata.php
@@ -165,7 +165,7 @@ class Doku_Renderer_metadata extends Doku_Renderer {
if(!isset($this->meta['title'])) $this->meta['title'] = $text;
// add the header to the TOC
- $hid = $this->_headerToLink($text, 'true');
+ $hid = $this->_headerToLink($text, true);
$this->toc_additem($hid, $text, $level);
// add to summary
diff --git a/inc/parser/xhtml.php b/inc/parser/xhtml.php
index 44ead9d45..cd4b3d6e5 100644
--- a/inc/parser/xhtml.php
+++ b/inc/parser/xhtml.php
@@ -1571,7 +1571,7 @@ class Doku_Renderer_xhtml extends Doku_Renderer {
* Returns HTML code for images used in link titles
*
* @author Andreas Gohr <andi@splitbrain.org>
- * @param string $img
+ * @param array $img
* @return string HTML img tag or similar
*/
function _imageTitle($img) {
diff --git a/inc/plugincontroller.class.php b/inc/plugincontroller.class.php
index d80cd4c9e..999f32937 100644
--- a/inc/plugincontroller.class.php
+++ b/inc/plugincontroller.class.php
@@ -66,7 +66,7 @@ class Doku_Plugin_Controller {
* @param $name string name of the plugin to load
* @param $new bool true to return a new instance of the plugin, false to use an already loaded instance
* @param $disabled bool true to load even disabled plugins
- * @return DokuWiki_Plugin|DokuWiki_Syntax_Plugin|null the plugin object or null on failure
+ * @return DokuWiki_Plugin|DokuWiki_Syntax_Plugin|DokuWiki_Auth_Plugin|DokuWiki_Admin_Plugin|DokuWiki_Action_Plugin|DokuWiki_Remote_Plugin|null the plugin object or null on failure
*/
public function load($type,$name,$new=false,$disabled=false){
diff --git a/inc/subscription.php b/inc/subscription.php
index aab6de926..dbbcbe16a 100644
--- a/inc/subscription.php
+++ b/inc/subscription.php
@@ -515,7 +515,7 @@ class Subscription {
* @author Adrian Lang <lang@cosmocode.de>
*
* @param string $subscriber_mail The target mail address
- * @param array $id The ID
+ * @param string $id The ID
* @param int $lastupdate Time of the last notification
* @return bool
*/
diff --git a/inc/template.php b/inc/template.php
index 7f3c68534..667e3db1c 100644
--- a/inc/template.php
+++ b/inc/template.php
@@ -204,7 +204,7 @@ function tpl_toc($return = false) {
$toc = $TOC;
} elseif(($ACT == 'show' || substr($ACT, 0, 6) == 'export') && !$REV && $INFO['exists']) {
// get TOC from metadata, render if neccessary
- $meta = p_get_metadata($ID, false, METADATA_RENDER_USING_CACHE);
+ $meta = p_get_metadata($ID, '', METADATA_RENDER_USING_CACHE);
if(isset($meta['internal']['toc'])) {
$tocok = $meta['internal']['toc'];
} else {
@@ -503,6 +503,10 @@ function tpl_getparent($id) {
*
* @author Adrian Lang <mail@adrianlang.de>
* @see tpl_get_action
+ *
+ * @param string $type
+ * @param bool $return
+ * @return bool|string html, or false if no data, true if printed
*/
function tpl_button($type, $return = false) {
$data = tpl_get_action($type);
@@ -534,6 +538,13 @@ function tpl_button($type, $return = false) {
*
* @author Adrian Lang <mail@adrianlang.de>
* @see tpl_get_action
+ *
+ * @param string $type
+ * @param string $pre prefix of link
+ * @param string $suf suffix of link
+ * @param string $inner innerHML of link
+ * @param bool $return
+ * @return bool|string html or false if no data, true if printed
*/
function tpl_actionlink($type, $pre = '', $suf = '', $inner = '', $return = false) {
global $lang;
@@ -571,7 +582,7 @@ function tpl_actionlink($type, $pre = '', $suf = '', $inner = '', $return = fals
$linktarget, $pre.(($inner) ? $inner : $caption).$suf,
'class="action '.$type.'" '.
$akey.$rel.
- 'title="'.hsc($caption).$addTitle.'"', 1
+ 'title="'.hsc($caption).$addTitle.'"', true
);
}
if($return) return $out;
@@ -599,6 +610,7 @@ function tpl_actionlink($type, $pre = '', $suf = '', $inner = '', $return = fals
* @author Andreas Gohr <andi@splitbrain.org>
* @author Matthias Grimm <matthiasgrimm@users.sourceforge.net>
* @author Adrian Lang <mail@adrianlang.de>
+ *
* @param string $type
* @return array|bool|string
*/
@@ -757,20 +769,20 @@ function tpl_get_action($type) {
*
* @author Anika Henke <anika@selfthinker.org>
* @param
- * @param bool $link link or form button?
- * @param bool $wrapper HTML element wrapper
- * @param bool $return return or print
- * @param string $pre prefix for links
- * @param string $suf suffix for links
- * @param string $inner inner HTML for links
+ * @param bool $link link or form button?
+ * @param string|bool $wrapper HTML element wrapper
+ * @param bool $return return or print
+ * @param string $pre prefix for links
+ * @param string $suf suffix for links
+ * @param string $inner inner HTML for links
* @return bool|string
*/
function tpl_action($type, $link = false, $wrapper = false, $return = false, $pre = '', $suf = '', $inner = '') {
$out = '';
if($link) {
- $out .= tpl_actionlink($type, $pre, $suf, $inner, 1);
+ $out .= tpl_actionlink($type, $pre, $suf, $inner, true);
} else {
- $out .= tpl_button($type, 1);
+ $out .= tpl_button($type, true);
}
if($out && $wrapper) $out = "<$wrapper>$out</$wrapper>";
@@ -1029,7 +1041,7 @@ function tpl_pagetitle($id = null, $ret = false) {
* @author Andreas Gohr <andi@splitbrain.org>
* @param array $tags tags to try
* @param string $alt alternative output if no data was found
- * @param null $src the image src, uses global $SRC if not given
+ * @param null|string $src the image src, uses global $SRC if not given
* @return string
*/
function tpl_img_getTag($tags, $alt = '', $src = null) {
@@ -1613,6 +1625,11 @@ function tpl_license($img = 'badge', $imgonly = false, $return = false, $wrap =
*
* This function is useful to populate sidebars or similar features in a
* template
+ *
+ * @param string $pageid
+ * @param bool $print
+ * @param bool $propagate
+ * @return bool|null|string
*/
function tpl_include_page($pageid, $print = true, $propagate = false) {
if (!$pageid) return false;