Skip to content
This repository has been archived by the owner on Mar 9, 2021. It is now read-only.

Commit

Permalink
- Implemented: boolean validator
Browse files Browse the repository at this point in the history
git-svn-id: svn://arbitracker.org/phpillow/trunk@169 c9640fd1-f2a0-481e-a8e5-009dc8289155
  • Loading branch information
jakobwesthoff committed Jun 1, 2011
1 parent a469ab0 commit 7eebc3e
Showing 1 changed file with 44 additions and 0 deletions.
44 changes: 44 additions & 0 deletions src/classes/validator/boolean.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
<?php
/**
* phpillow CouchDB backend
*
* This file is part of phpillow.
*
* phpillow is free software; you can redistribute it and/or modify it under
* the terms of the GNU Lesser General Public License as published by the Free
* Software Foundation; version 3 of the License.
*
* phpillow is distributed in the hope that it will be useful, but WITHOUT ANY
* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for
* more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with phpillow; if not, write to the Free Software Foundation, Inc., 51
* Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*
* @package Core
* @version $Revision$
* @license http://www.gnu.org/licenses/lgpl-3.0.txt LGPL
*/

/**
* validate boolean inputs
*
* @package Core
* @version $Revision$
* @license http://www.gnu.org/licenses/lgpl-3.0.txt LGPL
*/
class phpillowBooleanValidator extends phpillowValidator
{
/**
* Validate input as a boolean
*
* @param mixed $input
* @return bool
*/
public function validate( $input )
{
return (bool) $input;
}
}

0 comments on commit 7eebc3e

Please sign in to comment.