From: Roland Haeder Date: Tue, 16 Sep 2014 17:07:39 +0000 (+0200) Subject: Added asserts + remove wrong type-hint (was no array). X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=823e1f4caea4652b14784f32e2ba242020180ead;p=quix0rs-gnu-social.git Added asserts + remove wrong type-hint (was no array). Signed-off-by: Roland Haeder --- diff --git a/lib/menu.php b/lib/menu.php index 5fd58f1077..087666617d 100644 --- a/lib/menu.php +++ b/lib/menu.php @@ -94,17 +94,21 @@ class Menu extends Widget $this->out->elementStart('ul', $attrs); foreach ($items as $item) { + assert(is_array($item)); + assert(count($item) == 5); + list($actionName, $args, $label, $description, $id) = $item; + $this->item($actionName, $args, $label, $description, $id); } - + $this->out->elementEnd('ul'); - + Event::handle('EndNav', array($this, $tag, $items)); } } - - function item($actionName, array $args, $label, $description, $id=null, $cls=null) + + function item($actionName, $args, $label, $description, $id=null, $cls=null) { if (empty($id)) { $id = $this->menuItemID($actionName, $args);