Skip to content
Snippets Groups Projects
Commit f1beda3d authored by Alexander Purr's avatar Alexander Purr
Browse files

refs #21064 [fid] code style fid/InputFilter

parent e7c171e3
Branches
Tags
No related merge requests found
<?php <?php
/** /**
* Root aware base input filter
*
* Copyright (C) 2019 Leipzig University Library * Copyright (C) 2019 Leipzig University Library
* *
* PHP Version 7
*
* This program is free software; you can redistribute it and/or modify * 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 * it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation. * published by the Free Software Foundation.
...@@ -15,17 +19,36 @@ ...@@ -15,17 +19,36 @@
* with this program; if not, write to the Free Software Foundation, Inc., * with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
* *
* @author Sebastian Kehr <kehr@ub.uni-leipzig.de> * @category VuFind
* @license http://opensource.org/licenses/gpl-2.0.php GNU GPLv2 * @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; namespace fid\InputFilter;
use Zend\InputFilter\BaseInputFilter; 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 class RootAwareBaseInputFilter extends BaseInputFilter
{ {
public const ROOT = '__ROOT__'; public const ROOT = '__ROOT__';
/**
* {@inheritdoc}
*
* @param mixed|null $context Context
*
* @return bool
*/
public function isValid($context = null) public function isValid($context = null)
{ {
$values = array_merge($this->getRawValues(), (array)$this->data); $values = array_merge($this->getRawValues(), (array)$this->data);
......
<?php <?php
/** /**
* User create form input filter
*
* Copyright (C) 2019 Leipzig University Library * Copyright (C) 2019 Leipzig University Library
* *
* PHP Version 7
*
* This program is free software; you can redistribute it and/or modify * 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 * it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation. * published by the Free Software Foundation.
...@@ -15,15 +19,34 @@ ...@@ -15,15 +19,34 @@
* with this program; if not, write to the Free Software Foundation, Inc., * with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
* *
* @author Sebastian Kehr <kehr@ub.uni-leipzig.de> * @category VuFind
* @author Gregor Gawol <gawol@ub.uni-leipzig.de> * @package Input_Filter
* @author Alexander Purr <purr@ub.uni-leipzig.de> * @author Sebastian Kehr <kehr@ub.uni-leipzig.de>
* @license http://opensource.org/licenses/gpl-2.0.php GNU GPLv2 * @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; 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 class UserCreateFormInputFilter extends RootAwareBaseInputFilter
{ {
/**
* Appand standard fidis permissions
*
* @return array
*/
public function getValues() public function getValues()
{ {
$permissions = [ $permissions = [
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment