Skip to content

Commit

Permalink
replace return '' by throw
Browse files Browse the repository at this point in the history
  • Loading branch information
hans2103 committed Oct 26, 2020
1 parent 1df96a3 commit 04c3854
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
3 changes: 2 additions & 1 deletion administrator/language/en-GB/lib_joomla.ini
Original file line number Diff line number Diff line change
Expand Up @@ -502,7 +502,8 @@ JLIB_HTML_FEATURED_ITEM="Featured."
JLIB_HTML_FEATURED_PENDING_ITEM="Featured, but is Pending."
JLIB_HTML_FEATURED_STARTED="Start: %s"
JLIB_HTML_GOTO_PAGE="Go to page %s"
JLIB_HTML_GOTO_POSITION="Go to %s page"
JLIB_HTML_GOTO_POSITION="Go to %s page."
JLIB_HTML_ICONS_NO_ICON="No icon provided
JLIB_HTML_MOVE_DOWN="Move Down"
JLIB_HTML_MOVE_UP="Move Up"
JLIB_HTML_NO_PARAMETERS_FOR_THIS_ITEM="There are no parameters for this item."
Expand Down
5 changes: 4 additions & 1 deletion libraries/src/HTML/Helpers/Icons.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@

use Joomla\CMS\Factory;
use Joomla\CMS\HTML\HTMLHelper;
use Joomla\CMS\Language\Text;
use Joomla\CMS\Layout\FileLayout;
use Joomla\Utilities\ArrayHelper;

Expand All @@ -31,13 +32,15 @@ abstract class Icons
*
* @return string
*
* @throws \InvalidArgumentException
*
* @since __DEPLOY_VERSION__
*/
public static function icon(string $icon = '', string $srOnly = '', array $attribs = [])
{
if ($icon === '')
{
return '';
throw new \InvalidArgumentException(Text::_('JLIB_HTML_ICONS_NO_ICON'));
}

if (isset($attribs['class']))
Expand Down

0 comments on commit 04c3854

Please sign in to comment.