From a00d3ac9e29b23255acaf9226d3769a50634643b Mon Sep 17 00:00:00 2001 From: flack Date: Thu, 20 Oct 2016 11:21:19 +0200 Subject: [PATCH] More phpmd fixes --- lib/errors.php | 8 ++++---- lib/midcom/services/auth/main.php | 3 +-- lib/midcom/services/auth/sessionmgr.php | 6 +++--- lib/midcom/services/toolbars.php | 8 ++++---- lib/net/nehmer/comments/handler/moderate.php | 7 ------- lib/org/openpsa/widgets/calendar/main.php | 1 - 6 files changed, 12 insertions(+), 21 deletions(-) diff --git a/lib/errors.php b/lib/errors.php index 70cdada57f..ad7c12fa76 100644 --- a/lib/errors.php +++ b/lib/errors.php @@ -280,16 +280,16 @@ private function send($httpcode, $message) // Send as email handler if ($error_actions[$httpcode]['action'] == 'email') { - $this->_send_email($httpcode, $msg, $error_actions[$httpcode]); + $this->_send_email($msg, $error_actions[$httpcode]); } // Append to log file handler else if ($error_actions[$httpcode]['action'] == 'log') { - $this->_log($httpcode, $msg, $error_actions[$httpcode]); + $this->_log($msg, $error_actions[$httpcode]); } } - private function _log($httpcode, $msg, array $config) + private function _log($msg, array $config) { if (empty($config['filename'])) { @@ -310,7 +310,7 @@ private function _log($httpcode, $msg, array $config) $logger->log($msg, MIDCOM_LOG_INFO); } - private function _send_email($httpcode, $msg, array $config) + private function _send_email($msg, array $config) { if (empty($config['email'])) { diff --git a/lib/midcom/services/auth/main.php b/lib/midcom/services/auth/main.php index 8d74248c13..590ecf1265 100644 --- a/lib/midcom/services/auth/main.php +++ b/lib/midcom/services/auth/main.php @@ -363,10 +363,9 @@ private function is_admin($user) * @param midcom_core_user $user The user against which to check the privilege, defaults to the currently authenticated user, * you may specify 'EVERYONE' here to check what an anonymous user can do. * @param string $class Optional parameter to set if the check should take type specific permissions into account. The class must be default constructible. - * @param string $component Component providing the class * @return boolean True if the privilege has been granted, false otherwise. */ - public function can_user_do($privilege, $user = null, $class = null, $component = null) + public function can_user_do($privilege, $user = null, $class = null) { if ($this->is_admin($user)) { diff --git a/lib/midcom/services/auth/sessionmgr.php b/lib/midcom/services/auth/sessionmgr.php index 71a7897f91..b6eeb81310 100644 --- a/lib/midcom/services/auth/sessionmgr.php +++ b/lib/midcom/services/auth/sessionmgr.php @@ -272,7 +272,7 @@ private function _do_midgard_auth($username, $password) } $this->user = midcom_connection::login($username, $password); - return $this->_load_person($username); + return $this->_load_person(); } /** @@ -291,10 +291,10 @@ private function _do_trusted_midgard_auth($username) $this->user = midcom_connection::login($username, '', true); - return $this->_load_person($username); + return $this->_load_person(); } - private function _load_person($username) + private function _load_person() { if (!$this->user) { diff --git a/lib/midcom/services/toolbars.php b/lib/midcom/services/toolbars.php index 7c3e2e93ba..5e83ecc505 100644 --- a/lib/midcom/services/toolbars.php +++ b/lib/midcom/services/toolbars.php @@ -371,7 +371,7 @@ function show_node_toolbar($context_id = null) { if (!$this->_centralized_mode) { - echo $this->render_node_toolbar(); + echo $this->render_node_toolbar($context_id); } } @@ -387,7 +387,7 @@ function show_host_toolbar($context_id = null) { if (!$this->_centralized_mode) { - echo $this->render_host_toolbar(); + echo $this->render_host_toolbar($context_id); } } @@ -403,7 +403,7 @@ function show_view_toolbar($context_id = null) { if (!$this->_centralized_mode) { - echo $this->render_view_toolbar(); + echo $this->render_view_toolbar($context_id); } } @@ -419,7 +419,7 @@ function show_help_toolbar($context_id = null) { if (!$this->_centralized_mode) { - echo $this->render_help_toolbar(); + echo $this->render_help_toolbar($context_id); } } diff --git a/lib/net/nehmer/comments/handler/moderate.php b/lib/net/nehmer/comments/handler/moderate.php index 675417609d..701f9cc45a 100644 --- a/lib/net/nehmer/comments/handler/moderate.php +++ b/lib/net/nehmer/comments/handler/moderate.php @@ -20,13 +20,6 @@ class net_nehmer_comments_handler_moderate extends midcom_baseclasses_components */ private $_comment; - /** - * The GUID of the object we're bound to. - * - * @var string GUID - */ - private $_objectguid; - /** * Marks comment as possible abuse * diff --git a/lib/org/openpsa/widgets/calendar/main.php b/lib/org/openpsa/widgets/calendar/main.php index 8b8ed44aaa..03eeba576a 100644 --- a/lib/org/openpsa/widgets/calendar/main.php +++ b/lib/org/openpsa/widgets/calendar/main.php @@ -33,7 +33,6 @@ public static function add_head_elements() if ($lang) { $head->add_jsfile(MIDCOM_STATIC_URL . $prefix . "locale/{$lang}.js"); - $options['lang'] = $lang; } $head->add_stylesheet(MIDCOM_STATIC_URL . $prefix . 'fullcalendar.min.css');