Skip to content

Commit 8673a04

Browse files
committed
clean up skeletons
They should now adhere closer to the coding standard
1 parent abd1c9c commit 8673a04

File tree

9 files changed

+44
-37
lines changed

9 files changed

+44
-37
lines changed

skel/action.php

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,22 @@
11
<?php
2+
3+
use dokuwiki\Extension\ActionPlugin;
4+
use dokuwiki\Extension\EventHandler;
5+
use dokuwiki\Extension\Event;
6+
27
/**
38
* DokuWiki Plugin @@PLUGIN_NAME@@ (Action Component)
49
*
510
* @license GPL 2 http://www.gnu.org/licenses/gpl-2.0.html
6-
* @author @@AUTHOR_NAME@@ <@@AUTHOR_MAIL@@>
11+
* @author @@AUTHOR_NAME@@ <@@AUTHOR_MAIL@@>
712
*/
8-
class @@PLUGIN_COMPONENT_NAME@@ extends \dokuwiki\Extension\ActionPlugin
13+
class @@PLUGIN_COMPONENT_NAME@@ extends ActionPlugin
914
{
10-
1115
/** @inheritDoc */
12-
public function register(Doku_Event_Handler $controller)
16+
public function register(EventHandler $controller)
1317
{
1418
@@REGISTER@@
1519
}
1620

1721
@@HANDLERS@@
1822
}
19-

skel/action_handler.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@
33
* Event handler for @@EVENT@@
44
*
55
* @see https://www.dokuwiki.org/devel:events:@@EVENT@@
6-
* @param Doku_Event $event Event object
6+
* @param Event $event Event object
77
* @param mixed $param optional parameter passed when event was registered
88
* @return void
99
*/
10-
public function @@HANDLER@@(Doku_Event $event, $param) {
11-
10+
public function @@HANDLER@@(Event $event, $param)
11+
{
1212
}

skel/admin.php

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,15 @@
11
<?php
2+
3+
use dokuwiki\Extension\AdminPlugin;
4+
25
/**
36
* DokuWiki Plugin @@PLUGIN_NAME@@ (Admin Component)
47
*
58
* @license GPL 2 http://www.gnu.org/licenses/gpl-2.0.html
6-
* @author @@AUTHOR_NAME@@ <@@AUTHOR_MAIL@@>
9+
* @author @@AUTHOR_NAME@@ <@@AUTHOR_MAIL@@>
710
*/
8-
class @@PLUGIN_COMPONENT_NAME@@ extends \dokuwiki\Extension\AdminPlugin
11+
class @@PLUGIN_COMPONENT_NAME@@ extends AdminPlugin
912
{
10-
1113
/** @inheritDoc */
1214
public function handle()
1315
{
@@ -21,4 +23,3 @@ public function html()
2123
echo '<h1>' . $this->getLang('menu') . '</h1>';
2224
}
2325
}
24-

skel/auth.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,15 @@
11
<?php
2+
3+
use dokuwiki\Extension\AuthPlugin;
4+
25
/**
36
* DokuWiki Plugin @@PLUGIN_NAME@@ (Auth Component)
47
*
58
* @license GPL 2 http://www.gnu.org/licenses/gpl-2.0.html
6-
* @author @@AUTHOR_NAME@@ <@@AUTHOR_MAIL@@>
9+
* @author @@AUTHOR_NAME@@ <@@AUTHOR_MAIL@@>
710
*/
8-
class @@PLUGIN_COMPONENT_NAME@@ extends \dokuwiki\Extension\AuthPlugin
11+
class @@PLUGIN_COMPONENT_NAME@@ extends AuthPlugin
912
{
10-
1113
/** @inheritDoc */
1214
public function __construct()
1315
{
@@ -31,7 +33,6 @@ public function __construct()
3133
$this->success = true;
3234
}
3335

34-
3536
/** @inheritDoc */
3637
// public function logOff()
3738
// {
@@ -69,7 +70,7 @@ public function checkPass($user, $pass)
6970
}
7071

7172
/** @inheritDoc */
72-
public function getUserData($user, $requireGroups=true)
73+
public function getUserData($user, $requireGroups = true)
7374
{
7475
/*
7576
FIXME implement and return something like this
@@ -156,4 +157,3 @@ public function cleanGroup($group)
156157
// FIXME implement
157158
//}
158159
}
159-

skel/helper.php

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
11
<?php
2+
3+
use dokuwiki\Extension\Plugin;
4+
25
/**
36
* DokuWiki Plugin @@PLUGIN_NAME@@ (Helper Component)
47
*
58
* @license GPL 2 http://www.gnu.org/licenses/gpl-2.0.html
6-
* @author @@AUTHOR_NAME@@ <@@AUTHOR_MAIL@@>
9+
* @author @@AUTHOR_NAME@@ <@@AUTHOR_MAIL@@>
710
*/
8-
class @@PLUGIN_COMPONENT_NAME@@ extends \dokuwiki\Extension\Plugin
11+
class @@PLUGIN_COMPONENT_NAME@@ extends Plugin
912
{
10-
1113
}
12-

skel/remote.php

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,16 @@
11
<?php
2+
3+
use dokuwiki\Extension\RemotePlugin;
4+
use dokuwiki\Remote\AccessDeniedException;
5+
26
/**
37
* DokuWiki Plugin @@PLUGIN_NAME@@ (Action Component)
48
*
59
* @license GPL 2 http://www.gnu.org/licenses/gpl-2.0.html
6-
* @author @@AUTHOR_NAME@@ <@@AUTHOR_MAIL@@>
10+
* @author @@AUTHOR_NAME@@ <@@AUTHOR_MAIL@@>
711
*/
8-
class @@PLUGIN_COMPONENT_NAME@@ extends \dokuwiki\Extension\RemotePlugin
12+
class @@PLUGIN_COMPONENT_NAME@@ extends RemotePlugin
913
{
10-
1114
/**
1215
* Example function
1316
*
@@ -18,10 +21,9 @@ public function myExample($id)
1821
// FIXME handle security in your method!
1922
$id = cleanID($id);
2023
if (auth_quickaclcheck($id) < AUTH_READ) {
21-
throw new RemoteAccessDeniedException('You are not allowed to read this file', 111);
24+
throw new AccessDeniedException('You are not allowed to read this file', 111);
2225
}
2326

2427
return 'example';
2528
}
2629
}
27-

skel/renderer.php

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
<?php
2+
23
/**
34
* DokuWiki Plugin @@PLUGIN_NAME@@ (Renderer Component)
45
*
56
* @license GPL 2 http://www.gnu.org/licenses/gpl-2.0.html
6-
* @author @@AUTHOR_NAME@@ <@@AUTHOR_MAIL@@>
7+
* @author @@AUTHOR_NAME@@ <@@AUTHOR_MAIL@@>
78
*/
89
class @@PLUGIN_COMPONENT_NAME@@ extends Doku_Renderer
910
{
10-
1111
/** @inheritDoc */
1212
public function getFormat()
1313
{
@@ -16,4 +16,3 @@ public function getFormat()
1616

1717
// FIXME implement all methods of Doku_Renderer here
1818
}
19-

skel/renderer_xhtml.php

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
<?php
2+
23
/**
34
* DokuWiki Plugin @@PLUGIN_NAME@@ (Renderer Component)
45
*
56
* @license GPL 2 http://www.gnu.org/licenses/gpl-2.0.html
6-
* @author @@AUTHOR_NAME@@ <@@AUTHOR_MAIL@@>
7+
* @author @@AUTHOR_NAME@@ <@@AUTHOR_MAIL@@>
78
*/
89
class @@PLUGIN_COMPONENT_NAME@@ extends Doku_Renderer_xhtml
910
{
10-
1111
/**
1212
* @inheritDoc
1313
* Make available as XHTML replacement renderer
@@ -22,4 +22,3 @@ public function canRender($format)
2222

2323
// FIXME override any methods of Doku_Renderer_xhtml here
2424
}
25-

skel/syntax.php

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,14 @@
11
<?php
2+
3+
use dokuwiki\Extension\SyntaxPlugin;
4+
25
/**
36
* DokuWiki Plugin @@PLUGIN_NAME@@ (Syntax Component)
47
*
58
* @license GPL 2 http://www.gnu.org/licenses/gpl-2.0.html
6-
* @author @@AUTHOR_NAME@@ <@@AUTHOR_MAIL@@>
9+
* @author @@AUTHOR_NAME@@ <@@AUTHOR_MAIL@@>
710
*/
8-
class @@PLUGIN_COMPONENT_NAME@@ extends \dokuwiki\Extension\SyntaxPlugin
11+
class @@PLUGIN_COMPONENT_NAME@@ extends SyntaxPlugin
912
{
1013
/** @inheritDoc */
1114
public function getType()
@@ -41,7 +44,7 @@ public function connectTo($mode)
4144
/** @inheritDoc */
4245
public function handle($match, $state, $pos, Doku_Handler $handler)
4346
{
44-
$data = array();
47+
$data = [];
4548

4649
return $data;
4750
}
@@ -56,4 +59,3 @@ public function render($mode, Doku_Renderer $renderer, $data)
5659
return true;
5760
}
5861
}
59-

0 commit comments

Comments
 (0)