From 1586275521ccd02bc14360b448809a9fc0a6c41d Mon Sep 17 00:00:00 2001 From: Matthias Jentsch Date: Mon, 4 May 2015 16:30:26 +0200 Subject: [PATCH] Conform to coding guidelines in downtime controller --- .../controllers/DowntimeController.php | 33 ++++++++++++++++--- .../controllers/DowntimesController.php | 29 +++++++++++++--- 2 files changed, 53 insertions(+), 9 deletions(-) diff --git a/modules/monitoring/application/controllers/DowntimeController.php b/modules/monitoring/application/controllers/DowntimeController.php index dcf4dc373..ec1da00ef 100644 --- a/modules/monitoring/application/controllers/DowntimeController.php +++ b/modules/monitoring/application/controllers/DowntimeController.php @@ -13,10 +13,25 @@ use Icinga\Web\Widget\Tabextension\DashboardAction; */ class Monitoring_DowntimeController extends Controller { + /** + * The fetched downtime + * + * @var stdClass + */ protected $downtime; - + + /** + * If the downtime is a service or not + * + * @var boolean + */ protected $isService; - + + /** + * Fetch the downtime matching the given id and add tabs + * + * @throws Zend_Controller_Action_Exception + */ public function init() { $downtimeId = $this->params->get('downtime_id'); @@ -54,7 +69,7 @@ class Monitoring_DowntimeController extends Controller } else { $this->isService = false; } - + $this->getTabs() ->add( 'downtime', @@ -68,7 +83,10 @@ class Monitoring_DowntimeController extends Controller ) )->activate('downtime')->extend(new DashboardAction()); } - + + /** + * Display the detail view for a downtime + */ public function showAction() { $this->view->downtime = $this->downtime; @@ -86,7 +104,12 @@ class Monitoring_DowntimeController extends Controller $this->view->delDowntimeForm = $this->createDelDowntimeForm(); } } - + + /** + * Create a command form to delete a single comment + * + * @return DeleteDowntimeCommandForm + */ private function createDelDowntimeForm() { $this->assertPermission('monitoring/command/downtime/delete'); diff --git a/modules/monitoring/application/controllers/DowntimesController.php b/modules/monitoring/application/controllers/DowntimesController.php index bbd3e1bb4..d25a757b5 100644 --- a/modules/monitoring/application/controllers/DowntimesController.php +++ b/modules/monitoring/application/controllers/DowntimesController.php @@ -14,10 +14,25 @@ use Icinga\Web\Widget\Tabextension\DashboardAction; */ class Monitoring_DowntimesController extends Controller { + /** + * The fetched downtimes + * + * @var array + */ protected $downtimes; - + + /** + * A filter matching all current downtimes + * + * @var Filter + */ protected $filter; - + + /** + * Fetch all downtimes matching the current filter and add tabs + * + * @throws Zend_Controller_Action_Exception + */ public function init() { $this->filter = Filter::fromQueryString(str_replace( @@ -82,7 +97,10 @@ class Monitoring_DowntimesController extends Controller } } } - + + /** + * Display the detail view for a downtime list + */ public function showAction() { $this->view->downtimes = $this->downtimes; @@ -91,7 +109,10 @@ class Monitoring_DowntimesController extends Controller $this->view->removeAllLink = Url::fromPath('monitoring/downtimes/remove-all') ->setParams($this->params); } - + + /** + * Display the form for removing a downtime list + */ public function removeAllAction() { $this->assertPermission('monitoring/command/downtime/delete');