From 946ef22d57af0e77310c1114998078c8002a7e17 Mon Sep 17 00:00:00 2001 From: "Carsten Haitzler (Rasterman)" Date: Sun, 11 Mar 2018 20:47:13 +0900 Subject: [PATCH] fix a bunch of php 7 warnings that fill our php error logs "PHP Warning: Declaration of action_plugin_anewssystem::register(Doku_Event_Handler &$controller) should be compatible with DokuWiki_Action_Plugin::register(Doku_Event_Handler $controller) in /srv/web/enlightenment.org/public_html/lib/plugins/anewssystem/action.php on line 0" these ones... --- public_html/lib/plugins/anewssystem/action.php | 4 ++-- public_html/lib/plugins/anewssystem/syntax.php | 6 +++--- public_html/lib/plugins/clear/syntax.php | 6 +++--- public_html/lib/plugins/codelink/syntax.php | 4 ++-- public_html/lib/plugins/const/syntax.php | 4 ++-- public_html/lib/plugins/html5video/syntax/video.php | 4 ++-- public_html/lib/plugins/itemtable/syntax.php | 6 +++--- 7 files changed, 17 insertions(+), 17 deletions(-) diff --git a/public_html/lib/plugins/anewssystem/action.php b/public_html/lib/plugins/anewssystem/action.php index 1137e0a1..e60f54a1 100644 --- a/public_html/lib/plugins/anewssystem/action.php +++ b/public_html/lib/plugins/anewssystem/action.php @@ -33,7 +33,7 @@ class action_plugin_anewssystem extends DokuWiki_Action_Plugin { /****************************************************************************** ** Register its handlers with the dokuwiki's event controller */ - function register(Doku_Event_Handler &$controller) { + function register(Doku_Event_Handler $controller) { $controller->register_hook('ACTION_ACT_PREPROCESS', 'BEFORE', $this, '_handle_act', array()); $controller->register_hook('TPL_ACT_UNKNOWN', 'BEFORE', $this, 'output', array()); } @@ -231,4 +231,4 @@ class action_plugin_anewssystem extends DokuWiki_Action_Plugin { $event->preventDefault(); } /******************************************************************************/ -} \ No newline at end of file +} diff --git a/public_html/lib/plugins/anewssystem/syntax.php b/public_html/lib/plugins/anewssystem/syntax.php index 01bcd081..1d695e15 100644 --- a/public_html/lib/plugins/anewssystem/syntax.php +++ b/public_html/lib/plugins/anewssystem/syntax.php @@ -43,7 +43,7 @@ class syntax_plugin_anewssystem extends DokuWiki_Syntax_Plugin { /******************************************************************************/ /* handle the match */ - function handle($match, $state, $pos,Doku_Handler &$handler) { + function handle($match, $state, $pos,Doku_Handler $handler) { global $ID, $conf; $match = substr($match,strlen('{{anss>'),-2); //strip markup from start and end @@ -71,7 +71,7 @@ class syntax_plugin_anewssystem extends DokuWiki_Syntax_Plugin { /* render output * @author Taggic */ - function render($mode,Doku_Renderer &$renderer, $ans_conf) { + function render($mode,Doku_Renderer $renderer, $ans_conf) { global $ID, $conf; $xhtml_renderer = new Doku_Renderer_xhtml(); $records = file(DOKU_PLUGIN.'anewssystem/tpl/newstemplate_'.$conf['lang'].'.txt'); @@ -1559,4 +1559,4 @@ class syntax_plugin_anewssystem extends DokuWiki_Syntax_Plugin { return $news_edit_tb; } } -?> \ No newline at end of file +?> diff --git a/public_html/lib/plugins/clear/syntax.php b/public_html/lib/plugins/clear/syntax.php index d76471e7..f1de38dd 100644 --- a/public_html/lib/plugins/clear/syntax.php +++ b/public_html/lib/plugins/clear/syntax.php @@ -27,9 +27,9 @@ class syntax_plugin_clear extends DokuWiki_Syntax_Plugin { function connectTo($mode) { $this->Lexer->addSpecialPattern('',$mode,'plugin_clear'); } - function handle($match, $state, $pos, &$handler){ return array($match, $state, $pos); } - function render($mode, &$renderer, $data) { - if($mode == 'xhtml'){ + function handle($match, $state, $pos, $handler){ return array($match, $state, $pos); } + function render($mode, $renderer, $data) { + if($mode == 'xhtml'){ $renderer->doc .= "
"; return true; } diff --git a/public_html/lib/plugins/codelink/syntax.php b/public_html/lib/plugins/codelink/syntax.php index 0d6ac1ba..55699a5c 100644 --- a/public_html/lib/plugins/codelink/syntax.php +++ b/public_html/lib/plugins/codelink/syntax.php @@ -87,7 +87,7 @@ class syntax_plugin_codelink extends DokuWiki_Syntax_Plugin { * @param Doku_Handler $handler The handler * @return array Data for the renderer */ - public function handle($match, $state, $pos, Doku_Handler &$handler){ + public function handle($match, $state, $pos, Doku_Handler $handler){ $data = array(); if (preg_match('/^~~CODE-/', $match)) { @@ -133,7 +133,7 @@ class syntax_plugin_codelink extends DokuWiki_Syntax_Plugin { * @param array $data The data from the handler() function * @return bool If rendering was successful. */ - public function render($mode, Doku_Renderer &$renderer, $data) { + public function render($mode, Doku_Renderer $renderer, $data) { if ($mode != 'xhtml') return false; $renderer->doc .= $data[0]; return true; diff --git a/public_html/lib/plugins/const/syntax.php b/public_html/lib/plugins/const/syntax.php index 69e28df8..2162699f 100644 --- a/public_html/lib/plugins/const/syntax.php +++ b/public_html/lib/plugins/const/syntax.php @@ -26,11 +26,11 @@ class syntax_plugin_const extends DokuWiki_Syntax_Plugin { $this->Lexer->addSpecialPattern(']*>[^<]*',$mode,'plugin_const'); } - function handle($match, $state, $pos, Doku_Handler &$handler) { + function handle($match, $state, $pos, Doku_Handler $handler) { return array($match, $state, $pos); } - function render($mode, Doku_Renderer &$renderer, $data) { + function render($mode, Doku_Renderer $renderer, $data) { // $data is what the function handle return'ed. if($mode == 'xhtml'){ $renderer->doc .=""; diff --git a/public_html/lib/plugins/html5video/syntax/video.php b/public_html/lib/plugins/html5video/syntax/video.php index ff783007..22803893 100644 --- a/public_html/lib/plugins/html5video/syntax/video.php +++ b/public_html/lib/plugins/html5video/syntax/video.php @@ -43,7 +43,7 @@ class syntax_plugin_html5video_video extends DokuWiki_Syntax_Plugin { $this->Lexer->addSpecialPattern('\{\{[^}]*(?:(?:webm)|(?:ogv)|(?:mp4))(?:\|(?:\d{2,4}x\d{2,4})?(?:\|(?:loop)?,?(?:autoplay)?(?:,loop)?)?)? ?\}\}',$mode,'plugin_html5video_video'); } - public function handle($match, $state, $pos, &$handler){ + public function handle($match, $state, $pos, $handler){ $params = substr($match, strlen('{{'), - strlen('}}')); //Strip markup if(strpos($params, ' ') === 0) { // Space as first character if(substr_compare($params, ' ', -1, 1) === 0) { // Space a front and back = centered @@ -65,7 +65,7 @@ class syntax_plugin_html5video_video extends DokuWiki_Syntax_Plugin { return array(state, explode('|', $params)); } - public function render($mode, &$renderer, $data) { + public function render($mode, $renderer, $data) { if($mode != 'xhtml') return false; list($state, $params) = $data; diff --git a/public_html/lib/plugins/itemtable/syntax.php b/public_html/lib/plugins/itemtable/syntax.php index c78febd2..a07981fe 100644 --- a/public_html/lib/plugins/itemtable/syntax.php +++ b/public_html/lib/plugins/itemtable/syntax.php @@ -47,7 +47,7 @@ class syntax_plugin_itemtable extends DokuWiki_Syntax_Plugin { /** * Handle the match */ - function handle($match, $state, $pos, &$handler){ + function handle($match, $state, $pos, $handler){ switch ($state) { case DOKU_LEXER_ENTER : return array($state, substr($match, 10, -1) ); @@ -177,7 +177,7 @@ class syntax_plugin_itemtable extends DokuWiki_Syntax_Plugin { return $res; } - function render($mode, &$renderer, $data) { + function render($mode, $renderer, $data) { // This will only render in xhtml if($mode == 'xhtml'){ list($state, $match) = $data; @@ -224,4 +224,4 @@ class syntax_plugin_itemtable extends DokuWiki_Syntax_Plugin { } return false; } -} \ No newline at end of file +}