From e0c26282a603881e8d2f839d94c28dbbfc57d71b Mon Sep 17 00:00:00 2001
From: Gerrit Uitslag <klapinklapin@gmail.com>
Date: Mon, 29 Sep 2014 03:34:17 +0200
Subject: scrutinizer documentations issues

---
 lib/plugins/info/syntax.php | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

(limited to 'lib/plugins/info')

diff --git a/lib/plugins/info/syntax.php b/lib/plugins/info/syntax.php
index 9265f44d5..3e3f6b733 100644
--- a/lib/plugins/info/syntax.php
+++ b/lib/plugins/info/syntax.php
@@ -255,7 +255,7 @@ class syntax_plugin_info extends DokuWiki_Syntax_Plugin {
 
         if (($level >= $conf['toptoclevel']) && ($level <= $conf['maxtoclevel'])){
             /** @var $renderer Doku_Renderer_xhtml */
-            $hid  = $renderer->_headerToLink($text, 'true');
+            $hid  = $renderer->_headerToLink($text, true);
             $renderer->toc[] = array(
                 'hid'   => $hid,
                 'title' => $text,
-- 
cgit v1.2.3


From 59bc3b48fdffb76ee65a4b630be3ffa1f6c20c80 Mon Sep 17 00:00:00 2001
From: Gerrit Uitslag <klapinklapin@gmail.com>
Date: Mon, 29 Sep 2014 21:45:27 +0200
Subject: more scrutinizer issue improvements

---
 lib/plugins/info/syntax.php | 13 +++++++++----
 1 file changed, 9 insertions(+), 4 deletions(-)

(limited to 'lib/plugins/info')

diff --git a/lib/plugins/info/syntax.php b/lib/plugins/info/syntax.php
index 3e3f6b733..fc0e1af9d 100644
--- a/lib/plugins/info/syntax.php
+++ b/lib/plugins/info/syntax.php
@@ -104,7 +104,7 @@ class syntax_plugin_info extends DokuWiki_Syntax_Plugin {
      *
      * uses some of the original renderer methods
      */
-    function _plugins_xhtml($type, Doku_Renderer &$renderer){
+    function _plugins_xhtml($type, Doku_Renderer_xhtml $renderer){
         global $lang;
         $renderer->doc .= '<ul>';
 
@@ -142,7 +142,7 @@ class syntax_plugin_info extends DokuWiki_Syntax_Plugin {
      *
      * uses some of the original renderer methods
      */
-    function _helpermethods_xhtml(Doku_Renderer &$renderer){
+    function _helpermethods_xhtml(Doku_Renderer_xhtml $renderer){
         $plugins = plugin_list('helper');
         foreach($plugins as $p){
             if (!$po = plugin_load('helper',$p)) continue;
@@ -249,12 +249,17 @@ class syntax_plugin_info extends DokuWiki_Syntax_Plugin {
 
     /**
      * Adds a TOC item
+     *
+     * @param string $text
+     * @param int $level
+     * @param Doku_Renderer_xhtml $renderer
+     * @return string
      */
-    function _addToTOC($text, $level, Doku_Renderer &$renderer){
+    protected function _addToTOC($text, $level, Doku_Renderer_xhtml $renderer){
         global $conf;
 
+        $hid = '';
         if (($level >= $conf['toptoclevel']) && ($level <= $conf['maxtoclevel'])){
-            /** @var $renderer Doku_Renderer_xhtml */
             $hid  = $renderer->_headerToLink($text, true);
             $renderer->toc[] = array(
                 'hid'   => $hid,
-- 
cgit v1.2.3


From 253d4b48ec708eb42033862dc15c8576f44a48ed Mon Sep 17 00:00:00 2001
From: Gerrit Uitslag <klapinklapin@gmail.com>
Date: Wed, 1 Oct 2014 15:32:05 +0200
Subject: more PHPDocs, unused var, small bit code reformatting

---
 lib/plugins/info/syntax.php | 23 +++++++++++++++++++++--
 1 file changed, 21 insertions(+), 2 deletions(-)

(limited to 'lib/plugins/info')

diff --git a/lib/plugins/info/syntax.php b/lib/plugins/info/syntax.php
index fc0e1af9d..773256faf 100644
--- a/lib/plugins/info/syntax.php
+++ b/lib/plugins/info/syntax.php
@@ -44,9 +44,14 @@ class syntax_plugin_info extends DokuWiki_Syntax_Plugin {
         $this->Lexer->addSpecialPattern('~~INFO:\w+~~',$mode,'plugin_info');
     }
 
-
     /**
      * Handle the match
+     *
+     * @param   string       $match   The text matched by the patterns
+     * @param   int          $state   The lexer state for the match
+     * @param   int          $pos     The character position of the matched text
+     * @param   Doku_Handler $handler The Doku_Handler object
+     * @return  array Return an array with all data you want to use in render
      */
     function handle($match, $state, $pos, Doku_Handler $handler){
         $match = substr($match,7,-2); //strip ~~INFO: from start and ~~ from end
@@ -55,6 +60,11 @@ class syntax_plugin_info extends DokuWiki_Syntax_Plugin {
 
     /**
      * Create output
+     *
+     * @param string $format   string     output format being rendered
+     * @param Doku_Renderer    $renderer  the current renderer object
+     * @param array            $data      data created by handler()
+     * @return  boolean                 rendered correctly?
      */
     function render($format, Doku_Renderer $renderer, $data) {
         if($format == 'xhtml'){
@@ -103,6 +113,9 @@ class syntax_plugin_info extends DokuWiki_Syntax_Plugin {
      * list all installed plugins
      *
      * uses some of the original renderer methods
+     *
+     * @param string $type
+     * @param Doku_Renderer_xhtml $renderer
      */
     function _plugins_xhtml($type, Doku_Renderer_xhtml $renderer){
         global $lang;
@@ -114,7 +127,7 @@ class syntax_plugin_info extends DokuWiki_Syntax_Plugin {
         // remove subparts
         foreach($plugins as $p){
             if (!$po = plugin_load($type,$p)) continue;
-            list($name,$part) = explode('_',$p,2);
+            list($name,/* $part */) = explode('_',$p,2);
             $plginfo[$name] = $po->getInfo();
         }
 
@@ -141,6 +154,8 @@ class syntax_plugin_info extends DokuWiki_Syntax_Plugin {
      * list all installed plugins
      *
      * uses some of the original renderer methods
+     *
+     * @param Doku_Renderer_xhtml $renderer
      */
     function _helpermethods_xhtml(Doku_Renderer_xhtml $renderer){
         $plugins = plugin_list('helper');
@@ -189,6 +204,8 @@ class syntax_plugin_info extends DokuWiki_Syntax_Plugin {
 
     /**
      * lists all known syntax types and their registered modes
+     *
+     * @return string
      */
     function _syntaxtypes_xhtml(){
         global $PARSER_MODES;
@@ -211,6 +228,8 @@ class syntax_plugin_info extends DokuWiki_Syntax_Plugin {
 
     /**
      * lists all known syntax modes and their sorting value
+     *
+     * @return string
      */
     function _syntaxmodes_xhtml(){
         $modes = p_get_parsermodes();
-- 
cgit v1.2.3