From f1beda3d19078c5b136be0d480a45d86848358cb Mon Sep 17 00:00:00 2001 From: Alexander Purr <purr@ub.uni-leipzig.de> Date: Thu, 23 Dec 2021 16:04:30 +0100 Subject: [PATCH] refs #21064 [fid] code style fid/InputFilter --- .../InputFilter/RootAwareBaseInputFilter.php | 27 ++++++++++++++-- .../InputFilter/UserCreateFormInputFilter.php | 31 ++++++++++++++++--- 2 files changed, 52 insertions(+), 6 deletions(-) diff --git a/module/fid/src/InputFilter/RootAwareBaseInputFilter.php b/module/fid/src/InputFilter/RootAwareBaseInputFilter.php index f85be6465fd..d4963337766 100644 --- a/module/fid/src/InputFilter/RootAwareBaseInputFilter.php +++ b/module/fid/src/InputFilter/RootAwareBaseInputFilter.php @@ -1,7 +1,11 @@ <?php /** + * Root aware base input filter + * * Copyright (C) 2019 Leipzig University Library * + * PHP Version 7 + * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 as * published by the Free Software Foundation. @@ -15,17 +19,36 @@ * with this program; if not, write to the Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. * - * @author Sebastian Kehr <kehr@ub.uni-leipzig.de> - * @license http://opensource.org/licenses/gpl-2.0.php GNU GPLv2 + * @category VuFind + * @package Input_Filter + * @author Sebastian Kehr <kehr@ub.uni-leipzig.de> + * @license http://opensource.org/licenses/gpl-2.0.php GNU GPLv2 + * @link https://vufind.org/wiki/development Wiki */ namespace fid\InputFilter; use Zend\InputFilter\BaseInputFilter; +/** + * Root aware base input filter + * + * @category VuFind + * @package Input_Filter + * @author Sebastian Kehr <kehr@ub.uni-leipzig.de> + * @license http://opensource.org/licenses/gpl-2.0.php GNU GPLv2 + * @link https://vufind.org/wiki/development Wiki + */ class RootAwareBaseInputFilter extends BaseInputFilter { public const ROOT = '__ROOT__'; + /** + * {@inheritdoc} + * + * @param mixed|null $context Context + * + * @return bool + */ public function isValid($context = null) { $values = array_merge($this->getRawValues(), (array)$this->data); diff --git a/module/fid/src/InputFilter/UserCreateFormInputFilter.php b/module/fid/src/InputFilter/UserCreateFormInputFilter.php index a48cfe20d70..4bdb9e93f8e 100644 --- a/module/fid/src/InputFilter/UserCreateFormInputFilter.php +++ b/module/fid/src/InputFilter/UserCreateFormInputFilter.php @@ -1,7 +1,11 @@ <?php /** + * User create form input filter + * * Copyright (C) 2019 Leipzig University Library * + * PHP Version 7 + * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 as * published by the Free Software Foundation. @@ -15,15 +19,34 @@ * with this program; if not, write to the Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. * - * @author Sebastian Kehr <kehr@ub.uni-leipzig.de> - * @author Gregor Gawol <gawol@ub.uni-leipzig.de> - * @author Alexander Purr <purr@ub.uni-leipzig.de> - * @license http://opensource.org/licenses/gpl-2.0.php GNU GPLv2 + * @category VuFind + * @package Input_Filter + * @author Sebastian Kehr <kehr@ub.uni-leipzig.de> + * @author Gregor Gawol <gawol@ub.uni-leipzig.de> + * @author Alexander Purr <purr@ub.uni-leipzig.de> + * @license http://opensource.org/licenses/gpl-2.0.php GNU GPLv2 + * @link https://vufind.org/wiki/development Wiki */ namespace fid\InputFilter; +/** + * User create form input filter + * + * @category VuFind + * @package Input_Filter + * @author Sebastian Kehr <kehr@ub.uni-leipzig.de> + * @author Gregor Gawol <gawol@ub.uni-leipzig.de> + * @author Alexander Purr <purr@ub.uni-leipzig.de> + * @license http://opensource.org/licenses/gpl-2.0.php GNU GPLv2 + * @link https://vufind.org/wiki/development Wiki + */ class UserCreateFormInputFilter extends RootAwareBaseInputFilter { + /** + * Appand standard fidis permissions + * + * @return array + */ public function getValues() { $permissions = [ -- GitLab