Skip to content
Snippets Groups Projects
Commit 57b7e1aa authored by David Siegfried's avatar David Siegfried
Browse files

prevent php-warnings, cleanup php-doc and remove unused variables, fixes #3928

Closes #3928

Merge request studip/studip!2783
parent 1afde945
No related branches found
No related tags found
No related merge requests found
...@@ -86,7 +86,7 @@ class Admin_PluginController extends AuthenticatedController ...@@ -86,7 +86,7 @@ class Admin_PluginController extends AuthenticatedController
* update information is available, an error message is set in * update information is available, an error message is set in
* this controller and an empty array is returned. * this controller and an empty array is returned.
* *
* @param array array of plugin meta data * @param array $plugins array of plugin meta data
*/ */
private function get_update_info($plugins) private function get_update_info($plugins)
{ {
...@@ -127,7 +127,6 @@ class Admin_PluginController extends AuthenticatedController ...@@ -127,7 +127,6 @@ class Admin_PluginController extends AuthenticatedController
} }
$plugin_manager = PluginManager::getInstance(); $plugin_manager = PluginManager::getInstance();
$plugin_filter = Request::option('plugin_filter', '');
$plugins = $plugin_manager->getPluginInfos($this->plugin_filter); $plugins = $plugin_manager->getPluginInfos($this->plugin_filter);
...@@ -200,7 +199,6 @@ class Admin_PluginController extends AuthenticatedController ...@@ -200,7 +199,6 @@ class Admin_PluginController extends AuthenticatedController
_('Die Position von Plugin "%s" wurde verändert.'), _('Die Position von Plugin "%s" wurde verändert.'),
$plugin['name'] $plugin['name']
); );
$changed = true;
} }
} }
} }
...@@ -344,7 +342,7 @@ class Admin_PluginController extends AuthenticatedController ...@@ -344,7 +342,7 @@ class Admin_PluginController extends AuthenticatedController
/** /**
* Ask for confirmation from the user before deleting a plugin. * Ask for confirmation from the user before deleting a plugin.
* *
* @param integer id of plugin to delete * @param int $plugin_id id of plugin to delete
*/ */
public function ask_delete_action($plugin_id) public function ask_delete_action($plugin_id)
{ {
...@@ -366,7 +364,7 @@ class Admin_PluginController extends AuthenticatedController ...@@ -366,7 +364,7 @@ class Admin_PluginController extends AuthenticatedController
/** /**
* Completely delete a plugin from the system. * Completely delete a plugin from the system.
* *
* @param integer id of plugin to delete * @param int $plugin_id id of plugin to delete
*/ */
public function delete_action($plugin_id) public function delete_action($plugin_id)
{ {
...@@ -390,7 +388,7 @@ class Admin_PluginController extends AuthenticatedController ...@@ -390,7 +388,7 @@ class Admin_PluginController extends AuthenticatedController
/** /**
* Download a ZIP file containing the given plugin. * Download a ZIP file containing the given plugin.
* *
* @param integer id of plugin to download * @param int $plugin_id id of plugin to download
*/ */
public function download_action($plugin_id) public function download_action($plugin_id)
{ {
...@@ -441,16 +439,16 @@ class Admin_PluginController extends AuthenticatedController ...@@ -441,16 +439,16 @@ class Admin_PluginController extends AuthenticatedController
$update_info = $this->plugin_admin->getUpdateInfo($plugins); $update_info = $this->plugin_admin->getUpdateInfo($plugins);
$update = $this->flash['update']; $update = $this->flash['update'];
$update_status = [];
if (!empty($update)) { // update each plugin in turn
// update each plugin in turn foreach ($update as $id) {
foreach ($update as $id) { if (isset($update_info[$id]['update'])) {
if (isset($update_info[$id]['update'])) { try {
try { $update_url = $update_info[$id]['update']['url'];
$update_url = $update_info[$id]['update']['url']; $this->plugin_admin->installPluginFromURL($update_url);
$this->plugin_admin->installPluginFromURL($update_url); } catch (PluginInstallationException $ex) {
} catch (PluginInstallationException $ex) { $update_errors[] = sprintf('%s: %s', $plugins[$id]['name'], $ex->getMessage());
$update_errors[] = sprintf('%s: %s', $plugins[$id]['name'], $ex->getMessage()); }
} }
} }
} }
...@@ -473,6 +471,8 @@ class Admin_PluginController extends AuthenticatedController ...@@ -473,6 +471,8 @@ class Admin_PluginController extends AuthenticatedController
/** /**
* Show a page describing this plugin's meta data and description, * Show a page describing this plugin's meta data and description,
* if available. * if available.
*
* @param int $plugin_id if of plugin to show manifest
*/ */
public function manifest_action($plugin_id) public function manifest_action($plugin_id)
{ {
...@@ -491,7 +491,7 @@ class Admin_PluginController extends AuthenticatedController ...@@ -491,7 +491,7 @@ class Admin_PluginController extends AuthenticatedController
/** /**
* migrate a plugin to top version * migrate a plugin to top version
* *
* @param integer id of plugin to migrate * @param int $plugin_id id of plugin to migrate
*/ */
public function migrate_action($plugin_id) public function migrate_action($plugin_id)
{ {
...@@ -516,7 +516,7 @@ class Admin_PluginController extends AuthenticatedController ...@@ -516,7 +516,7 @@ class Admin_PluginController extends AuthenticatedController
* register a plugin in database when it * register a plugin in database when it
* already exists in file system * already exists in file system
* *
* @param integer number of found plugin * @param int $number number of found plugin
*/ */
public function register_action($number) public function register_action($number)
{ {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment