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 /inc/pluginutils.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 'inc/pluginutils.php')
-rw-r--r-- | inc/pluginutils.php | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/inc/pluginutils.php b/inc/pluginutils.php index a93cd4f60..cd26d7e86 100644 --- a/inc/pluginutils.php +++ b/inc/pluginutils.php @@ -1,4 +1,5 @@ <?php + /** * Utilities for handling plugins * @@ -11,10 +12,10 @@ use dokuwiki\Extension\AdminPlugin; use dokuwiki\Extension\PluginController; use dokuwiki\Extension\PluginInterface; -if(!defined('DOKU_PLUGIN')) define('DOKU_PLUGIN',DOKU_INC.'lib/plugins/'); +if (!defined('DOKU_PLUGIN')) define('DOKU_PLUGIN', DOKU_INC . 'lib/plugins/'); // note that only [a-z0-9]+ is officially supported, // this is only to support plugins that don't follow these conventions, too -if(!defined('DOKU_PLUGIN_NAME_REGEX')) define('DOKU_PLUGIN_NAME_REGEX', '[a-zA-Z0-9\x7f-\xff]+'); +if (!defined('DOKU_PLUGIN_NAME_REGEX')) define('DOKU_PLUGIN_NAME_REGEX', '[a-zA-Z0-9\x7f-\xff]+'); /** * Original plugin functions, remain for backwards compatibility @@ -27,12 +28,12 @@ if(!defined('DOKU_PLUGIN_NAME_REGEX')) define('DOKU_PLUGIN_NAME_REGEX', '[a-zA-Z * @param bool $all; true to retrieve all, false to retrieve only enabled plugins * @return array with plugin names or plugin component names */ -function plugin_list($type='',$all=false) +function plugin_list($type = '', $all = false) { /** @var $plugin_controller PluginController */ global $plugin_controller; - $plugins = $plugin_controller->getList($type,$all); - sort($plugins, SORT_NATURAL|SORT_FLAG_CASE); + $plugins = $plugin_controller->getList($type, $all); + sort($plugins, SORT_NATURAL | SORT_FLAG_CASE); return $plugins; } @@ -47,11 +48,11 @@ function plugin_list($type='',$all=false) * @param $disabled bool true to load even disabled plugins * @return PluginInterface|null the plugin object or null on failure */ -function plugin_load($type,$name,$new=false,$disabled=false) +function plugin_load($type, $name, $new = false, $disabled = false) { /** @var $plugin_controller PluginController */ global $plugin_controller; - return $plugin_controller->load($type,$name,$new,$disabled); + return $plugin_controller->load($type, $name, $new, $disabled); } /** @@ -141,7 +142,7 @@ function plugin_getRequestAdminPlugin() if ($admin_plugin && !$admin_plugin->isAccessibleByCurrentUser()) { $admin_plugin = null; $INPUT->remove('page'); - msg('For admins only',-1); + msg('For admins only', -1); } } } |