<?php
// Own namespace
-namespace CoreFramework\Helper;
+namespace Org\Mxchange\CoreFramework\Helper;
// Import framework stuff
-use CoreFramework\Database\Frontend\User\UserDatabaseWrapper;
-use CoreFramework\Factory\ObjectFactory;
-use CoreFramework\Generic\EmptyVariableException;
-use CoreFramework\Generic\NullPointerException;
-use CoreFramework\Registry\Registry;
-use CoreFramework\Template\CompileableTemplate;
+use Org\Mxchange\CoreFramework\Database\Frontend\User\UserDatabaseWrapper;
+use Org\Mxchange\CoreFramework\Factory\ObjectFactory;
+use Org\Mxchange\CoreFramework\Generic\NullPointerException;
+use Org\Mxchange\CoreFramework\Helper\Template\HelpableTemplate;
+use Org\Mxchange\CoreFramework\Registry\Registry;
+use Org\Mxchange\CoreFramework\Template\CompileableTemplate;
+
+// Import SPL stuff
+use \InvalidArgumentException;
/**
* A helper for constructing web forms
*
* @author Roland Haeder <webmaster@shipsimu.org>
* @version 0.0.0
+<<<<<<< HEAD:framework/main/classes/helper/html/forms/class_HtmlFormHelper.php
* @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2017 Core Developer Team
+=======
+ * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2016 Core Developer Team
+>>>>>>> Some updates::inc/main/classes/helper/html/forms/class_HtmlFormHelper.php
* @license GNU GPL 3.0 or any newer version
* @link http://www.shipsimu.org
*
* @param $groupText Text including HTML to show above this group
* @return void
* @throws FormClosedException If no form has been opened before
- * @throws EmptyVariableException If $groupId is not set
+ * @throws InvalidArgumentException If $groupId is not set
*/
public function addFormGroup ($groupId = '', $groupText = '') {
// Is a form opened?
if (($this->formOpened === false) && ($this->formEnabled === true)) {
// Throw exception here
throw new FormClosedException(array($this, $groupId), self::EXCEPTION_CLOSED_FORM);
- } // END - if
-
- // At least the group name should be set
- if ((empty($groupId)) && ($this->ifGroupOpenedPreviously() === false)) {
+ } elseif ((empty($groupId)) && ($this->ifGroupOpenedPreviously() === false)) {
// Throw exception here
- throw new EmptyVariableException(array($this, 'groupId'), self::EXCEPTION_UNEXPECTED_EMPTY_STRING);
+ throw new InvalidArgumentException('Parameter "groupId" is empty but group is not closed');
} elseif (empty($groupId)) {
// Close the last opened
$groupId = $this->getPreviousGroupId();
* @param $subGroupText Text including HTML to show above this group
* @return void
* @throws FormFormClosedException If no group has been opened before
- * @throws EmptyVariableException If $subGroupId is not set
+ * @throws InvalidArgumentException If $subGroupId is not set
*/
public function addFormSubGroup ($subGroupId = '', $subGroupText = '') {
// Is a group opened?
if ($this->ifGroupOpenedPreviously() === false) {
// Throw exception here
throw new FormFormClosedException(array($this, $subGroupId), self::EXCEPTION_UNEXPECTED_CLOSED_GROUP);
- } // END - if
-
- // At least the sub group name should be set
- if ((empty($subGroupId)) && ($this->ifSubGroupOpenedPreviously() === false)) {
+ } elseif ((empty($subGroupId)) && ($this->ifSubGroupOpenedPreviously() === false)) {
// Throw exception here
- throw new EmptyVariableException(array($this, 'subGroupId'), self::EXCEPTION_UNEXPECTED_EMPTY_STRING);
+ throw new InvalidArgumentException('Parameter "subGroupId" is empty but sub-group is not closed');
} elseif (empty($subGroupId)) {
// Close the last opened
$subGroupId = $this->getPreviousSubGroupId();