From eaa1b62053a52ab247f1bc7f50d6e0739befc2cb 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 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); -- 2.39.2