From e7696bec89d8ee9c8a3ebeac97ec43a01c000b6b Mon Sep 17 00:00:00 2001 From: Marius Hein Date: Tue, 24 Sep 2013 12:48:30 +0200 Subject: [PATCH] CS: Fixes for controllers: Static, Action, List and Show refs #4611 --- application/controllers/StaticController.php | 5 ++++- .../Icinga/Web/Controller/ActionController.php | 14 +++++++++----- .../application/controllers/ListController.php | 3 +++ .../application/controllers/ShowController.php | 15 ++++++++------- 4 files changed, 24 insertions(+), 13 deletions(-) diff --git a/application/controllers/StaticController.php b/application/controllers/StaticController.php index d67c3459c..0b7b088de 100644 --- a/application/controllers/StaticController.php +++ b/application/controllers/StaticController.php @@ -33,6 +33,9 @@ use \Icinga\Application\Icinga; use \Icinga\Application\Config as IcingaConfig; use \Icinga\Application\Logger; +/** + * Delivery static content to clients + */ class StaticController extends ActionController { /** @@ -132,7 +135,7 @@ class StaticController extends ActionController } /** - * Set cache header for this respone + * Set cache header for this response * * @param integer $maxAge The maximum age to set */ diff --git a/library/Icinga/Web/Controller/ActionController.php b/library/Icinga/Web/Controller/ActionController.php index c9d1e855c..329ccaa62 100755 --- a/library/Icinga/Web/Controller/ActionController.php +++ b/library/Icinga/Web/Controller/ActionController.php @@ -28,6 +28,7 @@ namespace Icinga\Web\Controller; +use \Exception; use \Zend_Controller_Action; use \Zend_Controller_Request_Abstract; use \Zend_Controller_Front; @@ -36,7 +37,6 @@ use \Zend_Controller_Action_HelperBroker; use \Zend_Layout; use \Icinga\Authentication\Manager as AuthManager; use \Icinga\Application\Benchmark; -use \Exception; use \Icinga\Application\Config; use \Icinga\Web\Notification; use \Icinga\Web\Widget\Tabs; @@ -237,16 +237,20 @@ class ActionController extends Zend_Controller_Action * using the version with "_" forces us to use deprecated code. So we try to catch this issue by looking for methods * with the same name, but with a "_" prefix prepended. * - * @param string $name The method name to check - * @param array $params The method parameters + * @param string $name The method name to check + * @param mixed $params The method parameters + * @return mixed Anything the method returns */ public function __call($name, $params) { - $deprecatedMethod = '_'.$name; + $deprecatedMethod = '_' . $name; if (method_exists($this, $deprecatedMethod)) { return call_user_func_array(array($this, $deprecatedMethod), $params); } - return parent::__call($name, $params); + + parent::__call($name, $params); + + return null; } } diff --git a/modules/monitoring/application/controllers/ListController.php b/modules/monitoring/application/controllers/ListController.php index ed7ac8f65..dfa39d7c9 100644 --- a/modules/monitoring/application/controllers/ListController.php +++ b/modules/monitoring/application/controllers/ListController.php @@ -39,6 +39,9 @@ use \Icinga\Module\Monitoring\Backend; use \Icinga\Web\Widget\SortBox; use \Icinga\Application\Config as IcingaConfig; +/** + * Controller for listing views + */ class Monitoring_ListController extends ActionController { /** diff --git a/modules/monitoring/application/controllers/ShowController.php b/modules/monitoring/application/controllers/ShowController.php index fe446efe3..47cc83cf1 100644 --- a/modules/monitoring/application/controllers/ShowController.php +++ b/modules/monitoring/application/controllers/ShowController.php @@ -28,14 +28,15 @@ // @codingStandardsIgnoreStart use \Icinga\Module\Monitoring\Backend; -use Icinga\Web\Controller\ActionController; -use Icinga\Web\Hook; +use \Icinga\Web\Controller\ActionController; +use \Icinga\Web\Hook; use \Icinga\Module\Monitoring\Object\Host; use \Icinga\Module\Monitoring\Object\Service; -use Icinga\Application\Benchmark; -use Icinga\Web\Widget\Tabextension\OutputFormat; -use Icinga\Web\Widget\Tabextension\DashboardAction; -use Icinga\Web\Widget\Tabextension\BasketAction; +use \Icinga\Application\Benchmark; +use \Icinga\Web\Widget\Tabextension\OutputFormat; +use \Icinga\Web\Widget\Tabextension\DashboardAction; +use \Icinga\Web\Widget\Tabextension\BasketAction; +use \Icinga\Web\Widget\Tabs; /** * Class Monitoring_ShowController @@ -355,7 +356,7 @@ class Monitoring_ShowController extends ActionController /** * Creating tabs for this controller - * @return \Icinga\Web\Widget\AbstractWidget + * @return Tabs */ protected function createTabs() {