From: Matthias Schmidt Date: Thu, 3 Jan 2019 16:59:51 +0000 (+0100) Subject: Move form builder’s data handlers into separate namespace X-Git-Tag: 5.2.0_Alpha_1~383^2~3 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=43da8a75a7862f499118407aa89b3965cd274cc3;p=GitHub%2FWoltLab%2FWCF.git Move form builder’s data handlers into separate namespace See #2509 --- 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 index be508a50a3..0000000000 --- a/wcfsetup/install/files/lib/system/form/builder/FormDataHandler.class.php +++ /dev/null @@ -1,42 +0,0 @@ - - * @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; - } -} diff --git a/wcfsetup/install/files/lib/system/form/builder/FormDocument.class.php b/wcfsetup/install/files/lib/system/form/builder/FormDocument.class.php index 5467a4e16a..04646f84d7 100644 --- a/wcfsetup/install/files/lib/system/form/builder/FormDocument.class.php +++ b/wcfsetup/install/files/lib/system/form/builder/FormDocument.class.php @@ -1,6 +1,8 @@ - * @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); -} diff --git a/wcfsetup/install/files/lib/system/form/builder/IFormDocument.class.php b/wcfsetup/install/files/lib/system/form/builder/IFormDocument.class.php index 77e59dc66d..e3536fa107 100644 --- a/wcfsetup/install/files/lib/system/form/builder/IFormDocument.class.php +++ b/wcfsetup/install/files/lib/system/form/builder/IFormDocument.class.php @@ -1,6 +1,7 @@ + * @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 index 0000000000..6e98b5023e --- /dev/null +++ b/wcfsetup/install/files/lib/system/form/builder/data/IFormDataHandler.class.php @@ -0,0 +1,34 @@ + + * @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); +}