aboutsummaryrefslogtreecommitdiff
path: root/lib/plugins/engine/PluginEngine.class.php
diff options
context:
space:
mode:
authorJan-Hendrik Willms <tleilax+studip@gmail.com>2024-05-15 20:50:29 +0000
committerJan-Hendrik Willms <tleilax+studip@gmail.com>2024-05-15 20:50:29 +0000
commit5b4b7f540bdaaba71557ffd528319025ebf028d2 (patch)
tree59e5efad02c53fda815c5ce945f24ca5a65241ea /lib/plugins/engine/PluginEngine.class.php
parentf9c634a9fe0fb5ac4c5a391fea813603631afc0f (diff)
fixes #4133
Closes #4133 Merge request studip/studip!2978
Diffstat (limited to 'lib/plugins/engine/PluginEngine.class.php')
-rw-r--r--lib/plugins/engine/PluginEngine.class.php21
1 files changed, 10 insertions, 11 deletions
diff --git a/lib/plugins/engine/PluginEngine.class.php b/lib/plugins/engine/PluginEngine.class.php
index ecf00cf..25974c5 100644
--- a/lib/plugins/engine/PluginEngine.class.php
+++ b/lib/plugins/engine/PluginEngine.class.php
@@ -3,8 +3,7 @@
/**
* Factory Class for the plugin engine
* @author Dennis Reil, <dennis.reil@offis.de>
- * @package pluginengine
- * @subpackage engine
+ * @template P of StudIPPlugin
*/
class PluginEngine
@@ -38,27 +37,28 @@ class PluginEngine
global $user, $perm;
// load system plugins
- self::getPlugins('SystemPlugin');
+ self::getPlugins(SystemPlugin::class);
// load homepage plugins
- self::getPlugins('HomepagePlugin');
+ self::getPlugins(HomepagePlugin::class);
// load course plugins
if (Context::getId()) {
- self::getPlugins('StudipModule');
- self::getPlugins('StandardPlugin');
+ self::getPlugins(StudipModule::class);
+ self::getPlugins(StandardPlugin::class);
}
// load admin plugins
if (is_object($user) && $perm->have_perm('admin')) {
- self::getPlugins('AdministrationPlugin');
+ self::getPlugins(AdministrationPlugin::class);
}
}
/**
* Get instance of the plugin specified by plugin class name.
*
- * @param string $class class name of plugin
+ * @param class-string<P> $class class name of plugin
+ * @return P
*/
public static function getPlugin ($class)
{
@@ -70,10 +70,9 @@ class PluginEngine
* returns all enabled plugins. The optional context parameter can be
* used to get only plugins that are activated in the given context.
*
- * @template T
- * @param T $type plugin type or null (all types)
+ * @param class-string<P>|null $type plugin type or null (all types)
* @param string $context context range id (optional)
- * @return T[] all plugins of the specified type
+ * @return P[]|StudIPPlugin[] all plugins of the specified type
*/
public static function getPlugins ($type, $context = null)
{