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=370836cffce012b45c766af30707b6dee3658182;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 27503aa06b..a64bea79e6 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);