CS: Fix docstrings in Icinga/Web/Widget/* and Icinga/Web/Controller/ActionController.php

refs #4512
This commit is contained in:
Eric Lippmann 2013-08-16 15:05:03 +02:00
parent aff2398c81
commit 7dc2f78b63
6 changed files with 115 additions and 110 deletions

View File

@ -25,6 +25,7 @@
* @author Icinga Development Team <info@icinga.org> * @author Icinga Development Team <info@icinga.org>
*/ */
// {{{ICINGA_LICENSE_HEADER}}} // {{{ICINGA_LICENSE_HEADER}}}
namespace Icinga\Web\Controller; namespace Icinga\Web\Controller;
use \Icinga\Authentication\Manager as AuthManager; use \Icinga\Authentication\Manager as AuthManager;
@ -50,7 +51,6 @@ use \Zend_Controller_Action_HelperBroker as ZfActionHelper;
*/ */
class ActionController extends ZfController class ActionController extends ZfController
{ {
/** /**
* True to mark this layout to not render the full layout * True to mark this layout to not render the full layout
* *
@ -67,7 +67,7 @@ class ActionController extends ZfController
protected $handlesAuthentication = false; protected $handlesAuthentication = false;
/** /**
* Set true when this controller modifies the session. * Set true when this controller modifies the session
* *
* otherwise the session will be written back to disk and closed before the controller * otherwise the session will be written back to disk and closed before the controller
* action is executed, leading to every modification in the session to be lost after * action is executed, leading to every modification in the session to be lost after
@ -81,7 +81,7 @@ class ActionController extends ZfController
* True if authentication suceeded, otherwise false * True if authentication suceeded, otherwise false
* *
* @var bool * @var bool
**/ */
protected $allowAccess = false; protected $allowAccess = false;
@ -107,8 +107,6 @@ class ActionController extends ZfController
*/ */
protected $action_name; protected $action_name;
/** /**
* The constructor starts benchmarking, loads the configuration and sets * The constructor starts benchmarking, loads the configuration and sets
* other useful controller properties * other useful controller properties
@ -148,10 +146,10 @@ class ActionController extends ZfController
} }
/** /**
* Return the @see \Icinga\Widget\Web\Tabs of this view * Return the tabs
* *
* @return Tabs * @return \Icinga\Widget\Web\Tabs
**/ */
public function getTabs() public function getTabs()
{ {
return $this->view->tabs; return $this->view->tabs;

View File

@ -39,7 +39,11 @@ use \Icinga\Web\Url;
class BasketAction implements Tabextension class BasketAction implements Tabextension
{ {
/** /**
* @see Tabextension::apply() * Applies the dashboard actions to the provided tabset
*
* @param Tabs $tabs The tabs object to extend with
*
* @see \Icinga\Web\Widget\Tabextension::apply()
*/ */
public function apply(Tabs $tabs) public function apply(Tabs $tabs)
{ {

View File

@ -43,8 +43,9 @@ class DashboardAction implements Tabextension
/** /**
* Applies the dashboard actions to the provided tabset * Applies the dashboard actions to the provided tabset
* *
* @param Tabs The tabs object to extend with * @param Tabs $tabs The tabs object to extend with
* @see Tabextension::apply() *
* @see \Icinga\Web\Widget\Tabextension::apply()
*/ */
public function apply(Tabs $tabs) public function apply(Tabs $tabs)
{ {

View File

@ -28,15 +28,13 @@
namespace Icinga\Web\Widget\Tabextension; namespace Icinga\Web\Widget\Tabextension;
use Icinga\Application\Logger; use \Icinga\Application\Logger;
use Icinga\Web\Widget\Tab; use \Icinga\Web\Widget\Tab;
use Icinga\Web\Widget\Tabs; use \Icinga\Web\Widget\Tabs;
use Icinga\Web\Url; use \Icinga\Web\Url;
/** /**
* Tabextension that offers different output formats for the user in the dropdown area * Tabextension that offers different output formats for the user in the dropdown area
*
*
*/ */
class OutputFormat implements Tabextension class OutputFormat implements Tabextension
{ {
@ -119,7 +117,7 @@ class OutputFormat implements Tabextension
/** /**
* Applies the format selectio to the provided tabset * Applies the format selectio to the provided tabset
* *
* @param Tabs The tabs object to extend with * @param Tabs $tabs The tabs object to extend with
* *
* @see Tabextension::apply() * @see Tabextension::apply()
*/ */

View File

@ -31,19 +31,20 @@ namespace Icinga\Web\Widget\Tabextension;
use \Icinga\Web\Widget\Tabs; use \Icinga\Web\Widget\Tabs;
/** /**
* Tabextension interface that allows to extend a tabbar with reusable components. * Tabextension interface that allows to extend a tabbar with reusable components
* *
* Tabs can be either extended by creating a tabextension and calling the apply method * Tabs can be either extended by creating a `Tabextension` and calling the `apply()` method
* or by calling the tabs @see \Icinga\Web\Widget\Tabs::extend() method and providing * or by calling the `\Icinga\Web\Widget\Tabs` `extend()` method and providing
* a tab extension. * a tab extension
* *
**/ * @see \Icinga\Web\Widget\Tabs::extend()
*/
interface Tabextension interface Tabextension
{ {
/** /**
* Apply this tabextension to the provided tabs * Apply this tabextension to the provided tabs
* *
* @param Tabs $tabs The tabbar to modify * @param Tabs $tabs The tabbar to modify
**/ */
public function apply(Tabs $tabs); public function apply(Tabs $tabs);
} }

View File

@ -31,12 +31,10 @@ namespace Icinga\Web\Widget;
use \Icinga\Exception\ProgrammingError; use \Icinga\Exception\ProgrammingError;
use \Icinga\Web\Widget\Tabextension\Tabextension; use \Icinga\Web\Widget\Tabextension\Tabextension;
use \Zend_View_Abstract; use \Zend_View_Abstract;
use \Countable; use \Countable;
/** /**
* Navigation tab widget * Navigation tab widget
*
*/ */
class Tabs implements Countable, Widget class Tabs implements Countable, Widget
{ {
@ -59,7 +57,9 @@ EOT;
*/ */
private $dropdownTpl = <<< 'EOT' private $dropdownTpl = <<< 'EOT'
<li class="dropdown pull-right "> <li class="dropdown pull-right ">
<a href="#" class="dropdown-toggle" data-toggle="dropdown"><i class="icon-list-ul"> </i></a> <a href="#" class="dropdown-toggle" data-toggle="dropdown">
<i class="icon-list-ul"></i>
</a>
<ul class="dropdown-menu"> <ul class="dropdown-menu">
{TABS} {TABS}
</ul> </ul>
@ -95,9 +95,10 @@ EOT;
* *
* @param string $name Name of the tab going to be activated * @param string $name Name of the tab going to be activated
* *
* @throws ProgrammingError if given tab name doesn't exist
*
* @return self * @return self
*
* @throws ProgrammingError When the given tab name doesn't exist
*
*/ */
public function activate($name) public function activate($name)
{ {
@ -151,9 +152,9 @@ EOT;
* *
* @param string $name The tab you're interested in * @param string $name The tab you're interested in
* *
* @throws ProgrammingError if given tab name doesn't exist
*
* @return Tab * @return Tab
*
* @throws ProgrammingError When the given tab name doesn't exist
*/ */
public function get($name) public function get($name)
{ {
@ -170,11 +171,11 @@ EOT;
* with tab properties or an instance of an existing Tab * with tab properties or an instance of an existing Tab
* *
* @param string $name The new tab name * @param string $name The new tab name
* @param array|Tab The tab itself of it's properties * @param array|Tab $tab The tab itself of it's properties
*
* @throws ProgrammingError if tab name already exists
* *
* @return self * @return self
*
* @throws ProgrammingError When the tab name already exists
*/ */
public function add($name, $tab) public function add($name, $tab)
{ {
@ -197,7 +198,7 @@ EOT;
* of an existing Tab * of an existing Tab
* *
* @param string $name The new tab name * @param string $name The new tab name
* @param array|Tab The tab itself of it's properties * @param array|Tab $tab The tab itself of it's properties
* *
* @return self * @return self
*/ */
@ -244,7 +245,7 @@ EOT;
} }
$tabs .= $tab->render($view); $tabs .= $tab->render($view);
} }
return str_replace("{TABS}", $tabs, $this->dropdownTpl); return str_replace('{TABS}', $tabs, $this->dropdownTpl);
} }
/** /**
@ -268,6 +269,8 @@ EOT;
} }
/** /**
* Render to HTML
*
* @see Widget::render * @see Widget::render
*/ */
public function render(Zend_View_Abstract $view) public function render(Zend_View_Abstract $view)
@ -277,17 +280,17 @@ EOT;
} }
$html = $this->baseTpl; $html = $this->baseTpl;
$html = str_replace("{TABS}", $this->renderTabs($view), $html); $html = str_replace('{TABS}', $this->renderTabs($view), $html);
$html = str_replace("{DROPDOWN}", $this->renderDropdownTabs($view), $html); $html = str_replace('{DROPDOWN}', $this->renderDropdownTabs($view), $html);
return $html; return $html;
} }
/** /**
* Return the number of tabs * Return the number of tabs
* *
* @see Countable
*
* @return int * @return int
*
* @see Countable
*/ */
public function count() public function count()
{ {