From 8673a04e3e6febe85a87104acdf3ce3205315685 Mon Sep 17 00:00:00 2001 From: Andreas Gohr Date: Sat, 2 Sep 2023 19:32:15 +0200 Subject: [PATCH] clean up skeletons They should now adhere closer to the coding standard --- skel/action.php | 13 ++++++++----- skel/action_handler.php | 6 +++--- skel/admin.php | 9 +++++---- skel/auth.php | 12 ++++++------ skel/helper.php | 9 +++++---- skel/remote.php | 12 +++++++----- skel/renderer.php | 5 ++--- skel/renderer_xhtml.php | 5 ++--- skel/syntax.php | 10 ++++++---- 9 files changed, 44 insertions(+), 37 deletions(-) diff --git a/skel/action.php b/skel/action.php index dbbdaac..85dba19 100644 --- a/skel/action.php +++ b/skel/action.php @@ -1,19 +1,22 @@ + * @author @@AUTHOR_NAME@@ <@@AUTHOR_MAIL@@> */ -class @@PLUGIN_COMPONENT_NAME@@ extends \dokuwiki\Extension\ActionPlugin +class @@PLUGIN_COMPONENT_NAME@@ extends ActionPlugin { - /** @inheritDoc */ - public function register(Doku_Event_Handler $controller) + public function register(EventHandler $controller) { @@REGISTER@@ } @@HANDLERS@@ } - diff --git a/skel/action_handler.php b/skel/action_handler.php index 2a865d6..f422fa7 100644 --- a/skel/action_handler.php +++ b/skel/action_handler.php @@ -3,10 +3,10 @@ * Event handler for @@EVENT@@ * * @see https://www.dokuwiki.org/devel:events:@@EVENT@@ - * @param Doku_Event $event Event object + * @param Event $event Event object * @param mixed $param optional parameter passed when event was registered * @return void */ - public function @@HANDLER@@(Doku_Event $event, $param) { - + public function @@HANDLER@@(Event $event, $param) + { } diff --git a/skel/admin.php b/skel/admin.php index caa9b8b..3fd7327 100644 --- a/skel/admin.php +++ b/skel/admin.php @@ -1,13 +1,15 @@ + * @author @@AUTHOR_NAME@@ <@@AUTHOR_MAIL@@> */ -class @@PLUGIN_COMPONENT_NAME@@ extends \dokuwiki\Extension\AdminPlugin +class @@PLUGIN_COMPONENT_NAME@@ extends AdminPlugin { - /** @inheritDoc */ public function handle() { @@ -21,4 +23,3 @@ public function html() echo '

' . $this->getLang('menu') . '

'; } } - diff --git a/skel/auth.php b/skel/auth.php index 8dd7d9c..e27420a 100644 --- a/skel/auth.php +++ b/skel/auth.php @@ -1,13 +1,15 @@ + * @author @@AUTHOR_NAME@@ <@@AUTHOR_MAIL@@> */ -class @@PLUGIN_COMPONENT_NAME@@ extends \dokuwiki\Extension\AuthPlugin +class @@PLUGIN_COMPONENT_NAME@@ extends AuthPlugin { - /** @inheritDoc */ public function __construct() { @@ -31,7 +33,6 @@ public function __construct() $this->success = true; } - /** @inheritDoc */ // public function logOff() // { @@ -69,7 +70,7 @@ public function checkPass($user, $pass) } /** @inheritDoc */ - public function getUserData($user, $requireGroups=true) + public function getUserData($user, $requireGroups = true) { /* FIXME implement and return something like this @@ -156,4 +157,3 @@ public function cleanGroup($group) // FIXME implement //} } - diff --git a/skel/helper.php b/skel/helper.php index 32624c9..8215585 100644 --- a/skel/helper.php +++ b/skel/helper.php @@ -1,12 +1,13 @@ + * @author @@AUTHOR_NAME@@ <@@AUTHOR_MAIL@@> */ -class @@PLUGIN_COMPONENT_NAME@@ extends \dokuwiki\Extension\Plugin +class @@PLUGIN_COMPONENT_NAME@@ extends Plugin { - } - diff --git a/skel/remote.php b/skel/remote.php index d232ba1..d171a04 100644 --- a/skel/remote.php +++ b/skel/remote.php @@ -1,13 +1,16 @@ + * @author @@AUTHOR_NAME@@ <@@AUTHOR_MAIL@@> */ -class @@PLUGIN_COMPONENT_NAME@@ extends \dokuwiki\Extension\RemotePlugin +class @@PLUGIN_COMPONENT_NAME@@ extends RemotePlugin { - /** * Example function * @@ -18,10 +21,9 @@ public function myExample($id) // FIXME handle security in your method! $id = cleanID($id); if (auth_quickaclcheck($id) < AUTH_READ) { - throw new RemoteAccessDeniedException('You are not allowed to read this file', 111); + throw new AccessDeniedException('You are not allowed to read this file', 111); } return 'example'; } } - diff --git a/skel/renderer.php b/skel/renderer.php index fb77a29..61b25d2 100644 --- a/skel/renderer.php +++ b/skel/renderer.php @@ -1,13 +1,13 @@ + * @author @@AUTHOR_NAME@@ <@@AUTHOR_MAIL@@> */ class @@PLUGIN_COMPONENT_NAME@@ extends Doku_Renderer { - /** @inheritDoc */ public function getFormat() { @@ -16,4 +16,3 @@ public function getFormat() // FIXME implement all methods of Doku_Renderer here } - diff --git a/skel/renderer_xhtml.php b/skel/renderer_xhtml.php index e30d0a9..6041487 100644 --- a/skel/renderer_xhtml.php +++ b/skel/renderer_xhtml.php @@ -1,13 +1,13 @@ + * @author @@AUTHOR_NAME@@ <@@AUTHOR_MAIL@@> */ class @@PLUGIN_COMPONENT_NAME@@ extends Doku_Renderer_xhtml { - /** * @inheritDoc * Make available as XHTML replacement renderer @@ -22,4 +22,3 @@ public function canRender($format) // FIXME override any methods of Doku_Renderer_xhtml here } - diff --git a/skel/syntax.php b/skel/syntax.php index b439168..9ba69a9 100644 --- a/skel/syntax.php +++ b/skel/syntax.php @@ -1,11 +1,14 @@ + * @author @@AUTHOR_NAME@@ <@@AUTHOR_MAIL@@> */ -class @@PLUGIN_COMPONENT_NAME@@ extends \dokuwiki\Extension\SyntaxPlugin +class @@PLUGIN_COMPONENT_NAME@@ extends SyntaxPlugin { /** @inheritDoc */ public function getType() @@ -41,7 +44,7 @@ public function connectTo($mode) /** @inheritDoc */ public function handle($match, $state, $pos, Doku_Handler $handler) { - $data = array(); + $data = []; return $data; } @@ -56,4 +59,3 @@ public function render($mode, Doku_Renderer $renderer, $data) return true; } } -