Skip to content

Commit

Permalink
🤖 Automatic code style fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
annda committed Oct 18, 2023
1 parent d89a28e commit 540d31b
Show file tree
Hide file tree
Showing 5 changed files with 27 additions and 14 deletions.
14 changes: 9 additions & 5 deletions action.php
@@ -1,15 +1,19 @@
<?php

use dokuwiki\Extension\ActionPlugin;
use dokuwiki\Extension\EventHandler;
use dokuwiki\Extension\Event;

/**
* DokuWiki Plugin lms (Action Component)
*
* @license GPL 2 http://www.gnu.org/licenses/gpl-2.0.html
* @author Andreas Gohr <dokuwiki@cosmocode.de>
*/
class action_plugin_lms extends \dokuwiki\Extension\ActionPlugin
class action_plugin_lms extends ActionPlugin
{
/** @inheritDoc */
public function register(Doku_Event_Handler $controller)
public function register(EventHandler $controller)
{
$controller->register_hook('DOKUWIKI_STARTED', 'AFTER', $this, 'handleStart');
$controller->register_hook('ACTION_ACT_PREPROCESS', 'BEFORE', $this, 'handleAction');
Expand All @@ -23,7 +27,7 @@ public function register(Doku_Event_Handler $controller)
* @param mixed $param optional parameter passed when event was registered
* @return void
*/
public function handleStart(Doku_Event $event, $param)
public function handleStart(Event $event, $param)
{
global $JSINFO;
global $INPUT;
Expand All @@ -45,7 +49,7 @@ public function handleStart(Doku_Event $event, $param)
* @param mixed $param optional parameter passed when event was registered
* @return void
*/
public function handleAction(Doku_Event $event, $param)
public function handleAction(Event $event, $param)
{
global $INPUT;
global $ID;
Expand Down Expand Up @@ -89,7 +93,7 @@ public function handleAction(Doku_Event $event, $param)
* @param Doku_Event $event
* @return void
*/
public function handleAdminAjax(Doku_Event $event)
public function handleAdminAjax(Event $event)
{
if ($event->data !== 'plugin_lms_autocomplete') return;
global $INPUT;
Expand Down
7 changes: 5 additions & 2 deletions admin.php
@@ -1,12 +1,15 @@
<?php

use dokuwiki\Extension\AdminPlugin;
use dokuwiki\Form\Form;

/**
* DokuWiki Plugin lms (Admin Component)
*
* @license GPL 2 http://www.gnu.org/licenses/gpl-2.0.html
* @author Andreas Gohr <dokuwiki@cosmocode.de>
*/
class admin_plugin_lms extends \dokuwiki\Extension\AdminPlugin
class admin_plugin_lms extends AdminPlugin
{
/** @inheritDoc */
public function forAdminOnly()
Expand All @@ -27,7 +30,7 @@ public function html()

echo '<h1>' . $this->getLang('menu') . '</h1>';

$form = new dokuwiki\Form\Form(['method' => 'POST', 'id' => 'lms__admin-autocomplete']);
$form = new Form(['method' => 'POST', 'id' => 'lms__admin-autocomplete']);
$form->addTextInput('user', $this->getLang('username'));
$form->addButton('submit', '🔍');
echo '<p>' . $form->toHTML() . '</p>';
Expand Down
8 changes: 5 additions & 3 deletions helper.php
@@ -1,12 +1,14 @@
<?php

use dokuwiki\Extension\Plugin;

/**
* DokuWiki Plugin lms (Helper Component)
*
* @license GPL 2 http://www.gnu.org/licenses/gpl-2.0.html
* @author Andreas Gohr <dokuwiki@cosmocode.de>
*/
class helper_plugin_lms extends \dokuwiki\Extension\Plugin
class helper_plugin_lms extends Plugin
{
/**
* Return all lessons and info about the user's current completion status
Expand Down Expand Up @@ -76,7 +78,7 @@ public function getUserLessons($user)
$lessons = [];
$lines = file($file);
foreach ($lines as $line) {
list($time, $id, $seen) = explode("\t", trim($line));
[$time, $id, $seen] = explode("\t", trim($line));

// we use simple log files
if ($seen) {
Expand All @@ -99,7 +101,7 @@ public function getUserLessons($user)
public function getLesson($id, $user)
{
$all = $this->getLessons($user);
return isset($all[$id]) ? $all[$id] : false;
return $all[$id] ?? false;
}

/**
Expand Down
6 changes: 4 additions & 2 deletions syntax/include.php
@@ -1,12 +1,14 @@
<?php

use dokuwiki\Extension\SyntaxPlugin;

/**
* DokuWiki Plugin lms (Syntax Component)
*
* @license GPL 2 http://www.gnu.org/licenses/gpl-2.0.html
* @author Andreas Gohr <dokuwiki@cosmocode.de>
*/
class syntax_plugin_lms_include extends \dokuwiki\Extension\SyntaxPlugin
class syntax_plugin_lms_include extends SyntaxPlugin
{
/** @var helper_plugin_lms */
protected $hlp;
Expand Down Expand Up @@ -51,7 +53,7 @@ public function connectTo($mode)
/** @inheritDoc */
public function handle($match, $state, $pos, Doku_Handler $handler)
{
$data = array();
$data = [];

return $data;
}
Expand Down
6 changes: 4 additions & 2 deletions syntax/lms.php
@@ -1,12 +1,14 @@
<?php

use dokuwiki\Extension\SyntaxPlugin;

/**
* DokuWiki Plugin lms (Syntax Component)
*
* @license GPL 2 http://www.gnu.org/licenses/gpl-2.0.html
* @author Andreas Gohr <dokuwiki@cosmocode.de>
*/
class syntax_plugin_lms_lms extends \dokuwiki\Extension\SyntaxPlugin
class syntax_plugin_lms_lms extends SyntaxPlugin
{
/** @var helper_plugin_lms */
protected $hlp;
Expand Down Expand Up @@ -51,7 +53,7 @@ public function connectTo($mode)
/** @inheritDoc */
public function handle($match, $state, $pos, Doku_Handler $handler)
{
$data = array();
$data = [];

return $data;
}
Expand Down

0 comments on commit 540d31b

Please sign in to comment.