Fix Menu's PHPDoc

Don't use @var and don't use @return self for fluent interfaces.
This commit is contained in:
Eric Lippmann 2014-11-21 17:13:39 +01:00
parent 2843490250
commit d84318d8b8
1 changed files with 41 additions and 31 deletions

View File

@ -66,14 +66,14 @@ class Menu implements RecursiveIterator
/**
* A custom item renderer used instead of the default rendering logic
*
* @var MenuItemRenderer
* @type MenuItemRenderer
*/
protected $itemRenderer = null;
/*
* Parent menu
*
* @var Menu
* @type Menu
*/
protected $parent;
@ -82,6 +82,7 @@ class Menu implements RecursiveIterator
*
* @param int $id The id of this menu
* @param ConfigObject $config The configuration for this menu
* @param Menu $parent Parent menu
*/
public function __construct($id, ConfigObject $config = null, Menu $parent = null)
{
@ -96,6 +97,10 @@ class Menu implements RecursiveIterator
* Set all given properties
*
* @param array|ConfigObject $props Property list
*
* @return $this
*
* @throws ConfigurationError If a property is invalid
*/
public function setProperties($props = null)
{
@ -145,6 +150,7 @@ class Menu implements RecursiveIterator
* Whether this Menu conflicts with the given Menu object
*
* @param Menu $menu
*
* @return bool
*/
public function conflictsWith(Menu $menu)
@ -158,9 +164,9 @@ class Menu implements RecursiveIterator
/**
* Create menu from the application's menu config file plus the config files from all enabled modules
*
* THIS IS OBSOLATE. LEFT HERE FOR FUTURE USE WITH USER-SPECIFIC MODULES
* @return static
*
* @return self
* @deprecated THIS IS OBSOLETE. LEFT HERE FOR FUTURE USE WITH USER-SPECIFIC MODULES
*/
public static function fromConfig()
{
@ -182,7 +188,7 @@ class Menu implements RecursiveIterator
/**
* Create menu from the application's menu config plus menu entries provided by all enabled modules
*
* @return self
* @return static
*/
public static function load()
{
@ -253,7 +259,7 @@ class Menu implements RecursiveIterator
*
* @param string $id The id to set for this menu
*
* @return self
* @return $this
*/
public function setId($id)
{
@ -300,7 +306,7 @@ class Menu implements RecursiveIterator
*
* @param string $title The title to set for this menu
*
* @return self
* @return $this
*/
public function setTitle($title)
{
@ -323,7 +329,7 @@ class Menu implements RecursiveIterator
*
* @param int $priority The priority to set for this menu
*
* @return self
* @return $this
*/
public function setPriority($priority)
{
@ -346,7 +352,7 @@ class Menu implements RecursiveIterator
*
* @param Url|string $url The url to set for this menu
*
* @return self
* @return $this
*/
public function setUrl($url)
{
@ -373,7 +379,7 @@ class Menu implements RecursiveIterator
*
* @param string $path The path to the icon for this menu
*
* @return self
* @return $this
*/
public function setIcon($path)
{
@ -425,14 +431,14 @@ class Menu implements RecursiveIterator
* Add a sub menu to this menu
*
* @param string $id The id of the menu to add
* @param ConfigObject $itemConfig The config with which to initialize the menu
* @param ConfigObject $menuConfig The config with which to initialize the menu
*
* @return self
* @return static
*/
public function addSubMenu($id, ConfigObject $menuConfig = null)
{
if (false === ($pos = strpos($id, '.'))) {
$subMenu = new self($id, $menuConfig, $this);
$subMenu = new static($id, $menuConfig, $this);
$this->subMenus[$id] = $subMenu;
} else {
list($parentId, $id) = explode('.', $id, 2);
@ -453,6 +459,7 @@ class Menu implements RecursiveIterator
* Set required Permissions
*
* @param $permission
*
* @return $this
*/
public function requirePermission($permission)
@ -465,6 +472,7 @@ class Menu implements RecursiveIterator
* Merge Sub Menus
*
* @param array $submenus
*
* @return $this
*/
public function mergeSubMenus(array $submenus)
@ -479,7 +487,8 @@ class Menu implements RecursiveIterator
* Merge Sub Menu
*
* @param Menu $menu
* @return mixed
*
* @return static
*/
public function mergeSubMenu(Menu $menu)
{
@ -515,7 +524,8 @@ class Menu implements RecursiveIterator
*
* @param $name
* @param array $config
* @return Menu
*
* @return static
*/
public function add($name, $config = array())
{
@ -539,7 +549,7 @@ class Menu implements RecursiveIterator
*
* @param string $id The id of the sub menu
*
* @return Menu The found sub menu
* @return static The found sub menu
*
* @throws ProgrammingError In case there is no sub menu with the given id to be found
*/
@ -558,7 +568,7 @@ class Menu implements RecursiveIterator
/**
* Order this menu's sub menus based on their priority
*
* @return self
* @return $this
*/
public function order()
{
@ -618,7 +628,7 @@ class Menu implements RecursiveIterator
*
* @param array $menus The menus to load, as key-value array
*
* @return self
* @return static
*/
protected function loadSubMenus(array $menus)
{
@ -675,7 +685,7 @@ class Menu implements RecursiveIterator
/**
* Return the current menu node
*
* @return Menu
* @return static
*/
public function current()
{