Skip to content

Commit

Permalink
improve some scrutinizer issues
Browse files Browse the repository at this point in the history
different types
unused vars
PHPDocs
  • Loading branch information
Klap-in committed Sep 28, 2014
1 parent b79379f commit 21d806c
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 7 deletions.
6 changes: 6 additions & 0 deletions inc/media.php
Expand Up @@ -582,6 +582,12 @@ function media_notify($id,$file,$mime,$old_rev=false){

/**
* List all files in a given Media namespace
*
* @param string $ns namespace
* @param null|int $auth permission level
* @param string $jump
* @param bool $fullscreenview
* @param bool|string $sort sorting, false skips sorting
*/
function media_filelist($ns,$auth=null,$jump='',$fullscreenview=false,$sort=false){
global $conf;
Expand Down
4 changes: 2 additions & 2 deletions inc/plugin.php
Expand Up @@ -53,11 +53,11 @@ public function getPluginType() {
return $t;
}
public function getPluginName() {
list($t, $p, $n) = explode('_', get_class($this), 4);
list(/* $t */, /* $p */, $n) = explode('_', get_class($this), 4);
return $n;
}
public function getPluginComponent() {
list($t, $p, $n, $c) = explode('_', get_class($this), 4);
list(/* $t */, /* $p */, /* $n */, $c) = explode('_', get_class($this), 4);
return (isset($c)?$c:'');
}

Expand Down
26 changes: 21 additions & 5 deletions inc/template.php
Expand Up @@ -456,6 +456,12 @@ function _tpl_metaheaders_action($data) {
* Just builds a link.
*
* @author Andreas Gohr <andi@splitbrain.org>
*
* @param string $url
* @param string $name
* @param string $more
* @param bool $return if true return the link html, otherwise print
* @return bool|string html of the link, or true if printed
*/
function tpl_link($url, $name, $more = '', $return = false) {
$out = '<a href="'.$url.'" ';
Expand All @@ -472,6 +478,10 @@ function tpl_link($url, $name, $more = '', $return = false) {
* Wrapper around html_wikilink
*
* @author Andreas Gohr <andi@splitbrain.org>
*
* @param string $id page id
* @param string|null $name link name
* @return bool true
*/
function tpl_pagelink($id, $name = null) {
print '<bdi>'.html_wikilink($id, $name).'</bdi>';
Expand Down Expand Up @@ -534,6 +544,13 @@ function tpl_button($type, $return = false) {
*
* @author Adrian Lang <mail@adrianlang.de>
* @see tpl_get_action
*
* @param string $type action name
* @param string $pre prefix of link
* @param string $suf suffix of link
* @param string $inner inner HTML for link
* @param bool $return if true it returns html, otherwise prints
* @return bool|string html of action link or false if nothing, or true if printed
*/
function tpl_actionlink($type, $pre = '', $suf = '', $inner = '', $return = false) {
global $lang;
Expand Down Expand Up @@ -571,7 +588,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;
Expand Down Expand Up @@ -747,7 +764,6 @@ function tpl_get_action($type) {
break;
default:
return '[unknown %s type]';
break;
}
return compact('accesskey', 'type', 'id', 'method', 'params', 'nofollow', 'replacement');
}
Expand All @@ -768,9 +784,9 @@ function tpl_get_action($type) {
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>";

Expand Down Expand Up @@ -1027,7 +1043,7 @@ function tpl_pagetitle($id = null, $ret = false) {
* Only allowed in: detail.php
*
* @author Andreas Gohr <andi@splitbrain.org>
* @param array $tags tags to try
* @param array|string $tags tag or array of 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
* @return string
Expand Down

0 comments on commit 21d806c

Please sign in to comment.