diff options
author | Andreas Gohr <andi@splitbrain.org> | 2023-09-02 14:42:51 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-09-02 14:42:51 +0200 |
commit | 5ff5424d8c81c7123d8656a787af2ff85b3dec21 (patch) | |
tree | 322929ee01d892bb3c927e7fe1238369c647f820 /lib/plugins/styling/action.php | |
parent | 0613df3287b82a98b1e97cf86ed9d4c8fbd16f1c (diff) | |
parent | 91560755291852b8302767d454183a7662666f7e (diff) | |
download | dokuwiki-5ff5424d8c81c7123d8656a787af2ff85b3dec21.tar.gz dokuwiki-5ff5424d8c81c7123d8656a787af2ff85b3dec21.zip |
Merge pull request #4045 from dokuwiki/autofix
Use Rector to autofix code smell
Diffstat (limited to 'lib/plugins/styling/action.php')
-rw-r--r-- | lib/plugins/styling/action.php | 25 |
1 files changed, 15 insertions, 10 deletions
diff --git a/lib/plugins/styling/action.php b/lib/plugins/styling/action.php index 46245ca75..39da86028 100644 --- a/lib/plugins/styling/action.php +++ b/lib/plugins/styling/action.php @@ -1,20 +1,24 @@ <?php + +use dokuwiki\Extension\ActionPlugin; +use dokuwiki\Extension\EventHandler; +use dokuwiki\Extension\Event; + /** * DokuWiki Plugin styling (Action Component) * * @license GPL 2 http://www.gnu.org/licenses/gpl-2.0.html * @author Andreas Gohr <andi@splitbrain.org> */ -class action_plugin_styling extends DokuWiki_Action_Plugin +class action_plugin_styling extends ActionPlugin { - /** * Registers a callback functions * - * @param Doku_Event_Handler $controller DokuWiki's event controller object + * @param EventHandler $controller DokuWiki's event controller object * @return void */ - public function register(Doku_Event_Handler $controller) + public function register(EventHandler $controller) { $controller->register_hook('TPL_METAHEADER_OUTPUT', 'BEFORE', $this, 'handleHeader'); } @@ -22,12 +26,12 @@ class action_plugin_styling extends DokuWiki_Action_Plugin /** * Adds the preview parameter to the stylesheet loading in non-js mode * - * @param Doku_Event $event event object by reference - * @param mixed $param [the parameters passed as fifth argument to register_hook() when this - * handler was registered] + * @param Event $event event object by reference + * @param mixed $param [the parameters passed as fifth argument to register_hook() when this + * handler was registered] * @return void */ - public function handleHeader(Doku_Event &$event, $param) + public function handleHeader(Event &$event, $param) { global $ACT; global $INPUT; @@ -39,10 +43,11 @@ class action_plugin_styling extends DokuWiki_Action_Plugin // set preview $len = count($event->data['link']); for ($i = 0; $i < $len; $i++) { - if ($event->data['link'][$i]['rel'] == 'stylesheet' && + if ( + $event->data['link'][$i]['rel'] == 'stylesheet' && strpos($event->data['link'][$i]['href'], 'lib/exe/css.php') !== false ) { - $event->data['link'][$i]['href'] .= '&preview=1&tseed='.time(); + $event->data['link'][$i]['href'] .= '&preview=1&tseed=' . time(); } } } |