From 4d41c5f56c4be5de7fc19a96b48d72da1b798296 Mon Sep 17 00:00:00 2001 From: Abdul Malik Ikhsan Date: Tue, 1 Apr 2014 05:29:26 +0700 Subject: [PATCH] incorporate feedback : patch use Exception, exception message, and @throws docblock --- src/Helper/HtmlList.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/Helper/HtmlList.php b/src/Helper/HtmlList.php index bbab5fb7..e283d7af 100644 --- a/src/Helper/HtmlList.php +++ b/src/Helper/HtmlList.php @@ -9,7 +9,7 @@ namespace Zend\View\Helper; -use Zend\View\Exception\InvalidArgumentException; +use Zend\View\Exception; /** * Helper for ordered and unordered lists @@ -23,12 +23,16 @@ class HtmlList extends AbstractHtmlElement * @param bool $ordered Specifies ordered/unordered list; default unordered * @param array $attribs Attributes for the ol/ul tag. * @param bool $escape Escape the items. + * @throws Exception\InvalidArgumentException * @return string The list XHTML. */ public function __invoke(array $items, $ordered = false, $attribs = false, $escape = true) { if (empty($items)) { - throw new InvalidArgumentException("An empty items of HtmlList isn't allowed"); + throw new Exception\InvalidArgumentException(sprintf( + '$items array can not be empty in %s', + __METHOD__ + )); } $list = '';