Move form builder’s data handlers into separate namespace
authorMatthias Schmidt <gravatronics@live.com>
Thu, 3 Jan 2019 16:59:51 +0000 (17:59 +0100)
committerMatthias Schmidt <gravatronics@live.com>
Thu, 3 Jan 2019 16:59:51 +0000 (17:59 +0100)
See #2509

wcfsetup/install/files/lib/system/form/builder/FormDataHandler.class.php [deleted file]
wcfsetup/install/files/lib/system/form/builder/FormDocument.class.php
wcfsetup/install/files/lib/system/form/builder/IFormDataHandler.class.php [deleted file]
wcfsetup/install/files/lib/system/form/builder/IFormDocument.class.php
wcfsetup/install/files/lib/system/form/builder/data/FormDataHandler.class.php [new file with mode: 0644]
wcfsetup/install/files/lib/system/form/builder/data/IFormDataHandler.class.php [new file with mode: 0644]

diff --git a/wcfsetup/install/files/lib/system/form/builder/FormDataHandler.class.php b/wcfsetup/install/files/lib/system/form/builder/FormDataHandler.class.php
deleted file mode 100644 (file)
index be508a5..0000000
+++ /dev/null
@@ -1,42 +0,0 @@
-<?php
-namespace wcf\system\form\builder;
-use wcf\system\form\builder\field\data\IFormFieldDataProcessor;
-
-/**
- * Data processor implementation for form fields that populates or manipulates the
- * parameters array passed to the constructor of a database object action.
- * 
- * @author     Matthias Schmidt
- * @copyright  2001-2018 WoltLab GmbH
- * @license    GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
- * @package    WoltLabSuite\Core\System\Form\Builder\Field\Data
- * @since      3.2
- */
-class FormDataHandler implements IFormDataHandler {
-       /**
-        * field data processors
-        * @var IFormFieldDataProcessor[]
-        */
-       protected $processors = [];
-       
-       /**
-        * @inheritDoc
-        */
-       public function add(IFormFieldDataProcessor $processor) {
-               $this->processors[] = $processor;
-               
-               return $this;
-       }
-       
-       /**
-        * @inheritDoc
-        */
-       public function getData(IFormDocument $document) {
-               $parameters = [];
-               foreach ($this->processors as $processor) {
-                       $parameters = $processor($document, $parameters);
-               }
-               
-               return $parameters;
-       }
-}
index 5467a4e16aebc0f3516c4ad4419b56f528bac999..04646f84d79de26d571ba8ae328312c480860b2a 100644 (file)
@@ -1,6 +1,8 @@
 <?php
 namespace wcf\system\form\builder;
 use wcf\data\IStorableObject;
+use wcf\system\form\builder\data\FormDataHandler;
+use wcf\system\form\builder\data\IFormDataHandler;
 use wcf\system\form\builder\field\data\DefaultFormFieldDataProcessor;
 use wcf\system\form\builder\field\IFileFormField;
 use wcf\system\form\builder\field\IFormField;
diff --git a/wcfsetup/install/files/lib/system/form/builder/IFormDataHandler.class.php b/wcfsetup/install/files/lib/system/form/builder/IFormDataHandler.class.php
deleted file mode 100644 (file)
index d782804..0000000
+++ /dev/null
@@ -1,33 +0,0 @@
-<?php
-namespace wcf\system\form\builder;
-use wcf\system\form\builder\field\data\IFormFieldDataProcessor;
-
-/**
- * Represents a data handler that extracts the data of a form document into an array
- * that can be passed to the constructor of a database object action.
- * 
- * @author     Matthias Schmidt
- * @copyright  2001-2018 WoltLab GmbH
- * @license    GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
- * @package    WoltLabSuite\Core\System\Form\Builder
- * @since      3.2
- */
-interface IFormDataHandler {
-       /**
-        * Adds the given field data processor to this data handler and returns
-        * this data handler.
-        * 
-        * @param       IFormFieldDataProcessor         $processor      added field data processor
-        * @return      static                                          this data handler
-        */
-       public function add(IFormFieldDataProcessor $processor);
-       
-       /**
-        * Returns the data from the given form that is passed as the parameters
-        * array to a database object action.
-        * 
-        * @param       IFormDocument   $document       processed form document
-        * @return      array                           data passed to database object action
-        */
-       public function getData(IFormDocument $document);
-}
index 77e59dc66d676b426716f86eee35055eb0848f05..e3536fa1071709ea16ba38b1d0a96fabe34ee829 100644 (file)
@@ -1,6 +1,7 @@
 <?php
 namespace wcf\system\form\builder;
 use wcf\data\IStorableObject;
+use wcf\system\form\builder\data\IFormDataHandler;
 
 /**
  * Represents a "whole" form (document).
diff --git a/wcfsetup/install/files/lib/system/form/builder/data/FormDataHandler.class.php b/wcfsetup/install/files/lib/system/form/builder/data/FormDataHandler.class.php
new file mode 100644 (file)
index 0000000..f75b4a4
--- /dev/null
@@ -0,0 +1,43 @@
+<?php
+namespace wcf\system\form\builder\data;
+use wcf\system\form\builder\field\data\IFormFieldDataProcessor;
+use wcf\system\form\builder\IFormDocument;
+
+/**
+ * Data processor implementation for form fields that populates or manipulates the
+ * parameters array passed to the constructor of a database object action.
+ * 
+ * @author     Matthias Schmidt
+ * @copyright  2001-2018 WoltLab GmbH
+ * @license    GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
+ * @package    WoltLabSuite\Core\System\Form\Builder\Data
+ * @since      3.2
+ */
+class FormDataHandler implements IFormDataHandler {
+       /**
+        * field data processors
+        * @var IFormFieldDataProcessor[]
+        */
+       protected $processors = [];
+       
+       /**
+        * @inheritDoc
+        */
+       public function add(IFormFieldDataProcessor $processor) {
+               $this->processors[] = $processor;
+               
+               return $this;
+       }
+       
+       /**
+        * @inheritDoc
+        */
+       public function getData(IFormDocument $document) {
+               $parameters = [];
+               foreach ($this->processors as $processor) {
+                       $parameters = $processor($document, $parameters);
+               }
+               
+               return $parameters;
+       }
+}
diff --git a/wcfsetup/install/files/lib/system/form/builder/data/IFormDataHandler.class.php b/wcfsetup/install/files/lib/system/form/builder/data/IFormDataHandler.class.php
new file mode 100644 (file)
index 0000000..6e98b50
--- /dev/null
@@ -0,0 +1,34 @@
+<?php
+namespace wcf\system\form\builder\data;
+use wcf\system\form\builder\field\data\IFormFieldDataProcessor;
+use wcf\system\form\builder\IFormDocument;
+
+/**
+ * Represents a data handler that extracts the data of a form document into an array
+ * that can be passed to the constructor of a database object action.
+ * 
+ * @author     Matthias Schmidt
+ * @copyright  2001-2018 WoltLab GmbH
+ * @license    GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
+ * @package    WoltLabSuite\Core\System\Form\Builder\Data
+ * @since      3.2
+ */
+interface IFormDataHandler {
+       /**
+        * Adds the given field data processor to this data handler and returns
+        * this data handler.
+        * 
+        * @param       IFormFieldDataProcessor         $processor      added field data processor
+        * @return      static                                          this data handler
+        */
+       public function add(IFormFieldDataProcessor $processor);
+       
+       /**
+        * Returns the data from the given form that is passed as the parameters
+        * array to a database object action.
+        * 
+        * @param       IFormDocument   $document       processed form document
+        * @return      array                           data passed to database object action
+        */
+       public function getData(IFormDocument $document);
+}