From 823e1f4caea4652b14784f32e2ba242020180ead Mon Sep 17 00:00:00 2001 From: Roland Haeder Date: Tue, 16 Sep 2014 19:07:39 +0200 Subject: [PATCH] Added asserts + remove wrong type-hint (was no array). Signed-off-by: Roland Haeder --- lib/menu.php | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) 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); -- 2.39.5