]> git.mxchange.org Git - core.git/blobdiff - framework/main/classes/helper/html/forms/class_HtmlFormHelper.php
Some updates:
[core.git] / framework / main / classes / helper / html / forms / class_HtmlFormHelper.php
index 146be69433f2a2f87d0b383295cf1219bf8e4afa..acfb8d0d66e2ff6535554acb40a29b9907c3becb 100644 (file)
@@ -1,21 +1,28 @@
 <?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
  *
@@ -379,19 +386,16 @@ class HtmlFormHelper extends BaseHtmlHelper implements HelpableTemplate {
         * @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();
@@ -454,19 +458,16 @@ class HtmlFormHelper extends BaseHtmlHelper implements HelpableTemplate {
         * @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();